Usage Billing Review

Guide

Usage-based billing: how it works, from usage event to paid invoice

Usage-based billing turns what customers do in your product into an invoice they can check. This guide walks the whole chain, stage by stage, and the failures that cost revenue at each one.

By Usage Billing Review Editors · Updated

Usage-based billing is the process of charging customers for what they actually consume (API calls, tokens, compute minutes, gigabytes, messages, completed tasks) instead of, or on top of, a fixed recurring fee. Usage-based pricing is the decision about what to charge for and at what rate. Usage-based billing is the machinery that makes that decision real: it counts the usage, prices it, puts it on an invoice and collects the money.

With a flat subscription, billing is a calendar: the same charge on the same date. With usage, every invoice is computed from data, and that data passes through several systems before it becomes a line item. A dropped event, a double-counted retry or a rate applied to the wrong contract all end up as a wrong invoice, either one the customer disputes or one that quietly undercharges.

This guide follows a unit of usage from the moment it happens to the moment its revenue is booked: the eight stages every usage-based billing setup has, whether it is built in-house or run on a billing platform, what each one does and what typically goes wrong.

The usage-based billing chain at a glance

StageWhat happensWhat typically goes wrong
1. Define the billable unitDecide exactly what is counted and when it countsA unit customers cannot predict, or one the product cannot measure precisely
2. Emit usage eventsThe product records each billable action as an eventCode paths that skip the event, missing customer or plan identifiers
3. Ingest and deduplicateEvents are collected, validated and stored onceRetries counted twice, late or out-of-order events, dropped events
4. AggregateEvents are summed per customer, meter and periodWrong time zone or period boundary, events attributed to the wrong account
5. RateAggregated usage is priced against the customer's rate cardWrong plan version, tiers applied as volume, contract overrides ignored
6. InvoiceCharges, allowances, credits and taxes become an invoiceTotals that do not match metered usage, line items customers cannot trace
7. Collect and resolve disputesPayment is taken and questioned charges are answeredNo event-level evidence to defend a charge
8. Recognise revenue and closeUsage is booked as revenue in the right periodConsumed but unbilled usage missing from the books at month end

What usage-based billing is, and what it is not

A billing process where each invoice is calculated from measured consumption.

You will also see it called metered billing, consumption-based billing or pay-as-you-go billing. The names describe the same thing: the amount owed depends on measured usage in the billing period. Cloud infrastructure, communications APIs and LLM APIs are the familiar examples, and many SaaS products now bill some features this way, especially AI features whose cost to serve varies with every request.

Usage-based billing rarely stands alone. Most products that bill on usage also have a recurring platform fee, an included allowance, a minimum commitment or prepaid credits, so the billing system has to combine subscription charges and metered charges on one invoice. Which of those structures to use is a pricing question, covered in the SaaS pricing models guide; this guide is about the billing work underneath any of them.

1. Define the billable unit

Everything downstream depends on a precise, measurable definition of what counts.

A billable unit (often called a meter or billable metric) needs more than a name. "Per API call" leaves open whether failed calls count, whether a retried call counts once or twice, and whether health checks count at all. "Per token" leaves open input versus output tokens, cached tokens and which model. The definition should say what event counts, which attributes it carries, how it is aggregated (sum, count, maximum, unique count) and over what period.

Good units are ones the customer can relate to value, can roughly predict, and can verify on the invoice. Units that track your cost to serve protect margin, but if customers cannot connect them to anything they did, every invoice becomes a support ticket.

  • Decide up front: What counts, what does not (errors, retries, internal traffic), the aggregation (sum, count, max, unique), the period, and the unit's precision and rounding.
  • Write it down: The same definition belongs in the contract or pricing page, in the metering code and on the invoice. When those three disagree, disputes follow.

2. Emit usage events from the product

Each billable action becomes a record the billing system can trust.

The product emits a usage event every time something billable happens. A useful event carries a unique event ID, the customer (and, where it matters, the sub-account, project or user), the meter it belongs to, the quantity, the time the usage happened, and any attributes the price depends on, such as model, region or tier.

The most common failure here is coverage: a new endpoint, a background job or a batch import path that does the billable work but never emits the event. That usage is served and never billed. Treat billable events like any other critical data contract, with tests and alerts when expected volumes drop.

3. Ingest, validate and deduplicate

Every event is stored exactly once, even when it arrives twice or late.

Networks retry, clients resend and queues redeliver, so the ingestion layer must be idempotent: the same event ID arriving twice is counted once. It also has to decide what to do with events that fail validation (an unknown customer, a missing meter) without silently dropping them, which is usually a dead-letter queue that someone actually reviews.

Late-arriving events are the other hard case. An event for last month that arrives after last month's invoice was issued has to be either added to an adjustment, rolled into the next period, or rejected, and the rule should be decided before it happens, not during a dispute.

4. Aggregate usage per customer and period

Raw events are rolled up into the quantities that will be priced.

Aggregation turns millions of events into a handful of numbers per customer: total tokens by model this month, peak seats, unique active users, storage averaged over the period. It can run continuously as events arrive or in a batch at the end of each period. Continuous aggregation is what makes live usage dashboards, spend alerts and credit balance checks possible; batch is simpler but leaves customers and your own team blind until the invoice.

The quiet errors at this stage are period boundaries (which time zone does the month end in?) and attribution (which account owns usage from a shared project, a reseller or a subsidiary?).

5. Rate usage against the price

Quantities become money, using the rate card and contract that apply to this customer.

Rating applies prices to aggregated usage: a flat per-unit rate, graduated tiers, volume tiers, packages of units, included allowances, minimums and overage rates. For enterprise accounts it also applies whatever the contract changed: discounts, custom rates, committed spend that usage draws down.

