Use usage-based billing when the amount charged to a customer depends on measured consumption—for example, API requests, compute time, processed transactions, stored data, or active service instances.
XPay usage-based billing is generally available. It aggregates reported usage during each invoice cycle, applies the pricing models attached to the customer's plan, and creates an invoice for the calculated amount.
collect_advance to false or omit it. XPay calculates the amount after usage is reported for the invoice cycle.Follow the Usage-based billing quickstart to create your first metered subscription and report usage.
Example business
Nexa Cloud is an example cloud platform used throughout these guides.
Each independently aggregated value uses its own meter. Pricing models then determine how each result contributes to the invoice.
Resource model
Product
↓
Billing meters + Pricing models
↓
Usage-based plan
↓
Subscription
↓
Meter events
↓
Invoice and pricing_model_breakdownIntegration flow
- Define the service. Use Products to create the service the merchant sells.
- Measure usage. Use Billing meters to define each measured value and aggregation rule.
- Price usage. Use Usage-based pricing models to convert aggregated values into invoice amounts.
- Configure recurring billing. Attach pricing models to a plan, then Create a usage-based subscription.
- Report consumption. Send Meter events for the subscription while its invoice cycle is ongoing.
- Reconcile and collect. Use Usage aggregation and invoice generation
Use Prevent duplicate meter events before introducing automatic retries, and process later billing outcomes through Usage-based billing webhooks.
See Usage-based billing troubleshooting for common meter, event, pricing, and invoice issues.