v1
latestOpenAPI 3.1.02026-07-26269227514.8 KBGet consumption analytics
Query credit or ACU consumption data for the authenticated team. Results are sourced from hourly-aggregated billing events and can be filtered by date range, product, model, and group.
The response shape depends on the team's billing strategy:
- Credits-based teams receive prompt_credits and flex_credits in each row.
- ACU-based teams receive billed_acus in each row.
Responses are cached for 1 hour. Use If-None-Match with a previously returned ETag to receive a 304 Not Modified when the data has not changed.
These endpoints are designed for periodic reporting and bulk export. They are not intended for real-time usage monitoring: data is hourly-aggregated and the rate limit is low (10 requests per hour per team).
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.
Time granularity for grouping results. When specified, each row includes a timestamp field. If omitted, results are aggregated across the entire date range.
Comma-separated list of dimensions to group results by. Supported dimensions:
- user — includes user_id and user_email in each row
- model_uid — includes model_uid in each row
- ide — includes ide in each row
- ide_version — includes ide_version in each row; requires ide to also be included
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.
Opaque cursor from a previous response's pagination.next_page_cursor to fetch the next page.
Headers
ETag value from a previous response. If the data has not changed, the server returns 304 Not Modified.
Response
Consumption data returned successfully.
Example response
{
"data": [
{
"timestamp": "2026-05-01",
"user_email": "alice@example.com",
"model_uid": "claude-4-sonnet",
"ide": "windsurf",
"ide_version": "1.0.0"
}
]
}