What is usage-based billing, and what can I use it for?
Usage-based billing lets you charge customers based on what they actually consume — such as API calls, AI tokens, transactions, storage, seats, or other metered activity — instead of, or alongside, a fixed subscription fee.
You can use it to monetize metered products like AI and LLM platforms, API businesses, infrastructure services or SaaS plans with consumption-based pricing. With Airwallex Billing, you can ingest high-volume usage events, aggregate them with meters, and support flexible pricing models such as per-unit, volume, and graduated tiered pricing. This helps you launch, test, and update pricing models without rebuilding your billing infrastructure.
How does usage-based billing work in Airwallex?
Airwallex usage-based billing works by turning customer activity into billable usage over a billing period. It uses four key resources:
- Usage events your system sends us events via API each time product consumption occurs. Each event is a record of who consumed the product, the quantity of consumption, and when it happened.
- Meters define how usage events are aggregated over the billing period, such as the count of API calls or sum of tokens used.
- Products and prices define what you’re selling and how it is charged. For usage-based billing, prices are linked to meters so Airwallex can calculate the amount due based on the customer’s measured usage.
- Subscriptions tie a customer to one or more prices, manage the billing period, and trigger invoice generation at the end of each cycle.
Usage events
What is a usage event?
A usage event is a record of a specific instance of customer product usage. Each event captures the customer, event name, timestamp, and quantity and metadata.
When should I send usage events?
Send events as close to real time as possible — typically within seconds or minutes of the usage occurring. Real-time ingestion enables mid-cycle usage visibility for your customers, threshold alerts, and accurate proration.
If real-time isn't practical (very high volume, batch-oriented systems), you can pre-aggregate in your system and send summary events on a schedule, as long as all events for a billing period arrive before the period closes.
Can one usage event support more than one billing metric?
Yes. A single usage event can be processed by multiple meters simultaneously, letting you derive different billable quantities from the same data stream without changing your backend integration.
For example, one AI inference event can feed two meters at once: a request count meter charged per call, and a token sum meter
charged per 1k tokens.
Meters
What is a meter?
A meter is a configurable resource that transforms raw usage events into billable quantities for each billing period.
For example, a meter can count the number of API calls a customer makes, sum the number of AI tokens they consume, track the highest usage value in a period, or use the most recent reported value.
How does a meter calculate billable usage?
A meter calculates billable usage by defining which usage events to monitor and how those events should be aggregated.
A meter is configured with:
- the usage event name it should monitor,
- an aggregation method such as SUM, COUNT, UNIQUE COUNT, MAX, or LAST,
- an aggregation property — the field in the event payload to aggregate (required for SUM/MAX/LAST; not needed for COUNT)
Can I change a meter after it has been created?
A meter’s core aggregation logic cannot be changed after creation, in order to preserve billing auditability. Only descriptive fields such as the name, description, or metadata can be updated.
Can I stop using a meter?
Yes. Archiving a meter prevents it from being linked to new prices. Archiving does not affect finalised invoices or existing subscriptions that already use prices linked to that meter.
You can also restore an archived meter. Once restored, the meter becomes active again and can be linked to new prices.
How do I start charging customers based on usage?
A typical setup involves:
- Create a meter to define how usage should be measured and aggregated.
- Create a product and usage-based price linked to that meter.
- Create a billing customer for the customer you want to charge.
- Create a subscription for that customer using the usage-based price.
- Ingest usage events for that customer as usage occurs
Once the subscription is active, Airwallex aggregates usage events for that customer and automatically generates an invoice at the end of the billing cycle based on the recorded usage.
Can I send multiple usage events in one request?
Yes. Airwallex supports batch ingestion, which lets you submit multiple usage events for multiple customers in a single API call. Batch-ingested events are processed asynchronously, and you can monitor usage event aggregation failures through webhook events.
What happens if I send a usage event by mistake?
If a usage event was sent in error — for example, with an incorrect quantity — you can void it, and it will be excluded from you can void the event so that it is excluded from meter aggregations and billing calculations.
Usage events can be voided up to 35 days in the past. As a best practice, void incorrect events as soon as possible and before the invoice for that billing period is finalised. Voiding a usage event does not retroactively adjust a finalised invoice.
Will voiding a usage event change an invoice that is already finalised?
No. Voiding a usage event does not retroactively adjust a finalised invoice.
If an invoice was overcharged, a credit note should be issued. If it was undercharged, a separate one-off invoice should be created.
How far back can I void a usage event?
Usage events can be voided up to 35 days in the past.
What happens if a usage event arrives late?
For subscriptions with usage-based products, Airwallex provides a one-hour grace period after the billing period ends to capture delayed usage events.
If the event is ingested during that grace period, it is included in the latest invoice. After the grace period, the invoice is finalised, and late events are not added to that invoice or applied retroactively.
Can I check a customer’s aggregated usage before invoicing?
Yes. You can query usage summaries for a customer over a specified time window to review the aggregated result for a meter.