Reporting Usage
Usage is reported via Usage Records. You can report usage as it happens (real-time) or in batches.Aggregation Types
When configuring a metered component in a Plan, you choose how usage is aggregated over the billing period:- Sum: Adds up all reported usage (e.g., API calls).
- Max: Uses the maximum value recorded (e.g., Peak Storage).
- Last: Uses the most recent value recorded (e.g., Number of Active Users).
Idempotency
To prevent double-billing due to network retries, you should provide anidempotency_key when reporting usage. This ensures a specific event is counted only once.