Repository Public
1---2title: Get Messages Usage Report3url: https://platform.claude.com/docs/en/api/beta/organization/usage_report/retrieve_messages4---56# Get Messages Usage Report78**GET** `/v1/organizations/usage_report/messages`910Get Messages Usage Report1112## Query parameters1314- `starting_at: string`1516 Time buckets that start on or after this RFC 3339 timestamp will be returned.17 Each time bucket will be snapped to the start of the minute/hour/day in UTC.1819 format: date-time2021- `account_ids: optional array of string`2223 Restrict usage returned to the specified user account ID(s).2425- `api_key_ids: optional array of string`2627 Restrict usage returned to the specified API key ID(s).2829- `bucket_width: optional "1d" or "1h" or "1m"`3031 Time granularity of the response data.3233 default: 1d3435 - `"1d"`3637 - `"1h"`3839 - `"1m"`4041- `context_window: optional array of "0-200k" or "200k-1M"`4243 Restrict usage returned to the specified context window(s).4445 - `"0-200k"`4647 - `"200k-1M"`4849- `ending_at: optional string`5051 Time buckets that end before this RFC 3339 timestamp will be returned.5253 format: date-time5455- `group_by: optional array of "account_id" or "api_key_id" or "context_window" or 6 more`5657 Group by any subset of the available options. Grouping by `speed` requires the `fast-mode-2026-02-01` beta header.5859 - `"account_id"`6061 - `"api_key_id"`6263 - `"context_window"`6465 - `"inference_geo"`6667 - `"model"`6869 - `"service_account_id"`7071 - `"service_tier"`7273 - `"speed"`7475 - `"workspace_id"`7677- `inference_geos: optional array of "global" or "not_available" or "us"`7879 Restrict usage returned to the specified inference geo(s). Use `not_available` for models that do not support specifying `inference_geo`.8081 - `"global"`8283 - `"not_available"`8485 - `"us"`8687- `limit: optional number`8889 Maximum number of time buckets to return in the response.9091 The default and max limits depend on `bucket_width`:92 • `"1d"`: Default of 7 days, maximum of 31 days93 • `"1h"`: Default of 24 hours, maximum of 168 hours94 • `"1m"`: Default of 60 minutes, maximum of 1440 minutes9596- `models: optional array of string`9798 Restrict usage returned to the specified model(s).99100- `page: optional string`101102 Optionally set to the `next_page` token from the previous response.103104- `service_account_ids: optional array of string`105106 Restrict usage returned to the specified service account ID(s).107108- `service_tiers: optional array of "batch" or "flex" or "flex_discount" or 3 more`109110 Restrict usage returned to the specified service tier(s).111112 - `"batch"`113114 - `"flex"`115116 - `"flex_discount"`117118 - `"priority"`119120 - `"priority_on_demand"`121122 - `"standard"`123124- `speeds: optional array of "standard" or "fast"`125126 Restrict usage returned to the specified speed(s) (Claude Code research preview).127 Requires the `fast-mode-2026-02-01` beta header.128129 - `"standard"`130131 - `"fast"`132133- `workspace_ids: optional array of string`134135 Restrict usage returned to the specified workspace ID(s).136137## Headers138139- `"anthropic-beta": optional array of AnthropicBeta`140141 Optional header to specify the beta version(s) you want to use.142143 - `string`144145 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`146147 - `"message-batches-2024-09-24"`148149 - `"prompt-caching-2024-07-31"`150151 - `"computer-use-2024-10-22"`152153 - `"computer-use-2025-01-24"`154155 - `"pdfs-2024-09-25"`156157 - `"token-counting-2024-11-01"`158159 - `"token-efficient-tools-2025-02-19"`160161 - `"output-128k-2025-02-19"`162163 - `"files-api-2025-04-14"`164165 - `"mcp-client-2025-04-04"`166167 - `"mcp-client-2025-11-20"`168169 - `"dev-full-thinking-2025-05-14"`170171 - `"interleaved-thinking-2025-05-14"`172173 - `"code-execution-2025-05-22"`174175 - `"extended-cache-ttl-2025-04-11"`176177 - `"context-1m-2025-08-07"`178179 - `"context-management-2025-06-27"`180181 - `"model-context-window-exceeded-2025-08-26"`182183 - `"skills-2025-10-02"`184185 - `"fast-mode-2026-02-01"`186187 - `"output-300k-2026-03-24"`188189 - `"user-profiles-2026-03-24"`190191 - `"user-profiles-2026-08-18"`192193 - `"user-profiles-2026-09-04"`194195 - `"advisor-tool-2026-03-01"`196197 - `"managed-agents-2026-04-01"`198199 - `"cache-diagnosis-2026-04-07"`200201 - `"dreaming-2026-04-21"`202203 - `"thinking-token-count-2026-05-13"`204205 - `"server-side-fallback-2026-06-01"`206207 - `"server-side-fallback-2026-07-01"`208209 - `"fallback-credit-2026-06-01"`210211 - `"fallback-credit-2026-07-01"`212213 - `"agent-memory-2026-07-22"`214215 - `"mid-conversation-tool-changes-2026-07-01"`216217 - `"compact-2026-01-12"`218219 - `"computer-use-2025-11-24"`220221 - `"mcp-tunnels-2026-06-22"`222223 - `"structured-outputs-2025-11-13"`224225 - `"task-budgets-2026-03-13"`226227 - `"thinking-display-updates-2026-08-18"`228229 - `"ce-user-management-2026-07-13"`230231 - `"mid-conversation-output-config-2026-07-01"`232233 - `"thinking-binding-controls-2026-08-01"`234235 - `"mid-conversation-system-clear-at-2026-08-21"`236237 - `"compact-2026-09-04"`238239## Returns240241- `BetaMessagesUsageReport object`242243 - `data: array of object`244245 List of time buckets for this page, oldest first: one per `bucket_width` interval, including intervals with no usage (their `results` list is empty). A page holds at most `limit` buckets.246247 - `ending_at: string`248249 End of the time bucket (exclusive) in RFC 3339 format.250251 format: date-time252253 - `results: array of object`254255 List of usage items for this time bucket. There may be multiple items if one or more `group_by[]` parameters are specified.256257 - `account_id: string or null`258259 ID of the user account that made the request. `null` if not grouping by account or for non-OAuth requests.260261 - `api_key_id: string or null`262263 ID of the API key used. `null` if not grouping by API key or for usage in the Anthropic Console.264265 - `cache_creation: BetaCacheCreation`266267 The number of input tokens for cache creation.268269 - `ephemeral_1h_input_tokens: number`270271 The number of input tokens used to create the 1 hour cache entry.272273 default: 0, minimum: 0274275 - `ephemeral_5m_input_tokens: number`276277 The number of input tokens used to create the 5 minute cache entry.278279 default: 0, minimum: 0280281 - `cache_read_input_tokens: number`282283 The number of input tokens read from the cache.284285 - `context_window: "0-200k" or "200k-1M" or null`286287 Context window used. `null` if not grouping by context window.288289 - `"0-200k"`290291 - `"200k-1M"`292293 - `inference_geo: "global" or "not_available" or "us" or null`294295 Inference geo used matching requests' `inference_geo` parameter if set, otherwise the workspace's `default_inference_geo`.296 For models that do not support specifying `inference_geo` the value is `"not_available"`. Always `null` if not grouping by inference geo.297298 - `"global"`299300 - `"not_available"`301302 - `"us"`303304 - `model: string or null`305306 Model used. `null` if not grouping by model.307308 - `output_tokens: number`309310 The number of output tokens generated.311312 - `server_tool_use: object`313314 Server-side tool usage metrics.315316 - `web_search_requests: number`317318 The number of web search requests made.319320 - `service_account_id: string or null`321322 ID of the service account that made the request. `null` if not grouping by service account or for non-OIDC-federation requests.323324 - `service_tier: "batch" or "flex" or "flex_discount" or 3 more or null`325326 Service tier used. `null` if not grouping by service tier.327328 - `"batch"`329330 - `"flex"`331332 - `"flex_discount"`333334 - `"priority"`335336 - `"priority_on_demand"`337338 - `"standard"`339340 - `uncached_input_tokens: number`341342 The number of uncached input tokens processed.343344 - `workspace_id: string or null`345346 ID of the Workspace used. `null` if not grouping by workspace or for the default workspace.347348 - `starting_at: string`349350 Start of the time bucket (inclusive) in RFC 3339 format.351352 format: date-time353354 - `has_more: boolean`355356 Indicates if there are more results.357358 - `next_page: string or null`359360 Opaque cursor for the next page, or `null` when `has_more` is false. Pass it as the `page` parameter in the next request.361362## Example363364```bash365curl https://api.anthropic.com/v1/organizations/usage_report/messages \366 -H 'anthropic-version: 2023-06-01' \367 -H "X-Api-Key: $ANTHROPIC_API_KEY"368```369370### Response (200)371372```json373{374 "data": [375 {376 "ending_at": "2025-08-02T00:00:00Z",377 "results": [378 {379 "account_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",380 "api_key_id": "apikey_01Rj2N8SVvo6BePZj99NhmiT",381 "cache_creation": {382 "ephemeral_1h_input_tokens": 0,383 "ephemeral_5m_input_tokens": 0384 },385 "cache_read_input_tokens": 200,386 "context_window": "0-200k",387 "inference_geo": "global",388 "model": "claude-opus-5",389 "output_tokens": 500,390 "server_tool_use": {391 "web_search_requests": 10392 },393 "service_account_id": "svac_01Hk3R9TWxq7CfQak00OiVw4",394 "service_tier": "standard",395 "uncached_input_tokens": 1500,396 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"397 }398 ],399 "starting_at": "2025-08-01T00:00:00Z"400 }401 ],402 "has_more": true,403 "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="404}405```406