> 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.

# Send events

> Record the work you do for each customer, safely retry any send, and let Paid decide what's billable.

An **event** is a record of something you did for a customer: a model call, a document reviewed, a ticket reply. You send Paid what happened and who it was for, and [meters](/usage/meters) decide what part of it is billable. Every event carries a `dedupeKey` of your own, so you can resend it as often as you need and it's still counted once.

Use events to:

* **Bill for usage** by sending the raw facts and letting a [meter](/usage/meters) and a [price](/catalog/prices) turn them into charges.
* **Bill for results** by grouping the events of one piece of work with a `correlationId`, for a [workflow meter](/usage/workflows-and-outcomes).
* **Track your margin** by adding what each event cost you to produce, as [cost lines](/usage/event-costs).
* **Spend reserved credits** by settling a [credit hold](/credits/credit-holds) with the event for that work.

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

## How events work

1. **You send what happened.** Name the customer and product by your own IDs or Paid's, add a `dedupeKey`, and put any detail you might want later in `payload`.
2. **Paid accepts it once.** It resolves the customer and product to Paid IDs and drops any event whose `dedupeKey` it has already seen.
3. **Meters read it.** Each [meter](/usage/meters) whose event names and filters match the event measures it.
4. **Prices bill it.** A [usage price](/catalog/prices#usage-prices) on the customer's order turns each meter's quantity into a charge.

Send events in as raw a form as you can, and decide what's billable in Paid. That keeps commercial logic out of your code: to charge for something else, you change a meter and a price, not what you send.

## Send an event

Clausebase reviews contracts for law firms. Each time it finishes a document for Halberd LLP, it sends one `document.reviewed` event with the page count:

#### API

[Create an event](../api-reference/metering/events/create) for each piece of work.

**`POST /v1/events`**

```json title="POST /v1/events"
{
  "eventName": "document.reviewed",
  "customer": "halberd-llp",
  "product": "doc_review",
  "dedupeKey": "doc_8f2k1q",
  "timestamp": "2026-11-04T14:12:09Z",
  "correlationId": "matter_2231",
  "payload": { "pages": 42, "documentType": "nda" }
}
```

**`Response`**

```json title="Response"
{
  "id": "evt_4Rk7Wd",
  "object": "event",
  "livemode": false,
  "eventName": "document.reviewed",
  "customer": "cus_5Ty2Mb",
  "customerUnit": null,
  "sentAs": {
    "customer": "halberd-llp",
    "customerUnit": null
  },
  "product": "prod_2Xk8Rn",
  "dedupeKey": "doc_8f2k1q",
  "timestamp": "2026-11-04T14:12:09Z",
  "correlationId": "matter_2231",
  "payload": { "pages": 42, "documentType": "nda" },
  "duplicate": false,
  "warnings": [],
  "quantity": null,
  "derived": null,
  "createdAt": "2026-11-04T14:12:10Z"
}
```

The response returns `customer` and `product` as Paid IDs, whichever IDs you sent, and keeps the references exactly as you sent them in `sentAs`. `timestamp` is when the work happened; `createdAt` is when Paid received it.

To check what arrived, [retrieve the event](../api-reference/metering/events/retrieve) by its ID, or [list events](../api-reference/metering/events/list) filtered by `customer`, `correlationId` or `dedupeKey`. A new event can take a few seconds to appear in the list.

#### Dashboard

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

Events are sent from your code, through the API. To check what arrived:

1. Go to **Analyze > Events**.
2. Filter by customer (`Halberd LLP`) or event name (`document.reviewed`).
3. Click an event to see its payload, the IDs it was sent with, and any warnings.

| Field           | What it's for                                                                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `eventName`     | What happened, such as `document.reviewed`. Meters select events by name.                                                      |
| `customer`      | The customer, by Paid ID, your `externalId` or a [customer alias](/customers/customer-aliases).                                |
| `customerUnit`  | Optional. The [customer unit](/customers/customer-units) the work was for, such as a team. Needs the `customer_units=v1` beta. |
| `product`       | The [product](/catalog/products), by Paid ID or your `externalId`.                                                             |
| `dedupeKey`     | Your key for this event, 1 to 255 characters. See [Retries and duplicates](#retries-and-duplicates).                           |
| `timestamp`     | When it happened. Defaults to when Paid receives the event.                                                                    |
| `correlationId` | Optional. Groups related events. See [Group related events](#group-related-events).                                            |
| `payload`       | Any data about the event you might bill or report on. It's free-form: define the fields you need.                              |
| `cost`          | Optional. What the event cost you. See [Event costs](/usage/event-costs).                                                      |
| `creditHold`    | Optional. The [credit hold](/credits/credit-holds) this event settles. Needs the `credits=v1` beta.                            |

A meter reads payload fields by path, such as `payload.pages`. A value a meter sums or compares must be an integer or a decimal string, such as `"12.5"`: see [Meters](/usage/meters#paths).

## Retries and duplicates

`dedupeKey` makes an event unique. Use an ID your system already has for the work, such as the document or message ID, so a retry carries the same key.

If Paid has already accepted an event with that `dedupeKey`, it ingests nothing and returns the original event with `duplicate: true` and status `200` instead of `201`. It isn't an error, so you can retry a failed or timed-out send as often as you need without counting anything twice.

`dedupeKey` is separate from the request-level `Idempotency-Key` header. The header makes one request safe to repeat; `dedupeKey` makes one event count once, whichever request or batch carries it.

## Send events in batches

To send many events at once, [create a batch of events](../api-reference/metering/events/create-batch): up to 1,000 events, each with the same fields as a single event.

**`POST /v1/events/batch`**

```json title="POST /v1/events/batch"
{
  "events": [
    {
      "eventName": "document.reviewed",
      "customer": "halberd-llp",
      "product": "doc_review",
      "dedupeKey": "doc_8f2k1q",
      "payload": { "pages": 42 }
    },
    {
      "eventName": "document.reviewed",
      "customer": "halberd-llp",
      "product": "doc_review",
      "dedupeKey": "doc_9a7m3c",
      "payload": { "pages": 7 }
    }
  ]
}
```

Items succeed or fail independently, and the response is always `200`. `data` holds one result per item, in input order, with its `index`, `dedupeKey` and a `status`:

| `status`    | Means                                                | The item carries                                  |
| ----------- | ---------------------------------------------------- | ------------------------------------------------- |
| `ingested`  | A new event was accepted.                            | its `id` and `warnings`                           |
| `duplicate` | An event with this `dedupeKey` was already accepted. | the original event's `id` and `warnings`          |
| `failed`    | The item was rejected.                               | a standard `error`, with `param` naming the field |

`summary` counts each status as `ingested`, `duplicates` and `failed`. Resend only the failed items once you've fixed them. Resending the whole batch is also safe, because the accepted items come back as duplicates. A request body that's too large fails as a whole with status `413`.

## Group related events

A `correlationId` groups the events of one run, conversation or job, such as every model call and tool call an agent makes to answer one ticket. The ID is yours: Paid doesn't create it, doesn't need it registered first, and doesn't require it to be unique. Groups are scoped to a customer, so the same ID sent for two customers makes two groups.

Use it to:

* bill a whole run once, with a [workflow meter](/usage/workflows-and-outcomes) whose `identifier` is `correlationId`
* bill per conversation, with a [meter](/usage/meters#measure) that counts distinct correlation IDs
* add up the [cost](/usage/event-costs) of a run across its events
* tie a [credit hold](/credits/credit-holds) to the run that spends it

## Events for customers you haven't created

If an event names a customer ID Paid doesn't know yet, Paid creates a [draft customer](/customers/customers#draft-customers) under that ID and accepts the event, so no usage is lost. Drafts are never billed. When you create the customer with the same `externalId`, the draft becomes a real customer and keeps its usage. If the ID belongs to another system, add it as a [customer alias](/customers/customer-aliases) of the right customer instead, which merges the draft into it.

An event that names an unknown customer unit is accepted too, but no unit is created: its usage is held until you create the unit with that `externalId`. An unknown Paid ID, such as a `cus_` ID that doesn't exist, isn't a draft: the event fails with `reference_not_found`.

## Settle a credit hold

Name a [credit hold](/credits/credit-holds) in `creditHold` on the event for the work you reserved credits for. When the event's spend posts, the hold is settled.

If the hold is no longer active, because it expired, was released or was settled by another event, the event is still accepted and billed as if it named no hold. Its `warnings` list `resource_not_active`, with `param` naming `creditHold`:

```json
"warnings": [
  {
    "code": "resource_not_active",
    "message": "Credit hold 'hold_4Fq8Zr' expired at 2026-11-04T14:10:00Z; the event was rated without it.",
    "param": "creditHold"
  }
]
```

## Non-billable usage

Events for a customer unit marked `billable: false`, or for any unit under one, are recorded and reported but never billed. Use this for a customer's development or QA environments. See [Customer units](/customers/customer-units#exclude-a-unit-from-billing).

## How it bills

Clausebase meters the pages in each `document.reviewed` event with a `pages_reviewed` meter that sums `payload.pages`, and prices it on [graduated tiers](/catalog/prices#tiered-pricing): 12¢ a page for the first 50,000 pages each month, 8¢ up to 200,000 and 5¢ above that. Price amounts are in cents. In November, Clausebase's service sends Halberd's events, retrying a few after timeouts:

| Step                                    | Value                                         |
| --------------------------------------- | --------------------------------------------- |
| Events sent                             | 1,853                                         |
| Duplicates (same `dedupeKey` resent)    | 3, ingested once each                         |
| Events accepted                         | 1,853 minus 3 = 1,850                         |
| Meter quantity (sum of `payload.pages`) | 61,400 `page`                                 |
| First tier                              | 50,000 × 12¢ = 600,000¢                       |
| Second tier                             | (61,400 minus 50,000) = 11,400 × 8¢ = 91,200¢ |
| Charge                                  | 600,000¢ + 91,200¢ = 691,200¢                 |
| Invoice line                            | Pages reviewed: **\$6,912.00**                |

The three retried sends changed nothing: each came back with `duplicate: true`, and its pages were counted once.

## Change an event

The API records events but has no operation to change or delete one. Send a late event with its real `timestamp`: [usage summaries](/usage/usage-summaries#usage-or-invoice-basis) on the usage basis show it in the period it happened, and invoices that were already issued don't change. To change what an event is billed for, change the [meter](/usage/meters#change-or-retire-a-meter) or the price, not the event.

## Related

* [Meters](/usage/meters)
* [Event costs](/usage/event-costs)
* [Workflows and outcomes](/usage/workflows-and-outcomes)
* [Customers](/customers/customers)
* [Events API reference](../api-reference/metering/events/create)