Skip to navigation

Usage summaries

A usage summary shows how much of something a customer used over a period, next to what they paid for it: the quantity a meter measured, and the money invoiced, credits spent or commit drawn down for that quantity. One call can cover several meters, so you can show attempts and results side by side, such as 1,240 tickets worked and 1,010 resolved. Summaries are calculated when you ask for them, so there’s nothing to create or keep in sync.

Use usage summaries to:

  • Report on your business: usage and revenue per customer, product, outcome or model, over hours, days, months or billing periods.
  • Reconcile invoices with basis=invoice, whose figures add up exactly to the usage charges on your invoices.
  • Show customers their usage in your own product, with what they spent and in what form. See Show customers their usage.

Usage summaries are in the usage_summaries=v1 private beta: send Paid-Beta: usage_summaries=v1 with each request.

How usage summaries work

You ask for a time range, a bucket size and the meters you want. Paid returns one row per bucket, per meter, per combination of the values you group by. Each row has:

FieldIs
quantitywhat the meter measured in the bucket, in the meter’s unit
spendwhat the customer was charged for that quantity, under the prices on their order
additivewhether the bucket’s quantities can be added up across buckets
statusprovisional until the bucket’s charges are settled, then final

For an event meter, quantity is the meter’s aggregation within the bucket. For a workflow meter, it’s the quantities of the workflows that closed in the bucket.

List usage summaries

Litware wants September’s support tickets for Northwind Traders, split by outcome, to check against the month’s invoice:

List usage summaries with a range, a granularity and the meters you want.

?customer=northwind
&meters[]=support_tickets
&startsAt=2026-09-01T00:00:00Z
&endsAt=2026-10-01T00:00:00Z
&granularity=month
&groupBy[]=outcome

Money in a summary is an integer in minor units: 61800 is $618.00, for 412 resolved tickets at 150¢. The 64 escalated tickets at 25¢ come to 1,600¢, or $16.00.

Choose what to summarise

ParameterWhat it does
customerOne customer. Omit it for usage across all your customers.
includeChildrenWith customer, also include its child customers. Add groupBy[]=customer to split the group by customer. Can’t be sent with customerUnit.
segmentOnly customers in this segment, by key or seg_ ID. Can’t be sent with customer.
customerUnitOne customer unit, with every unit under it unless includeDescendants is false. Needs customer.
productOnly usage of this product.
orderOnly usage billed under this order.
metersUp to 20 meters, by key or mtr_ ID. Omit it for every meter.
startsAt, endsAtThe range. startsAt is included and endsAt isn’t. Both must fall on bucket boundaries.
granularityThe bucket size. See below.
groupByUp to 3 ways to split each bucket. See below.
timezoneAn IANA time zone, such as Europe/London, for day and month boundaries. Defaults to UTC.
basisusage, the default, or invoice. See Usage or invoice basis.
granularityBucketsLongest range
hourhours7 days
daydays in timezone366 days
monthcalendar months in timezone36 months
billingPeriodthe billing cycle of the customer’s orderNeeds customer, and order when more than one order matches

groupBy takes up to 3 of meter, customer, customerUnit, segment, product, outcome (workflow and single-event meters only), or a path from an event meter’s own groupBy, such as cost.inference.model. Without it, each bucket has one row per meter. With segment, a customer in two segments counts in both groups, so the groups can add up to more than the total, and customers in no segment are grouped under null.

The list is paginated with limit and cursor, like every list. It also returns asOf, when the figures were calculated, and a revision that pins every page of the list to the same figures.

How spend is paid

spend.parts lists each way the usage was paid for. Each charge is exactly one part:

PartHoldsMeans
invoicedamountmoney invoiced for usage priced in a currency
creditscreditCurrency, valuecredits drawn from the customer’s balance
overagecreditCurrency, value, amountcredits spent past the balance, and the money billed for them
commitDrawdowncommit, amountmoney covered by a prepaid commit

invoicedTotal adds up the invoiced and overage amounts, and is null if they’re in more than one currency. Adding the value of the credits and overage parts gives the credits burned, which matches the credit ledger. New part types may be added, so skip any type you don’t recognise.

spend is null for a meter no price charges for. Usage on a non-billable unit is included, with no parts and a zero invoicedTotal.

How it bills

Adatum sells video analysis as prepaid credits, in a credit currency video_credits with a conversion of 1¢ per credit. Its video_minutes meter is priced at 2 credits a minute. Credit amounts are in the credit currency. In September, Brightrail analyses 1,800 minutes of video with 3,200 credits left on its balance:

StepValue
Meter quantity1,800 minute
Credits charged1,800 × 2 = 3,600 credits
Paid from the balance (credits part)3,200 credits
Spent past the balance (overage part)3,600 minus 3,200 = 400 credits
Overage billed400 × 1¢ = 400¢
invoicedTotal$4.00

The summary row for the month shows both parts:

"quantity": { "value": "1800", "unit": "minute" },
"spend": {
"invoicedTotal": { "amount": 400, "currency": "usd" },
"parts": [
{ "type": "credits", "credits": { "creditCurrency": "video_credits", "value": "3200" } },
{
"type": "overage",
"overage": {
"creditCurrency": "video_credits",
"value": "400",
"amount": { "amount": 400, "currency": "usd" }
}
}
]
}

Credits burned are 3,200 + 400 = 3,600, the same as the ledger shows for September.

Usage or invoice basis

basis decides which time a charge is bucketed by:

basisBuckets usage byCan past figures change?Use it for
usagewhen it happened, or when a workflow closedYes: late events and corrections show as a new revisionproduct analytics, showing customers their usage
invoicewhen its charge was posted to an invoiceNo: later corrections are new entriesfinance and reconciliation

With basis=invoice, a month’s figures add up exactly to the usage charges on that month’s invoices. They don’t include recurring fees, taxes, credit purchases, percent-of fees or commit shortfalls, which aren’t usage. To reconcile Northwind’s October invoices:

GET /v1/usage-summaries
?customer=northwind
&startsAt=2026-10-01T00:00:00Z
&endsAt=2026-11-01T00:00:00Z
&granularity=month
&groupBy[]=meter
&basis=invoice

Non-additive meters

Meters that take the max, min, average or latest of a field, or count distinct values with uniqueCount, return additive: false. Their buckets can’t be added up: 30 days of distinct daily users aren’t the month’s distinct users. For the figure the customer was billed, use granularity=billingPeriod.

Show customers their usage

Call usage summaries from your backend for the signed-in customer, and show the result in your own product. Never call the API from a browser: your API key must stay on your server. A daily view of the last week, per meter:

GET /v1/usage-summaries
?customer=northwind
&startsAt=2026-10-05T00:00:00Z
&endsAt=2026-10-12T00:00:00Z
&granularity=day
&groupBy[]=meter
&timezone=UTC

Pair summaries with credit balances to show what’s left, and credit grants to show when the next refill is due. Rows are provisional until the bucket’s charges are settled, so label recent figures as estimates.

Errors

codeCause
range_too_largeThe range is longer than granularity allows.
misaligned_rangestartsAt or endsAt isn’t on a bucket boundary in timezone.
invalid_request on customerbillingPeriod was asked for without a customer.
invalid_request on orderbillingPeriod matched more than one order; send order.
invalid_request on groupByoutcome on an event meter, a path the meter doesn’t group by, or more than 3 keys.
invalid_request on timezonetimezone isn’t an IANA time zone.