Get Consumption
Query credit or ACU consumption analytics with flexible filtering, grouping, and pagination.
Authentication
This endpoint uses Bearer token authentication. Include your service key in theAuthorization header:
Billing Strategy
The response shape depends on your team’s billing strategy:| Strategy | Populated fields | Description |
|---|---|---|
CREDITS | prompt_credits, flex_credits | Standard Enterprise SaaS teams |
ACU | billed_acus | Teams billed by Agent Compute Units |
message_count field (inside consumption) is always populated regardless of billing strategy.
Grouping and Granularity
Usegranularity and group_by to control the shape of returned data:
- No granularity or grouping — returns a single aggregated row for the entire date range
granularity=daily— each row includes atimestampinYYYY-MM-DDformatgranularity=monthly— each row includes atimestampinYYYY-MMformatgroup_by=user— each row includes auser_idanduser_emailgroup_by=user,model_uid— each row includesuser_id,user_email, andmodel_uidgroup_by=ide— each row includes anide
Pagination
Results are paginated with a default page size of 1,000 rows (max 10,000). When more results are available, the response includes anext_page_cursor in the pagination object. Pass it as the page_cursor query
parameter to fetch the next page.
Page cursors expire after 24 hours. A follow-up page request does not count as a new query against your rate limit.
Caching
Responses include anETag header. To avoid redundant data transfer, include the If-None-Match header
with the previous ETag value — the server will return 304 Not Modified if the data has not changed.
Rate Limits
This endpoint is rate-limited to 10 requests per hour per team. If you exceed this limit, the server returns429 Too Many Requests with a Retry-After header.
Paginating an earlier query (following a next_page_cursor) does not count against this limit —
only the initial query for each report does. The low limit reflects that this endpoint is for
periodic reporting, not real-time usage monitoring.Authorizations
A service key with Analytics Read permission, passed as a Bearer token in the Authorization header.
Create a service key in your team settings under the "Service Keys" section.
Headers
ETag value from a previous response. If the data has not changed, the server returns 304 Not Modified.
Query Parameters
Start of the date range (inclusive) in YYYY-MM-DD format.
End of the date range (inclusive) in YYYY-MM-DD format. The range must not exceed 90 days.
Product to query consumption for.
agent Time granularity for grouping results. When specified, each row includes a timestamp field.
If omitted, results are aggregated across the entire date range.
daily, monthly Comma-separated list of dimensions to group results by. Supported dimensions:
user— includesuser_idanduser_emailin each rowmodel_uid— includesmodel_uidin each rowide— includesidein each row
Comma-separated list of model UIDs to filter results to.
Filter results to users in a specific group. The service key must have access to this group.
Filter results to a specific user (auth UID).
Maximum number of rows to return per page.
1 <= x <= 10000Opaque cursor from a previous response's pagination.next_page_cursor to fetch the next page.
