Get Usage Report for the Messages API
The Admin API is unavailable for individual accounts. To collaborate with teammates and add members, set up your organization in Console → Settings → Organization.
Headers
Your unique Admin API key for authentication.
This key is required in the header of all Admin API requests, to authenticate your account and access Anthropic's services. Get your Admin API key through the Console.
Query Parameters
Maximum number of time buckets to return in the response.
The default and max limits depend on bucket_width
:
• "1d"
: Default of 7 days, maximum of 31 days
• "1h"
: Default of 24 hours, maximum of 168 hours
• "1m"
: Default of 60 minutes, maximum of 1440 minutes
7
Optionally set to the next_page
token from the previous response.
"page_MjAyNS0wNS0xNFQwMDowMDowMFo="
null
Time buckets that start on or after this RFC 3339 timestamp will be returned. Each time bucket will be snapped to the start of the minute/hour/day in UTC.
"2024-10-30T23:58:27.427722Z"
Time buckets that end before this RFC 3339 timestamp will be returned.
"2024-10-30T23:58:27.427722Z"
Restrict usage returned to the specified API key ID(s).
"apikey_01Rj2N8SVvo6BePZj99NhmiT"
Restrict usage returned to the specified workspace ID(s).
"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
Restrict usage returned to the specified model(s).
"claude-sonnet-4-20250514"
"claude-3-5-haiku-20241022"
Restrict usage returned to the specified service tier(s).
standard
, batch
, priority
"standard"
"batch"
"priority"
Restrict usage returned to the specified context window(s).
0-200k
, 200k-1M
"0-200k"
"200k-1M"
Group by any subset of the available options.
api_key_id
, workspace_id
, model
, service_tier
, context_window
"api_key_id"
"workspace_id"
"model"
"service_tier"
"context_window"
Time granularity of the response data.
1d
, 1m
, 1h