Usage Report changedapi/admin/usage_report
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+68added
Lines−59removed
From line
1
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits5to this page, all time
### Query parameters ### Headers #### Response (200) ### Query parameters #### Response (200) ## Domain types ### Query Parameters ### Header Parameters #### Response ### Query Parameters #### Response ## Domain Types
The whole hunk
from line 1, old and new numbered
/
from line 1
1---
2title: Usage Report
3url: https://platform.claude.com/docs/en/api/admin/usage_report
4---
5
61# Usage Report
72
83## Get Messages Usage Report
94
10**get** `/v1/organizations/usage_report/messages`
5**GET** `/v1/organizations/usage_report/messages`
116
127Get Messages Usage Report
138
14### Query Parameters
9### Query parameters
1510
1611- `starting_at: string`
1712
from line 13
1813 Time buckets that start on or after this RFC 3339 timestamp will be returned.
1914 Each time bucket will be snapped to the start of the minute/hour/day in UTC.
2015
16 format: date-time
17
2118- `account_ids: optional array of string`
2219
2320 Restrict usage returned to the specified user account ID(s).
from line 27
3027
3128 Time granularity of the response data.
3229
30 default: 1d
31
3332 - `"1d"`
3433
3534 - `"1h"`
from line 47
4847
4948 Time buckets that end before this RFC 3339 timestamp will be returned.
5049
50 format: date-time
51
5152- `group_by: optional array of "account_id" or "api_key_id" or "context_window" or 6 more`
5253
5354 Group by any subset of the available options. Grouping by `speed` requires the `fast-mode-2026-02-01` beta header.
from line 131
130131
131132 Restrict usage returned to the specified workspace ID(s).
132133
133### Header Parameters
134### Headers
134135
135136- `"anthropic-beta": optional array of string`
136137
from line 141
140141
141142### Returns
142143
143- `MessagesUsageReport object { data, has_more, next_page }`
144- `MessagesUsageReport object`
144145
145 - `data: array of object { ending_at, results, starting_at }`
146 - `data: array of object`
146147
147148 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.
148149
from line 151
150151
151152 End of the time bucket (exclusive) in RFC 3339 format.
152153
153 - `results: array of object { account_id, api_key_id, cache_creation, 10 more }`
154 format: date-time
154155
156 - `results: array of object`
157
155158 List of usage items for this time bucket. There may be multiple items if one or more `group_by[]` parameters are specified.
156159
157160 - `account_id: string or null`
from line 165
162165
163166 ID of the API key used. `null` if not grouping by API key or for usage in the Anthropic Console.
164167
165 - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
168 - `cache_creation: object`
166169
167170 The number of input tokens for cache creation.
168171
from line 208
205208
206209 The number of output tokens generated.
207210
208 - `server_tool_use: object { web_search_requests }`
211 - `server_tool_use: object`
209212
210213 Server-side tool usage metrics.
211214
from line 248
245248
246249 Start of the time bucket (inclusive) in RFC 3339 format.
247250
251 format: date-time
252
248253 - `has_more: boolean`
249254
250255 Indicates if there are more results.
from line 260
255260
256261### Example
257262
258```http
263```bash
259264curl https://api.anthropic.com/v1/organizations/usage_report/messages \
260265 -H 'anthropic-version: 2023-06-01' \
261266 -H "Authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
262267```
263268
264#### Response
269#### Response (200)
265270
266271```json
267272{
from line 305
300305
301306## Get Claude Code Usage Report
302307
303**get** `/v1/organizations/usage_report/claude_code`
308**GET** `/v1/organizations/usage_report/claude_code`
304309
305310Retrieve daily aggregated usage metrics for Claude Code users.
306311Enables organizations to analyze developer productivity and build custom dashboards.
307312
308### Query Parameters
313### Query parameters
309314
310315- `starting_at: string`
311316
312317 UTC date in YYYY-MM-DD format. Returns metrics for this single day only.
313318
319 pattern: ^\d{4}-\d{2}-\d{2}$
320
314321- `limit: optional number`
315322
316323 Number of records per page (default: 20, max: 1000).
317324
325 default: 20, maximum: 1000, minimum: 1
326
318327- `page: optional string`
319328
320329 Opaque cursor token from previous response's `next_page` field.
from line 330
321330
322331### Returns
323332
324- `ClaudeCodeUsageReport object { data, has_more, next_page }`
333- `ClaudeCodeUsageReport object`
325334
326 - `data: array of object { actor, core_metrics, customer_type, 7 more }`
335 - `data: array of object`
327336
328337 List of Claude Code usage records for the requested date.
329338
330 - `actor: object { email_address, type } or object { api_key_name, type }`
339 - `actor: object or object`
331340
332341 The user or API key that performed the Claude Code actions.
333342
334 - `UserActor object { email_address, type }`
343 - `UserActor object`
335344
336345 - `email_address: string`
337346
from line 350
341350
342351 Actor type. Always `"user_actor"` for a user.
343352
344 - `"user_actor"`
353 - `APIActor object`
345354
346 - `APIActor object { api_key_name, type }`
347
348355 - `api_key_name: string`
349356
350357 Name of the API key used to perform Claude Code actions.
from line 360
353360
354361 Actor type. Always `"api_actor"` for an API key.
355362
356 - `"api_actor"`
363 - `core_metrics: object`
357364
358 - `core_metrics: object { commits_by_claude_code, lines_of_code, num_sessions, pull_requests_by_claude_code }`
359
360365 Core productivity metrics measuring Claude Code usage and impact.
361366
362367 - `commits_by_claude_code: number`
from line 368
363368
364369 Number of git commits created through Claude Code's commit functionality.
365370
366 - `lines_of_code: object { added, removed }`
371 - `lines_of_code: object`
367372
368373 Statistics on code changes made through Claude Code.
369374
from line 401
396401 UTC day the usage metrics cover, as an RFC 3339 timestamp at midnight UTC
397402 (for example `2025-08-08T00:00:00Z`).
398403
404 format: date-time
405
399406 - `is_remote: boolean`
400407
401408 Whether the usage came from remote Claude Code sessions, such as Claude Code
402409 on the web. Remote and local usage are reported as separate rows.
403410
404 - `model_breakdown: array of object { estimated_cost, model, tokens }`
411 - `model_breakdown: array of object`
405412
406413 Token usage and cost breakdown by AI model used.
407414
408 - `estimated_cost: object { amount, currency }`
415 - `estimated_cost: object`
409416
410417 Estimated cost for using this model
411418
from line 428
421428
422429 Name of the AI model used for Claude Code interactions.
423430
424 - `tokens: object { cache_creation, cache_read, input, output }`
431 - `tokens: object`
425432
426433 Token usage breakdown for this model
427434
from line 456
449456
450457 Type of terminal or environment where Claude Code was used.
451458
452 - `tool_actions: map[object { accepted, rejected } ]`
459 - `tool_actions: map[object]`
453460
454461 Breakdown of tool action acceptance and rejection rates by tool type.
455462
from line 486
479486
480487### Example
481488
482```http
489```bash
483490curl https://api.anthropic.com/v1/organizations/usage_report/claude_code \
484491 -H 'anthropic-version: 2023-06-01' \
485492 -H "Authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
486493```
487494
488#### Response
495#### Response (200)
489496
490497```json
491498{
from line 570
563570}
564571```
565572
566## Domain Types
573## Domain types
567574
568575### Claude Code Usage Report
569576
570- `ClaudeCodeUsageReport object { data, has_more, next_page }`
577- `ClaudeCodeUsageReport object`
571578
572 - `data: array of object { actor, core_metrics, customer_type, 7 more }`
579 - `data: array of object`
573580
574581 List of Claude Code usage records for the requested date.
575582
576 - `actor: object { email_address, type } or object { api_key_name, type }`
583 - `actor: object or object`
577584
578585 The user or API key that performed the Claude Code actions.
579586
580 - `UserActor object { email_address, type }`
587 - `UserActor object`
581588
582589 - `email_address: string`
583590
from line 594
587594
588595 Actor type. Always `"user_actor"` for a user.
589596
590 - `"user_actor"`
597 - `APIActor object`
591598
592 - `APIActor object { api_key_name, type }`
593
594599 - `api_key_name: string`
595600
596601 Name of the API key used to perform Claude Code actions.
from line 604
599604
600605 Actor type. Always `"api_actor"` for an API key.
601606
602 - `"api_actor"`
607 - `core_metrics: object`
603608
604 - `core_metrics: object { commits_by_claude_code, lines_of_code, num_sessions, pull_requests_by_claude_code }`
605
606609 Core productivity metrics measuring Claude Code usage and impact.
607610
608611 - `commits_by_claude_code: number`
from line 612
609612
610613 Number of git commits created through Claude Code's commit functionality.
611614
612 - `lines_of_code: object { added, removed }`
615 - `lines_of_code: object`
613616
614617 Statistics on code changes made through Claude Code.
615618
from line 645
642645 UTC day the usage metrics cover, as an RFC 3339 timestamp at midnight UTC
643646 (for example `2025-08-08T00:00:00Z`).
644647
648 format: date-time
649
645650 - `is_remote: boolean`
646651
647652 Whether the usage came from remote Claude Code sessions, such as Claude Code
648653 on the web. Remote and local usage are reported as separate rows.
649654
650 - `model_breakdown: array of object { estimated_cost, model, tokens }`
655 - `model_breakdown: array of object`
651656
652657 Token usage and cost breakdown by AI model used.
653658
654 - `estimated_cost: object { amount, currency }`
659 - `estimated_cost: object`
655660
656661 Estimated cost for using this model
657662
from line 672
667672
668673 Name of the AI model used for Claude Code interactions.
669674
670 - `tokens: object { cache_creation, cache_read, input, output }`
675 - `tokens: object`
671676
672677 Token usage breakdown for this model
673678
from line 700
695700
696701 Type of terminal or environment where Claude Code was used.
697702
698 - `tool_actions: map[object { accepted, rejected } ]`
703 - `tool_actions: map[object]`
699704
700705 Breakdown of tool action acceptance and rejection rates by tool type.
701706
from line 730
725730
726731### Messages Usage Report
727732
728- `MessagesUsageReport object { data, has_more, next_page }`
733- `MessagesUsageReport object`
729734
730 - `data: array of object { ending_at, results, starting_at }`
735 - `data: array of object`
731736
732737 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.
733738
from line 740
735740
736741 End of the time bucket (exclusive) in RFC 3339 format.
737742
738 - `results: array of object { account_id, api_key_id, cache_creation, 10 more }`
743 format: date-time
739744
745 - `results: array of object`
746
740747 List of usage items for this time bucket. There may be multiple items if one or more `group_by[]` parameters are specified.
741748
742749 - `account_id: string or null`
from line 754
747754
748755 ID of the API key used. `null` if not grouping by API key or for usage in the Anthropic Console.
749756
750 - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
757 - `cache_creation: object`
751758
752759 The number of input tokens for cache creation.
753760
from line 797
790797
791798 The number of output tokens generated.
792799
793 - `server_tool_use: object { web_search_requests }`
800 - `server_tool_use: object`
794801
795802 Server-side tool usage metrics.
796803
from line 836
829836 - `starting_at: string`
830837
831838 Start of the time bucket (inclusive) in RFC 3339 format.
839
840 format: date-time
832841
833842 - `has_more: boolean`
834843
No line in this hunk matches that.