Skip to main content
Usage-based billing is new. Share implementation feedback with the Ruba team.
A metered charge starts as activity inside your application. Ruba receives that activity as events, measures matching events with a meter, and applies the meter’s price through a subscription product.

Follow one unit of usage

Credits can sit between the measured usage and the final charge, allowing prepaid units to be consumed before overage is billed.

Records in the flow

What your application sends

An event is one timestamped record of something a buyer consumed inside your application. Your application sends these records to Ruba, and meters turn them into billable quantities. Common examples include tokens processed, video minutes streamed, or storage uploaded. Send events through the ingestion endpoint. Each record carries:
  • name: the activity category, such as ai_usage or file_uploaded.
  • customer_id or external_customer_id: the buyer responsible for the activity.
  • metadata: numbers and labels that a meter can filter or aggregate.
For example, this record captures one model request and its token counts:

How Ruba measures it

A meter is the rule that turns raw events into a usage total. It chooses which events count, optionally narrows them through metadata filters, and applies an aggregation such as count or sum. Examples:
  • Match ai_usage and sum total_tokens to bill for model consumption.
  • Match video_streamed and sum duration to charge by viewing time.
  • Match file_uploaded and sum size to price storage intake.
Create meters from the dashboard. Ruba maintains both organization-wide and per-customer totals, so the same definition can power billing, customer balances, and usage reporting.

How measured units become money

A metered price converts recorded consumption into an amount due. Ruba first selects the events that match a meter, applies that meter’s aggregation rule, and then prices the resulting quantity. Use it whenever the buyer’s bill should follow what they actually consumed.

How prepaid units enter the balance

Meter credits give a buyer a prepaid usage allowance for one meter. Add a Meter Credits benefit to a product, choose the meter, and enter the number of units included. For recurring products, Ruba refreshes that allowance at the start of each billing period. A monthly subscription receives new credits monthly; an annual subscription receives them once per year.

Build the first meter

1

Define measurement

Create a meter with an event filter and an aggregation function. The filter selects qualifying events; the aggregation converts them into billable usage.
2

Price the result

Add a metered price that references the meter to a subscription product. Metered prices are not available for one-time products.
3

Send production events

Ingest application events. Events matching the filter increase that customer’s measured usage.
4

Expose the estimate

Customers can inspect estimated charges for each meter in the Customer Portal.