Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

Cost changedapi/admin/analytics/cost

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+107added
Lines−36removed
From line 1 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits6to this page, all time

### Query parameters #### Response (200) ### Query parameters #### Response (200) ## Domain types ### Query Parameters #### Response ### Query Parameters #### Response ## Domain Types

The whole hunk

from line 1, old and new numbered
/
lines
from line 1
1---
2title: Cost
3url: https://platform.claude.com/docs/en/api/admin/analytics/cost
4---
5 
61# Cost
72 
83## Get Cost Over Time
94 
10**get** `/v1/organizations/analytics/cost_report`
5**GET** `/v1/organizations/analytics/cost_report`
116 
127Get cost in USD over time across a date range.
138 
from line 11
1611token type. Available to organizations on a Claude Enterprise plan.
1712Requires an API key with the `read:analytics` scope.
1813 
19### Query Parameters
14### Query parameters
2015 
2116- `starting_at: string`
2217 
2318 Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.
2419 
20 format: date-time
21 
2522- `bucket_width: optional "1d" or "1h" or "1m"`
2623 
2724 Time bucket granularity.
2825 
26 default: 1d
27 
2928 - `"1d"`
3029 
3130 - `"1h"`
from line 35
3635 
3736 Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.
3837 
38 maxItems: 100
39 
3940 - `"0-200k"`
4041 
4142 - `"200k-1M"`
from line 45
4445 
4546 End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.
4647 
48 format: date-time
49 
4750- `group_by: optional array of "context_window" or "cost_type" or "inference_geo" or 6 more`
4851 
4952 Dimensions to break each time bucket out by. Defaults to no grouping (one total per bucket). Each bucket reports at most its top 100 groups; a group beyond that cap has no row in that bucket (there is no remainder row), so grouped buckets are not exhaustive when a dimension has more than 100 distinct values.
5053 
54 maxItems: 100
55 
5156 - `"context_window"`
5257 
5358 - `"cost_type"`
from line 75
7075 
7176 Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.
7277 
78 maxItems: 100
79 
7380 - `"global"`
7481 
7582 - `"not_available"`
from line 87
8087 
8188 Maximum number of time buckets per page. Defaults and caps vary by bucket_width (1d: default 7, max 31; 1h: default 24, max 168; 1m: default 60, max 256).
8289 
90 minimum: 1
91 
8392- `models: optional array of string`
8493 
8594 Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.
8695 
96 maxItems: 100
97 
8798- `page: optional string`
8899 
89100 Opaque cursor from a previous response's `next_page` field.
from line 103
92103 
93104 Product surfaces to include. Defaults to all products. Use `group_by[]=product` to break out per-product values. Values include "chat", "claude_code", "cowork", "office_agent", "claude_in_chrome", "claude_design", and "claude-in-slack". "claude-in-slack" (with hyphens) is Claude Tag, the Claude product in Slack. A similarly spelled legacy value (underscores instead of hyphens) identifies the retiring v1 Slack chat bot and appears only for organizations that used it.
94105 
106 maxItems: 100
107 
95108- `rbac_group_ids: optional array of string`
96109 
97110 Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.
98111 
112 maxItems: 100
113 
99114- `slack_channel_ids: optional array of string`
100115 
101116 Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.
102117 
118 maxItems: 100
119 
103120- `speeds: optional array of "fast" or "standard"`
104121 
105122 Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.
106123 
124 maxItems: 100
125 
107126 - `"fast"`
108127 
109128 - `"standard"`
from line 131
112131 
113132 Filter to specific users by tagged user ID.
114133 
134 maxItems: 100
135 
115136### Returns
116137 
117- `CostBucket object { data, data_refreshed_at, has_more, 2 more }`
138- `CostBucket object`
118139 
119 - `data: array of object { ending_at, results, starting_at }`
140 - `data: array of object`
120141 
121142 Time buckets for this page, oldest first: one per `bucket_width` interval, including intervals with no data (their `results` list is empty). A page holds at most `limit` buckets.
122143 
from line 145
124145 
125146 End of the time bucket (exclusive) in RFC 3339 format.
126147 
127 - `results: array of object { amount, context_window, cost_type, 10 more }`
148 format: date-time
128149 
150 - `results: array of object`
151 
129152 Rows for this time bucket. Empty when the bucket has no data; otherwise a single combined row when `group_by[]` is omitted, or one row per group (subject to the per-bucket group cap described on the `group_by[]` parameter).
130153 
131154 - `amount: string`
from line 177
154177 
155178 Currency code for the cost amount. Currently always `"USD"`.
156179 
157 - `"USD"`
180 default: USD
158181 
159182 - `inference_geo: "global" or "us" or null`
160183 
from line 237
214237 
215238 Start of the time bucket (inclusive) in RFC 3339 format.
216239 
240 format: date-time
241 
217242 - `data_refreshed_at: string or null`
218243 
219244 RFC 3339 timestamp of the export this response was served from. Null when no export yet covers any part of the requested range, in which case every bucket's `results` list is empty. Buckets beyond this watermark are incomplete; for stable results, set `ending_at` to this value or earlier. Data is typically refreshed every 4 hours but not final until about 30 days after the usage date (late-arriving events, reconciliation adjustments).
220245 
246 format: date-time
247 
221248 - `has_more: boolean`
222249 
223250 Whether another page is available. When true, pass `next_page` as the `page` parameter to fetch it.
from line 259
232259 
233260### Example
234261 
235```http
262```bash
236263curl https://api.anthropic.com/v1/organizations/analytics/cost_report \
237264 -H 'anthropic-version: 2023-06-01' \
238265 -H "X-Api-Key: $ANTHROPIC_ADMIN_API_KEY"
239266```
240267 
241#### Response
268#### Response (200)
242269 
243270```json
244271{
from line 301
274301 
275302## Get Per-User Cost
276303 
277**get** `/v1/organizations/analytics/user_cost_report`
304**GET** `/v1/organizations/analytics/user_cost_report`
278305 
279306Get per-user cost in USD across a date range.
280307 
from line 313
286313organizations on a Claude Enterprise plan. Requires an API key with the
287314`read:analytics` scope.
288315 
289### Query Parameters
316### Query parameters
290317 
291318- `starting_at: string`
292319 
293320 Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.
294321 
322 format: date-time
323 
295324- `bucket_width: optional "1d" or "1h" or "1m"`
296325 
297326 Time-bucket granularity. When set, each row's `starting_at` and `ending_at` are populated and one actor may span several rows (one per time bucket with usage). The time bucket counts toward `limit`, so one page can return multiple rows for the same actor. `ending_at` is required when `bucket_width` is set, and with `bucket_width="1m"` the range may span at most 24 hours. When omitted, each row aggregates the full `[starting_at, ending_at)` range.
from line 335
306335 
307336 Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.
308337 
338 maxItems: 100
339 
309340 - `"0-200k"`
310341 
311342 - `"200k-1M"`
from line 345
314345 
315346 End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.
316347 
348 format: date-time
349 
317350- `exclude_deleted_users: optional boolean`
318351 
319352 If true, omit rows for users who are deleted (`deleted: true`). A page may contain fewer than `limit` rows; use `has_more` and `next_page` to paginate as usual.
320353 
354 default: false
355 
321356- `group_by: optional array of "context_window" or "cost_type" or "inference_geo" or 6 more`
322357 
323358 Break each actor's row out by the given dimensions. Accepts the same values as the bucketed `/cost_report` endpoint. The `product`, `model`, `context_window`, `inference_geo`, and `speed` dimensions — and the time bucket, when `bucket_width` is set — count toward `limit`. `cost_type` and `token_type` do not: `cost_type` returns one row per cost component (tokens, web search, code execution); `token_type` returns one row per token type, each with `cost_type: "tokens"`; combining both returns the per-token-type rows plus the web-search and code-execution rows. A page can therefore contain more rows than `limit` when `cost_type` or `token_type` is requested.
324359 
360 maxItems: 100
361 
325362 - `"context_window"`
326363 
327364 - `"cost_type"`
from line 381
344381 
345382 Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.
346383 
384 maxItems: 100
385 
347386 - `"global"`
348387 
349388 - `"not_available"`
from line 393
354393 
355394 Number of rows per page (1-1000, default 20). One row per actor unless `group_by[]` or `bucket_width` splits an actor across rows; `cost_type`/`token_type` fan-out rows (cost endpoint only) are the exception — they do not count toward this limit, so `data` can exceed it.
356395 
396 default: 20, maximum: 1000, minimum: 1
397 
357398- `models: optional array of string`
358399 
359400 Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.
360401 
402 maxItems: 100
403 
361404- `order: optional "asc" or "desc"`
362405 
363406 Sort direction. Defaults to `desc`.
364407 
408 default: desc
409 
365410 - `"asc"`
366411 
367412 - `"desc"`
from line 415
370415 
371416 Metric to rank actors by. Defaults to `amount`.
372417 
418 default: amount
419 
373420 - `"amount"`
374421 
375422 - `"list_amount"`
from line 429
382429 
383430 Product surfaces to include. Defaults to all products. Values include "chat", "claude_code", "cowork", "office_agent", "claude_in_chrome", "claude_design", and "claude-in-slack". "claude-in-slack" (with hyphens) is Claude Tag, the Claude product in Slack. A similarly spelled legacy value (underscores instead of hyphens) identifies the retiring v1 Slack chat bot and appears only for organizations that used it.
384431 
432 maxItems: 100
433 
385434- `rbac_group_ids: optional array of string`
386435 
387436 Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.
388437 
438 maxItems: 100
439 
389440- `slack_channel_ids: optional array of string`
390441 
391442 Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.
392443 
444 maxItems: 100
445 
393446- `speeds: optional array of "fast" or "standard"`
394447 
395448 Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.
396449 
450 maxItems: 100
451 
397452 - `"fast"`
398453 
399454 - `"standard"`
from line 457
402457 
403458 Filter to specific users by tagged user ID.
404459 
460 maxItems: 100
461 
405462### Returns
406463 
407- `UserCost object { data, data_refreshed_at, has_more, 2 more }`
464- `UserCost object`
408465 
409 - `data: array of object { actor, amount, context_window, 13 more }`
466 - `data: array of object`
410467 
411468 Rows for this page, ranked by `order_by` in the `order` direction. One row per user, or several per user when `group_by[]` or `bucket_width` breaks that user's usage or cost out across rows. Rows split out by `cost_type` or `token_type` (cost endpoint only) stay adjacent and are ranked as one unit.
412469 
from line 487
430487 
431488 Actor type. Always `"user_actor"`.
432489 
433 - `"user_actor"`
434 
435490 - `user_id: string`
436491 
437492 Tagged user ID.
from line 517
462517 
463518 Currency code for the cost amount. Currently always `"USD"`.
464519 
465 - `"USD"`
520 default: USD
466521 
467522 - `ending_at: string or null`
468523 
469524 End of the row's UTC time bucket (exclusive), as an RFC 3339 timestamp; equal to `starting_at` plus one `bucket_width`. Null unless `bucket_width` is set.
470525 
526 format: date-time
527 
471528 - `inference_geo: "global" or "us" or null`
472529 
473530 Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).
from line 569
512569 
513570 Start of the row's UTC time bucket (inclusive), as an RFC 3339 timestamp. Null unless `bucket_width` is set; without `bucket_width`, each row aggregates the full requested range.
514571 
572 format: date-time
573 
515574 - `token_type: "cache_creation.ephemeral_1h_input_tokens" or "cache_creation.ephemeral_5m_input_tokens" or "cache_read_input_tokens" or 2 more or null`
516575 
517576 Token type when cost_type=tokens; null otherwise.
from line 589
530589 
531590 RFC 3339 timestamp of the export this response was served from. Null when no export yet covers any part of the requested range, in which case `data` is empty. Data beyond this watermark is incomplete; for stable results, set `ending_at` to this value or earlier. Data is typically refreshed every 4 hours but not final until about 30 days after the usage date (late-arriving events, reconciliation adjustments).
532591 
592 format: date-time
593 
533594 - `has_more: boolean`
534595 
535596 Whether another page is available. When true, pass `next_page` as the `page` parameter to fetch it.
from line 605
544605 
545606### Example
546607 
547```http
608```bash
548609curl https://api.anthropic.com/v1/organizations/analytics/user_cost_report \
549610 -H 'anthropic-version: 2023-06-01' \
550611 -H "X-Api-Key: $ANTHROPIC_ADMIN_API_KEY"
551612```
552613 
553#### Response
614#### Response (200)
554615 
555616```json
556617{
from line 648
587648}
588649```
589650 
590## Domain Types
651## Domain types
591652 
592653### Cost Bucket
593654 
594- `CostBucket object { data, data_refreshed_at, has_more, 2 more }`
655- `CostBucket object`
595656 
596 - `data: array of object { ending_at, results, starting_at }`
657 - `data: array of object`
597658 
598659 Time buckets for this page, oldest first: one per `bucket_width` interval, including intervals with no data (their `results` list is empty). A page holds at most `limit` buckets.
599660 
from line 662
601662 
602663 End of the time bucket (exclusive) in RFC 3339 format.
603664 
604 - `results: array of object { amount, context_window, cost_type, 10 more }`
665 format: date-time
605666 
667 - `results: array of object`
668 
606669 Rows for this time bucket. Empty when the bucket has no data; otherwise a single combined row when `group_by[]` is omitted, or one row per group (subject to the per-bucket group cap described on the `group_by[]` parameter).
607670 
608671 - `amount: string`
from line 694
631694 
632695 Currency code for the cost amount. Currently always `"USD"`.
633696 
634 - `"USD"`
697 default: USD
635698 
636699 - `inference_geo: "global" or "us" or null`
637700 
from line 754
691754 
692755 Start of the time bucket (inclusive) in RFC 3339 format.
693756 
757 format: date-time
758 
694759 - `data_refreshed_at: string or null`
695760 
696761 RFC 3339 timestamp of the export this response was served from. Null when no export yet covers any part of the requested range, in which case every bucket's `results` list is empty. Buckets beyond this watermark are incomplete; for stable results, set `ending_at` to this value or earlier. Data is typically refreshed every 4 hours but not final until about 30 days after the usage date (late-arriving events, reconciliation adjustments).
697762 
763 format: date-time
764 
698765 - `has_more: boolean`
699766 
700767 Whether another page is available. When true, pass `next_page` as the `page` parameter to fetch it.
from line 776
709776 
710777### User Cost
711778 
712- `UserCost object { data, data_refreshed_at, has_more, 2 more }`
779- `UserCost object`
713780 
714 - `data: array of object { actor, amount, context_window, 13 more }`
781 - `data: array of object`
715782 
716783 Rows for this page, ranked by `order_by` in the `order` direction. One row per user, or several per user when `group_by[]` or `bucket_width` breaks that user's usage or cost out across rows. Rows split out by `cost_type` or `token_type` (cost endpoint only) stay adjacent and are ranked as one unit.
717784 
from line 802
735802 
736803 Actor type. Always `"user_actor"`.
737804 
738 - `"user_actor"`
739 
740805 - `user_id: string`
741806 
742807 Tagged user ID.
from line 832
767832 
768833 Currency code for the cost amount. Currently always `"USD"`.
769834 
770 - `"USD"`
835 default: USD
771836 
772837 - `ending_at: string or null`
773838 
774839 End of the row's UTC time bucket (exclusive), as an RFC 3339 timestamp; equal to `starting_at` plus one `bucket_width`. Null unless `bucket_width` is set.
775840 
841 format: date-time
842 
776843 - `inference_geo: "global" or "us" or null`
777844 
778845 Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).
from line 884
817884 
818885 Start of the row's UTC time bucket (inclusive), as an RFC 3339 timestamp. Null unless `bucket_width` is set; without `bucket_width`, each row aggregates the full requested range.
819886 
887 format: date-time
888 
820889 - `token_type: "cache_creation.ephemeral_1h_input_tokens" or "cache_creation.ephemeral_5m_input_tokens" or "cache_read_input_tokens" or 2 more or null`
821890 
822891 Token type when cost_type=tokens; null otherwise.
from line 903
834903 - `data_refreshed_at: string or null`
835904 
836905 RFC 3339 timestamp of the export this response was served from. Null when no export yet covers any part of the requested range, in which case `data` is empty. Data beyond this watermark is incomplete; for stable results, set `ending_at` to this value or earlier. Data is typically refreshed every 4 hours but not final until about 30 days after the usage date (late-arriving events, reconciliation adjustments).
906 
907 format: date-time
837908 
838909 - `has_more: boolean`
839910 
Feedback