Group keys
Pricing group keys
AI and infrastructure platforms often tailor pricing based on variables such as geography, hosting provider, or service tier. Lago’s Pricing Group Keys offer a streamlined way to support this kind of dynamic pricing without duplicating product definitions.
With pricing group keys, you can group usage events to a single product based on configurable dimensions—like cloud provider, model type, deployment region, or instance class. This allows you to reflect real-world cost variations while keeping your product catalog clean and manageable.
When setting up a charge, you define the relevant keys. You don’t need to predefine every possible value. Instead, Lago intelligently routes each usage event to the correct pricing group based on the attributes provided at runtime.
Define pricing group keys
To define a pricing group key, you need to:
- Go to the plan where you want to configure dynamic pricing;
- Select the charge you want to apply the pricing group key to;
- In the charge settings, enter a key in the Pricing Group Key field (e.g., region, cloud, instance_type);
- Send usage events that include this key in the properties object, using any value without predefining them; and
- Lago will automatically group usage into the correct pricing bucket based on the key’s value.
Pricing group keys are available for all charge models. You can define multiple pricing group keys for a single charge.
Example of pricing group keys
Let’s define a pricing group key called regions
for a charge used to calculate Storage costs for your customers.
Define a pricing group key
By sending usage events with a regions
property, you can include any number of region values. Lago will automatically group and aggregate usage based on the values provided in your events.
Calculate usage with pricing group values