Get Token Usage
Get token usage aggregated into time buckets (15 minutes by default) by user and model.
Returns usage broken down by:
- input_tokens: Total input tokens as the provider reported them
- cached_tokens: Cache read tokens
- cache_write_tokens: Cache write tokens
- new_input_tokens: Input tokens billed at the full input rate
- output_tokens: Total output tokens
- reasoning_tokens: Reasoning output tokens (subset of output_tokens)
- billable_tokens: Every charged token, comparable to a provider console
Defaults to the caller's own data. Admin users (with @quadrillion.io email) may opt into cross-user data by passing user_id (specific user) or all_users=true (everyone). Non-admin requests for other users' data are silently scoped to the caller.
Passing org_id scopes the response to that organization's members and takes precedence over user_id/all_users. It requires platform admin or org admin/owner access (403 otherwise) and includes member identity in buckets.
The internal dashboard, identified by its workload token rather than a user, reads every account's usage without identity and cannot scope to an organization.
Query parameters
Filter by user ID (admin only)
Filter by user ID (admin only)
Return data for all users (admin only opt-in)
Return data for all users (admin only opt-in)
Scope to an organization's members (org admin only)
Scope to an organization's members (org admin only)
Filter by model name
Filter by model name
Filter by opt-in attribution tag. Normalized like the stored tag, so 'HSBC Demo' matches rows written as 'hsbc-demo'.
Filter by opt-in attribution tag. Normalized like the stored tag, so 'HSBC Demo' matches rows written as 'hsbc-demo'.
Start date (ISO 8601)
Start date (ISO 8601)
End date (ISO 8601)
End date (ISO 8601)
Keep only tags starting with this, e.g. 'benchmark'. Normalized before matching, preserving trailing '/' or '-'.
Keep only tags starting with this, e.g. 'benchmark'. Normalized before matching, preserving trailing '/' or '-'.
Width of each time bucket
Width of each time bucket
Response
Successful Response