get_usage_report
Retrieve token usage data from the Messages API. Query input, output, and cache token counts along with request volumes, aggregated by custom time windows and dimensions like workspace or model.
Instructions
Get detailed token usage from the Messages API.
Returns input/output/cache token counts and request counts, bucketed by the requested time window and grouped by the requested dimensions. Use this for questions like 'how many Opus tokens did workspace X burn yesterday' or 'show daily request volume for the last week grouped by model'. Data appears within ~5 minutes of API calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| starting_at | Yes | RFC 3339 start time, e.g. '2026-05-01T00:00:00Z' | |
| ending_at | No | RFC 3339 end time. Defaults to now. | |
| bucket_width | No | Aggregation window: '1m', '1h', or '1d' | 1d |
| group_by | No | Dimensions to group by. Any subset of: 'workspace_id', 'api_key_id', 'model', 'service_tier', 'context_window'. Omit for an org-wide total. | |
| limit | No | ||
| page | No | Pagination cursor from previous response |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||