Retrieve aggregated usage data across multiple customers and billable metrics in a single query. This batch endpoint enables you to fetch usage patterns at scale, broken down by time windows, making it ideal for building analytics dashboards, generating reports, and monitoring platform-wide usage trends.
An array of UsageBatchAggregate objects containing:
customer_id: The customer this usage belongs tobillable_metric_id and billable_metric_name: What was measuredstart_timestamp and end_timestamp: Time window for this data pointvalue: Aggregated usage amount for the periodgroups (optional): Usage broken down by group keys with valuesnext_page: Pagination cursor for large result setswindow_size to hour, day, or none (entire period)starting_on, ending_before, and window_sizecustomer_ids: Limit to specific customers (omit for all customers)billable_metrics: Limit to specific metrics (omit for all metrics)next_page cursor to retrieve large datasetsBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Cursor 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 A list of Metronome customer IDs to fetch usage for. If absent, usage for all customers will be returned.
A list of billable metrics to fetch usage for. If absent, all billable metrics will be returned.