Rating is where pricing changes cause the most damage. A customer on last year's plan must keep being rated on last year's rate card until their terms change, so prices need versions, and each customer needs a record of which version applies from which date. Hardcoding rates in application code makes that history hard to keep and every price change an engineering project.

Rating can also run in real time, pricing each event as it arrives. That is required when usage draws down prepaid credits or a hard spend cap, because the product has to know the balance before it serves the next request.

6. Generate an invoice customers can check

Rated usage, subscription charges, credits and taxes combine into one bill.

The invoice brings together recurring fees, rated usage, allowances used, prepaid credit drawn down, commitments and true-ups, proration for mid-period plan changes, and tax. For usage, the invoice is also the main piece of evidence the customer sees, so it should show quantities and rates per meter, not just a total.

Before invoices go out, reconcile them against the metering data: the usage on the invoice should match the usage the meters recorded for the same customer and period. Drift between the two is one of the most common sources of revenue leakage, and it is far cheaper to catch before the invoice is sent than after.

7. Collect payment and resolve disputes

Variable invoices get questioned more often, so evidence matters.

Usage invoices change every month, which makes them more likely to be questioned than a fixed subscription. The answer to "why is this bill higher?" should come from data, not from an engineer running queries: usage by day, by project or by user, traceable back to the events behind it.

The best way to reduce disputes is to remove surprises before the invoice: usage visible to the customer during the period, budget alerts when spend crosses a threshold, and optional hard caps for customers who need them.

8. Recognise revenue and close the books

Usage revenue belongs to the period the usage happened, not the period it was invoiced.

Under ASC 606 and IFRS 15, revenue from usage is generally recognised as the usage occurs. That creates timing gaps finance has to track: usage consumed in a month but not invoiced until the next is accrued (unbilled) revenue, and prepaid credits or commitments paid in advance are deferred revenue until they are used or expire. How these rules apply to a specific contract is a question for your accountants and auditors.

At month end, finance needs usage totals it can trust before invoices are final, and a reconciliation from metering data to the general ledger. When billing data only lives in engineering systems, the close slows down and the numbers get questioned.

Building usage-based billing or buying a platform

Most teams buy the billing engine and keep the metering events in their own product.

Every stage above can be built in-house, and many companies start that way: a usage table, a nightly job and a script that feeds totals to the payment provider. It tends to hold until the first pricing change, the first enterprise contract with custom terms or the first credit-based plan, and then the billing code spreads across the product and becomes expensive to change.

Dedicated usage-based billing platforms (commercial ones such as Stripe Billing, Orb, Metronome, Chargebee, Recurly and Zuora, and open-source options such as Lago, OpenMeter and Flexprice) cover ingestion, aggregation, rating and invoicing to different degrees. They change features and pricing often, so compare them on their current documentation and pricing pages rather than on any summary, including this one.

  1. Event ingestion: what volume it accepts, how it deduplicates, and how it handles late and corrected events.
  2. Aggregations: whether it supports the ones your meters need (sum, count, max, unique count, time-weighted) and per-attribute pricing such as per model or region.
  3. Rating: graduated and volume tiers, allowances, minimums, commitments, credits, and contract-level overrides.
  4. Price changes: versioned plans, scheduled changes, and keeping existing customers on their terms.
  5. Real time: whether balances and spend can be checked fast enough to block usage when credits run out.
  6. Visibility: usage the customer can see mid-period, alerts, and invoices that itemise quantities and rates.
  7. Finance: exports or integrations for revenue recognition, accruals and reconciliation to the ledger.
  8. Deployment: hosted only or self-hostable, data residency, and the security reviews your customers will ask for.

A checklist before you launch usage-based billing

  1. Each meter has a written definition: what counts, what is excluded, aggregation, period and rounding.
  2. Every code path that does billable work emits an event with a unique ID, customer, meter, quantity and timestamp.
  3. Ingestion is idempotent, invalid events go somewhere reviewed, and there is a rule for late events.
  4. Customers can see their usage during the period, and can set alerts or caps.
  5. Rate cards are versioned, and each customer's plan history is recorded.
  6. Invoices show quantity and rate per meter, and are reconciled against metered usage before they are sent.
  7. Finance has agreed how usage, credits and commitments are recognised, and gets usage totals in time for the close.
  8. Someone owns billing data end to end, across engineering, product and finance.

Questions people ask

What is usage-based billing?

Usage-based billing charges customers according to how much of a product they consume in a billing period, measured in a defined unit such as API calls, tokens, compute minutes or gigabytes. The invoice is calculated from metered usage rather than being a fixed amount.

What is the difference between usage-based billing and usage-based pricing?

Usage-based pricing is the commercial decision: what unit you charge for and at what rate. Usage-based billing is the operational process that meters that unit, rates it, invoices it and collects payment.

Is usage-based billing the same as metered billing?

Yes. Metered billing, consumption-based billing and pay-as-you-go billing all describe charging for measured usage. Some vendors use "metered" for the event-counting part specifically, but the billing model is the same.

How does usage-based billing work with a subscription?

Most products combine the two: a recurring fee covers access and often an included allowance, and usage beyond the allowance is metered and billed as overage on the same invoice. Minimum commitments and prepaid credits are other common ways to combine a predictable charge with usage.

When is usage-based revenue recognised?

Generally in the period the usage happens, which can be before it is invoiced. Usage consumed but not yet billed is tracked as accrued revenue, and prepaid amounts are deferred until used. Confirm the treatment of your contracts with your accountants.

What are the biggest risks in usage-based billing?

Revenue leakage from usage that is never metered or is dropped in the pipeline, double counting from retried events, rating against the wrong price version, and invoices customers cannot trace back to their own usage, which leads to disputes.