Usage-based billing on events

Bill on what your customers use.

Send one event per thing that happened

A name, a customer, and whatever you want to count. Meters do the rest.
  1. 1POST /v1/events/ingest
  2. 2
  3. 3{
  4. 4 "events": [{
  5. 5 "name": "llm.completion",1
  6. 6 "external_customer_id": "cus_4410",2
  7. 7 "metadata": {3
  8. 8 "model": "claude-sonnet",
  9. 9 "tokens": 1840
  10. 10 }
  11. 11 }]
  12. 12}
1
name
What happened. Meters filter on it.
2
external_customer_id
Who it is billed to.
3
metadata
Anything to add up: tokens, bytes, seconds.
Four event streams folding into one meter: 52,385 tokens, times $10 per million, billed as one $0.52 invoice line.

One number per customer, from the whole stream

1Filter

Which events count: here, LLM completions.

2Aggregation

How they add up: the sum of their tokens.

Per customer

Every customer gets their own number.

Per period

Read at the end of each billing cycle.

Five ways to read the same stream

A meter's aggregation decides what its number means. The same thirty-one events, read five ways.
count()31
12345678910111213141516171819202122232425262728293031

Priced per unit, billed on the next invoice

Renewals, proration, tax and discounts work as they do for fixed prices.

Every customer's balance, as it happens

What they have used, what they were granted, and what is left, as each event lands.
Credits
Grant units with the meter credits benefit. What is left can roll over to the next cycle.
API
Consumed units, credited units and balance, per customer and meter.
Customer state
Every active meter is on the customer state, and its webhook fires when it changes.
Customer portal
Customers see their own usage, without you building a page for it.

New Usage Engine

Coming soon

Agent-first billing, in early access

a first look at our new usage billing engine

Billing as code, zero-latency checks and simulations before you ship a price. Read how it works, and join the first teams building on it.

Start metering events

Set up a meter and ingest your first event with the SDK.