> This page is for version Preview (default).
> For other versions, use one of these documentation indexes:
> - Preview (default): https://docs.preview.paid.ai/preview/llms.txt
> - Current: https://docs.preview.paid.ai/current/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.preview.paid.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.preview.paid.ai/_mcp/server.

# Meters

> Turn the events you send into the quantities you bill, without putting billing logic in your code.

A **meter** turns the events you send into the quantities you bill. You send Paid what happened, such as a model call with its token counts, and a meter decides what part of it is billable: every call, the output tokens, or the number of distinct conversations. Meters live in Paid rather than in your code, so you can change what you charge for without changing what you send.

Use a meter to:

* **Bill for usage** by pointing a [usage price](/catalog/prices) or a [rate card](/core-concepts/introduction-to-pricing) at it.
* **Report usage** to your team and your customers with [usage summaries](/usage/usage-summaries), whether or not you charge for it.
* **Bill for results** rather than activity, with a [workflow meter](/usage/workflows-and-outcomes).

Meters are in the `meters=v1` private beta: send `Paid-Beta: meters=v1` with each request.

## How a meter works

A meter does two things to every event you send:

1. **It selects.** It reads only the events whose name it lists, and only those that pass its filters.
2. **It measures.** It aggregates what it selected over each billing period: it counts the events, or sums, averages or takes the maximum of a field on them.

The result is a quantity in an explicit unit, such as `412000 token`, for each customer and billing period. Prices turn that quantity into money or credits.

This page covers event meters, which measure over a billing period. A [workflow meter](/usage/workflows-and-outcomes) instead groups related events, such as the messages in one support ticket, and measures each group by its outcome.

## Create a meter

Lucerne runs a chat app that calls a language model for every message. It sends one `chat_message` event per reply, with the model call as an inference [cost line](/usage/event-costs), and charges for the output tokens. This meter sums them:

#### API

[Create a meter](../api-reference/metering/meters/create) with a `key`, the events it reads and how it measures them.

**`POST /v1/meters`**

```json title="POST /v1/meters"
{
  "key": "output_tokens",
  "name": "Output tokens",
  "description": "Output tokens generated for chat replies.",
  "eventNames": ["chat_message"],
  "measure": {
    "type": "events",
    "events": {
      "aggregation": {
        "type": "sum",
        "sum": { "path": "cost.inference.outputTokens" }
      },
      "unit": "token"
    }
  }
}
```

**`Response`**

```json title="Response"
{
  "id": "mtr_6Hn2Qa",
  "object": "meter",
  "livemode": false,
  "key": "output_tokens",
  "name": "Output tokens",
  "description": "Output tokens generated for chat replies.",
  "eventNames": ["chat_message"],
  "eventNamePattern": null,
  "filters": [],
  "validationMode": "lenient",
  "measure": {
    "type": "events",
    "events": {
      "aggregation": {
        "type": "sum",
        "sum": { "path": "cost.inference.outputTokens" }
      },
      "unit": "token"
    }
  },
  "metadata": {},
  "health": {
    "lastMatchedAt": null,
    "matchedEvents24h": 0,
    "invalidValues24h": 0,
    "warnings": []
  },
  "createdAt": "2026-11-01T09:10:00Z",
  "updatedAt": "2026-11-01T09:10:00Z",
  "archivedAt": null
}
```

Prices and the API refer to the meter by its `key` or its `mtr_` ID. The key is unique on your account and can't change.

#### Dashboard

> **Draft**
>
> These steps describe the planned v1 dashboard and will change before release.

1. Go to **Configure > Meters** and click **Create meter**.
2. Enter a **Key** (`output_tokens`), which can't change later, and a **Name** for your team.
3. Under **Events**, add the event name `chat_message`. Add filters if only some of those events are billable.
4. Choose **Sum** and the field **cost > inference > outputTokens**, and set the unit to `token`.
5. Review the summary and click **Create meter**.

## Select events

A meter reads events by name, given in one of two ways:

* `eventNames`: exact names, such as `["chat_message"]`.
* `eventNamePattern`: a regular expression for a family of names, such as `^report_`.

Event names aren't registered anywhere, so a name you never send isn't an error. It shows up as a warning in the meter's [health](#check-a-meters-health).

Add `filters` to narrow the selection. Every filter must hold, and an event without the filtered field doesn't match:

```json
"filters": [
  { "path": "payload.plan", "op": "eq", "value": "pro" }
]
```

| `op`          | Holds when the field                       |
| ------------- | ------------------------------------------ |
| `eq`, `ne`    | equals, or doesn't equal, `value`          |
| `in`, `notIn` | is, or isn't, one of the values in `value` |
| `exists`      | is present (send no `value`)               |

## Measure

`measure.events.aggregation` sets how the selected events add up over a billing period:

