Retrieve granular usage data for a specific customer and billable metric, with the ability to break down usage by custom grouping dimensions. This endpoint enables deep usage analytics by segmenting data across attributes like region, user, model type, or any custom dimension defined in your billable metrics.
An array of PagedUsageAggregate objects containing:
starting_on and ending_before: Time window boundariesgroup: Object mapping group keys to their values
{"region": "US-East"}){"region": "US-East", "team": "engineering"})value: Aggregated usage for this group and time windownext_page: Pagination cursor for large datasetscustomer_id, billable_metric_id, and window_sizewindow_size to hour, day, or none for different granularitiesgroup_key and group_filters to specify groups and group filtersgroup_key), the default and max limit is 100next_page for large result setsBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Max number of results that should be returned
1 <= x <= 100Cursor that indicates where the next page of results should start.
The usage query to run
A window_size of "day" or "hour" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of "none" will return a single usage aggregate for the entirety of the specified period.
hour, day, none, HOUR, DAY, NONE, Hour, Day, None Use group_key and group_filters instead. Use a single group key to group by. Compound group keys are not supported.
Group key to group usage by. Supports both simple (single key) and compound (multiple keys) group keys.
For simple group keys, provide a single key e.g. ["region"].
For compound group keys, provide multiple keys e.g. ["region", "team"].
For streaming metrics, the keys must be defined as a simple or compound group key on the billable metric. For compound group keys, all keys must match an exact compound group key definition — partial matches are not allowed.
Cannot be used together with group_by.
11["region", "team"]Object mapping group keys to arrays of values to filter on. Only usage matching these filter values will be returned. Keys must be present in group_key. Omit a key or use an empty array to include all values for that dimension.
{
"region": ["us-east1", "us-west1"],
"team": ["UI"]
}If true, will return the usage for the current billing period. Will return an error if the customer is currently uncontracted or starting_on and ending_before are specified when this is true.