SUM
Adds all event values together. When to use: Counting discrete actions — API calls, messages sent, tasks executed, tokens generated.MAX
Takes the highest single value observed during the period. When to use: Peak capacity measurements — max concurrent connections, peak storage used at any point, highest queue depth.UNIQUE_COUNT
Counts the number of distinct values of a specified property. When to use: Monthly active users, unique API consumers, distinct items processed, unique devices.For
UNIQUE_COUNT meters, the SDK endpoint reads user_id from the event metadata. Make sure to include it:LAST
Takes the most recent event value received during the period. When to use: Snapshot-based billing — current storage GB, current number of active seats, current record count.Choosing the Right Aggregation
| Use Case | Recommended Type |
|---|---|
| API call billing | SUM |
| Data transferred | SUM |
| AI token usage | SUM |
| Monthly active users | UNIQUE_COUNT |
| Storage billing (current) | LAST |
| Seat-based billing (peak) | MAX |
| Concurrent connection peak | MAX |
| Messages processed | SUM |
| Inference requests | SUM |