Metering
Metering is how the work your product does becomes a quantity you can bill. Your code sends facts, as events: a model call with its token counts, a document with its page count, a ticket reply. Meters in Paid decide which of those facts are billable and add them up. Because the rules live in Paid rather than in your code, you can change what you charge for without changing what you send.
Understand metering to:
- Choose what to charge for: activity, results or cost. See What you can meter.
- Keep pricing out of your code by sending raw facts and deciding what’s billable in a meter.
- Know when usage is billed, including events that arrive late or are sent twice.
Facts in, quantities out
- You send an event for each piece of work, naming the customer and product, with its detail in
payloadand what it cost you incost. - A meter selects the events it reads, by name and filters.
- The meter measures what it selected over each billing period: it counts the events, or sums, averages or takes the maximum of a field.
- A price charges for the meter’s quantity. The meter never decides an amount, only a quantity in its own unit, such as
412000 token.
One event can feed several meters. Trey Research sends one model_call event per request, and separate meters sum its input, output and cached tokens. To charge for something new later, such as cached tokens at their own rate, Trey Research creates a meter and a price, and its code keeps sending the same event.
What you can meter
A meter’s unit is what’s counted, such as token or ticket. It’s separate from the currency or credit currency a price charges in. See Money and credits.
When usage counts
An event’s timestamp is when the work happened, and it decides the billing period the event is billed in. createdAt is when Paid received it.
- Each period stands alone. A meter’s quantity is measured per customer and billing period, so tiers and included quantities on a price reset each period.
- Late events don’t rewrite invoices. An event for a period that’s already been invoiced is billed as an adjustment on the next invoice. See Billing periods and invoices.
- Workflows bill when they close. A workflow that opens in one period and closes in the next is billed in the period it closes.
- Every event counts once. An event’s
dedupeKeymakes it unique, so resending it after a timeout never bills it twice. See Retries and duplicates.
Usage that isn’t billed
Paid records some usage without billing it, so you can still report on it:
How it bills
Litware’s AI support agent works tickets for Northwind Traders. Each ticket takes several model calls and tool calls, all sent as events with the ticket ID as their correlationId. A workflow meter groups them by ticket and gives each closed ticket one outcome. Litware charges $1.50 per resolved ticket and 25¢ per escalated one. In November:
However many calls a ticket took, it’s billed once, for its outcome.