Get usage breakdown
Retrieve usage metrics grouped by a specific dimension.
This endpoint provides detailed breakdowns of usage data, allowing you to see how usage is distributed across different dimensions like models, customers, event types, or providers.
Use Cases:
- See which models consume the most tokens
- Identify top customers by usage
- Compare usage across different event types
- Analyze provider-specific consumption
Authorization
Bearer AuthorizationBearer <token>
Project API key
In: header
Query Parameters
groupBy*string
Dimension to group usage by
Value in
"model" | "customer_id" | "event_type" | "provider"customerId?string
Filter usage by customer ID before grouping
eventType?string
Filter usage by event type before grouping
model?string
Filter usage by model name before grouping
startDate*string
Start of the date range (ISO 8601 format)
Format
date-timeendDate*string
End of the date range (ISO 8601 format)
Format
date-timeResponse Body
application/json
application/json
application/json
curl -X GET "https://api.limitry.com/v1/usage/breakdown?groupBy=model&startDate=2019-08-24T14%3A15%3A22Z&endDate=2019-08-24T14%3A15%3A22Z"{
"data": [
{
"dimension": "gpt-4",
"totalEvents": 500,
"totalTokens": 200000,
"totalInputTokens": 150000,
"totalOutputTokens": 50000,
"totalCostCents": 750
},
{
"dimension": "gpt-3.5-turbo",
"totalEvents": 750,
"totalTokens": 250000,
"totalInputTokens": 150000,
"totalOutputTokens": 100000,
"totalCostCents": 500
}
]
}{
"error": "Invalid request"
}{
"error": "Invalid or missing API key"
}