What are Dimensions?
Dimensions are categorical string values attached to events. They enable filtering and grouping across meters, limits, and analytics.| Use Case | Dimension | Example Values |
|---|---|---|
| Model tracking | model | "gpt-4", "gpt-3.5-turbo" |
| Team allocation | team_id | "engineering", "sales" |
| Feature usage | feature | "chat", "search" |
| Environment | environment | "prod", "staging" |
| Provider | provider | "openai", "anthropic" |
Adding Dimensions to Events
Include dimensions when recording events:Filtering Meters by Dimension
Create meters that only aggregate events matching specific dimensions:Filtering Limits by Dimension
Apply limits to specific subsets of usage:Filtering Balances by Dimension
Allocate credit balances per team or user:Usage Breakdown by Dimension
Query usage grouped by dimension values:Common Dimension Patterns
By AI Model
Track usage and costs across different models:By Team or User
Allocate usage within an organization:By Feature
Understand which features drive usage:By Environment
Separate production from development:Dimension Matching Rules
When filtering by dimensions:- All specified dimensions must match - If a limit has
{"model": "gpt-4", "team_id": "eng"}, an event must have both dimensions with those exact values - Extra dimensions are ignored - An event with
{"model": "gpt-4", "team_id": "eng", "user_id": "alice"}still matches - Missing dimensions don’t match - An event with only
{"model": "gpt-4"}won’t match a filter requiringteam_id
Best Practices
- Use consistent dimension names - Stick to
snake_case(e.g.,team_idnotteamId) - Keep values lowercase - Use
"gpt-4"not"GPT-4"for easier filtering - Don’t over-dimension - Only add dimensions you’ll actually filter or group by
- Use values, not dimensions, for numbers - Dimensions are for categorical data only