Skip to navigation

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

  1. You send an event for each piece of work, naming the customer and product, with its detail in payload and what it cost you in cost.
  2. A meter selects the events it reads, by name and filters.
  3. The meter measures what it selected over each billing period: it counts the events, or sums, averages or takes the maximum of a field.
  4. 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

You charge forMeter it withExample
Activity: how much your product didAn event meter that counts events or sums a fieldOutput tokens, pages reviewed, API calls
Distinct thingsAn event meter with uniqueCount on a fieldConversations, active users
Results: what the work achievedA workflow meter that groups related events and classifies each group by its outcomeResolved tickets, booked meetings
Cost: what the work cost you, marked upA meter whose events carry cost lines, priced with cost-plus pricingInference at cost plus 20%

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 dedupeKey makes 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:

UsageWhy it isn’t billed
Events for a customer unit with billable: falseIt’s a development or QA environment.
Events for a draft customerThe customer doesn’t exist yet. Its usage is kept, and bills like any other once you create the customer and an order covers it.
An event with an invalid value at a path a lenient meter readsThe meter can’t measure it. It’s counted in the meter’s health.
Usage no order pricesNothing on the customer’s orders charges for that meter.

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:

StepValue
Events sent41,300, across 2,700 tickets
Tickets closed in November2,700
Outcome resolved2,400 tickets
Outcome escalated2,700 − 2,400 = 300 tickets
Resolved tickets line2,400 × 150¢ = 360,000¢ = $3,600.00
Escalated tickets line300 × 25¢ = 7,500¢ = $75.00
Usage on the invoice$3,600.00 + $75.00 = $3,675.00

However many calls a ticket took, it’s billed once, for its outcome.