key plus a list of allowed values attached to a billable metric. When you send an event, the values live inside properties, and Lago matches them against the filter definition to route usage to the right charge on the plan.
Why filters matter
You won’t nail your pricing model on version one. As your product evolves, so will the way you measure usage. Lago’s metering engine and rate engine are decorrelated, which means you can evolve your dimensions and your pricing independently, without forcing a rewrite of either:- Metering: What you collect and how you slice it (the filter definition on the billable metric).
- Rating: How each slice is priced (the charge on the plan).
Use cases
You’ve been ingesting events and billing customers. Now you need to evolve the measurement:- New region launch. You meter compute hours. Now you want to price
USandEUseparately. - New model added. You meter tokens. Now you want to split by
modeland charge accordingly. - New tier of service. You meter API calls. Now you want to separate
real-timefrombatch.
Regional pricing
Regional pricing
You meter compute hours and launch in Europe. EU infrastructure costs more to run, so you want to charge EU customers differently without creating a second metric.On the plan, add two charges on the same
compute metric — one for the US regions, one for the EU regions — each at its own rate.Per-model pricing (AI / LLM platforms)
Per-model pricing (AI / LLM platforms)
You meter tokens. Different models have very different costs, so Each model becomes its own charge on the plan, with its own per-token rate.
gpt-4 should not be priced the same as llama or mixtral.Tier of service
Tier of service
You meter API calls. Real-time requests are more expensive to serve than batched ones.
Combined dimensions (matrix pricing)
Combined dimensions (matrix pricing)
Filters can be combined. A Each event specifies both
gpt-4 call in Europe is not priced the same as a llama call in the US.region and model. On the plan, you can create a charge per combination — one metric, four prices, no duplicated events.How it works
- Add a new filter key or value to the existing metric. The metric itself doesn’t get a new version. You are extending its dimensions.
- Events already in Lago pick up the new dimension, as long as they haven’t been invoiced yet.
- Add a new charge on the plan for the new filter value. This is a separate step in the rate engine, independent from the metric change.
- Invoice as usual. New dimensions appear on the next invoice. Already-invoiced periods are not touched.
Worked example
Day 20
You launch in Europe. You add
eu-west-1 as a filter value on the same metric. No new metric version. No schema change.What can and cannot change retroactively
The hard constraints are the metric code and the aggregation type. They must exist in your organization at the time events are ingested. Everything else is flexible.| Change | Pre-invoice events | Already-invoiced events |
|---|---|---|
| New filter value on an existing metric | ✅ | ❌ |
| New filter key on an existing metric | ✅ | ❌ |
| Add an existing metric as a new charge on a plan | ✅ (past events with matching code are picked up) | ❌ |
| New billable metric with a new code | ❌ (past events were ingested under a different code) | ❌ |
| Price change on an existing charge | ✅ (see retroactive pricing) | Contact CS |
Dimension evolution vs retroactive pricing
These solve different problems:| Dimension evolution | Retroactive pricing | |
|---|---|---|
| What changes | What you measure (new filters, group keys) | What you charge for existing measurements |
| Self-serve | ✅ via UI or API | Pre-invoice: self-serve. Invoiced: contact CS. |
| Affects invoiced periods | ❌ | Requires CS for corrections |
Design guidance
When defining a billable metric at the start of a project:- Use a broad name that will absorb future dimensions (
compute_eventsrather thancompute_us_events). - Include dimensions you might price on even if you’re not pricing on them yet. Send
regionas a property even if you only have one region today — you can add the filter key and charges later, but only if the events already carry the property. - You can always add filters and group keys later, but you cannot retroactively apply a different metric code to past events.
Create filters
Your company provides DevOps services and you want to charge your customers for compute capacity by the hour. In your Lago account, you create acompute billable metric that calculates the total number of hours (i.e. SUM(properties.hours)).
As your customers can choose from different cloud providers and define a region, you need to filter usage records (i.e. events) according to the provider and region.
On the configuration page of your billable metric, you can define two filters: provider and region, with all the necessary values (see snippet below).
- Dashboard
- API
- Create a new billable metric;
- Add a new filter; and
- Define your different filters.

Event including a group value
tokens metric with a model dimension:
Event with a model dimension
Edit filters
You can edit billable metric filters associated with existing subscriptions. It’s important to note that making changes to these metric filters can have an impact on all plans where this billable metric is defined as a charge. Here’s an example to illustrate the impact of editing a billable metric:- Since
"region": "europe"remains the same between both payloads, this filter remains in the billable metric. - As
"region": "usa"is present in Payload A but not in Payload B, this filter is removed from the billable metric. - As
"region": "USA"is not present in Payload A but is present in Payload B, this filter will be created in the billable metric. - Similarly, as
"region": "africa"is not present in Payload A but is present in Payload B, this filter will be created in the billable metric.
- If an existing filter combination remains the same (case 1), Lago will retain this specific filter from the filters combination in all associated charges.
- If an existing filter combination is removed from the billable metric (case 2), Lago will remove this specific filter from the filters combination in all associated charges.
- If a new filter combination is created in the billable metric (case 3 and 4), Lago will not automatically add this filter in the filters combination in all associated charges; you will need to add them manually.