Sum adds the values of an event property during a billing cycle. Use it when each event reports an additional quantity, such as tokens consumed or data transferred.

Sum calculation method
Configure the metric
Setfield_name to the event property you want to measure.
Choose what happens when a billing cycle ends:
recurring: true: Lago keeps the quantity and carries it into the next cycle.recurring: false: Lago resets the quantity, so each cycle starts fresh.
Create the metric
- Dashboard
- API
- Go to Billable metrics in the side menu.
- Create a new billable metric.
- Enter a name, a code and an optional description.
- Select Sum as the aggregation type.
- Choose whether the measured quantity carries over or resets at the end of each billing cycle.
- Select the event property you want to measure.
- Add filters if you want to group usage by dimensions such as region or provider.
- Click Add billable metric.
Calculation example
The two example events below belong tocontract_example and the same billing cycle. Their timestamps are January 16 and 17, 2027 at 00:00 UTC.
Event 1
Event 2
Aggregation examples
Compare how aggregation types calculate usage.
Metered products
Connect your metric to a Product.
Create a billable metric (API)
POST /billable_metricsIngest usage
Send usage events to Lago.