| `type`        | The meter's quantity is                  | Example                       |
| ------------- | ---------------------------------------- | ----------------------------- |
| `count`       | the number of events                     | API calls                     |
| `sum`         | the total of a field                     | output tokens, pages reviewed |
| `max`, `min`  | the largest or smallest value of a field | peak concurrent sessions      |
| `average`     | the mean value of a field                | average response size         |
| `latest`      | the most recent value of a field         | storage in use                |
| `uniqueCount` | the number of distinct values of a field | conversations, active users   |

Every aggregation except `count` reads one field, named by its `path`. `unit` names what the quantity is in, such as `token` or `conversation`; for `count` it defaults to `event`. A meter's unit is what's counted. It's separate from the currency or [credit currency](/credits/how-credits-work#credit-currencies) a price charges in.

To bill per conversation instead of per message, count distinct correlation IDs:

```json
"aggregation": { "type": "uniqueCount", "uniqueCount": { "path": "correlationId" } },
"unit": "conversation"
```

### Paths

| Path                                   | Reads                                                                                                                            |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `payload.<field>`                      | your own event data, such as `payload.pages`                                                                                     |
| `cost.<type>.<field>`                  | a field on the event's [cost lines](/usage/event-costs) of that type, summed across lines, such as `cost.inference.outputTokens` |
| `correlationId`, `customer`, `product` | the event's top-level fields                                                                                                     |

Reading tokens from `cost` lets you send them once, then both bill them and see what they cost you. To bill input tokens, sum `cost.inference.uncachedInputTokens`, which Paid calculates. `inputTokens` also includes cached tokens, which a cache meter may already count.

A value at a path must be an integer or a decimal string, such as `"12.5"`. A JSON number with a fractional part is rejected, because binary floating point can't represent most decimal amounts exactly.

## How it bills

Lucerne prices the meter at \$10.00 per million output tokens: a [usage price](/catalog/prices) with `unitAmount: "1000"` (cents) `per: "1000000"`. In November, Northwind's users get replies totalling 18,450,000 output tokens:

| Step                                                  | Value                                   |
| ----------------------------------------------------- | --------------------------------------- |
| Events selected                                       | 61,500 `chat_message` events            |
| Meter quantity (sum of `cost.inference.outputTokens`) | 18,450,000 `token`                      |
| Price                                                 | 1000¢ per 1,000,000 tokens              |
| Charge                                                | 18,450,000 × 1000 ÷ 1,000,000 = 18,450¢ |
| Invoice line                                          | Output tokens: **\$184.50**             |

Paid calculates the charge exactly and rounds once, to whole cents, on the invoice line.

## Split usage by dimension

`groupBy` splits a meter's quantity by up to three paths, such as `cost.inference.model`. Each group gets its own quantity, so a [rate card](/core-concepts/introduction-to-pricing) can price each model differently and [usage summaries](/usage/usage-summaries) can report on them. A meter with `groupBy` is priced through a rate card, not a single price.

## Check a meter's health

A meter's definition lives on the server, so a typo in an event name or a path doesn't fail when you send events. It shows up in the meter's `health` instead:

| Field              | Tells you                                                                  |
| ------------------ | -------------------------------------------------------------------------- |
| `lastMatchedAt`    | when the meter last selected an event                                      |
| `matchedEvents24h` | how many events it selected in the last 24 hours                           |
| `invalidValues24h` | how many had an invalid value at a path it reads                           |
| `warnings`         | problems such as a path that has never matched or an event name never sent |

[Retrieve the meter](../api-reference/metering/meters/retrieve) after your first events arrive, and check `matchedEvents24h` isn't `0`.

`validationMode` decides what happens to an event with an invalid value at a path the meter reads. With `lenient`, the default, the event is stored but not billed by this meter, and counted in `invalidValues24h`. With `strict`, the event fails ingestion with a per-item error.

## Change or retire a meter

Everything that decides what a meter bills is fixed when you create it, so every past invoice matches its meter. [Update a meter](../api-reference/metering/meters/update) to change only its `name`, `description`, `validationMode` and `metadata`.

To change what's billed, create a new meter, create prices on it, and [amend](/orders-and-billing/amending-orders) the orders that should use them.

[Archive a meter](../api-reference/metering/meters/archive) to stop it measuring. It stays readable, because invoices refer to it. Archiving fails while an active, activating or paused order uses the meter through a price or rate card.

## Single-event meters

A third mode, `measure.type: "singleEvent"`, measures each event on its own, such as the characters in each email or the pages in each document. Use it with `tierScope: "event"` on a price, so tiers apply to each event rather than to the period's total.

> **Note**
>
> Single-event meters are drafted and may change before they're released.

## Related

* [Workflows and outcomes](/usage/workflows-and-outcomes)
* [Prices](/catalog/prices)
* [Event costs](/usage/event-costs)
* [Meters API reference](../api-reference/metering/meters/create)