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

Get Per-User Cost changedapi/admin/analytics/cost/list_by_user

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+50added
Lines−21removed
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

# Get Per-User Cost ## Query parameters ## Returns ## Example ### Response (200) ## Get Per-User Cost ### Query Parameters ### Returns ### Example #### Response

The whole hunk

from line 1, old and new numbered
/
lines
from line 1
1---
2title: Get Per-User Cost
3url: https://platform.claude.com/docs/en/api/admin/analytics/cost/list_by_user
4---
1# Get Per-User Cost
52 
6## Get Per-User Cost
3**GET** `/v1/organizations/analytics/user_cost_report`
74 
8**get** `/v1/organizations/analytics/user_cost_report`
9 
105Get per-user cost in USD across a date range.
116 
127Returns one row per user, ranked by spend. Use this to see which users
from line 12
1712organizations on a Claude Enterprise plan. Requires an API key with the
1813`read:analytics` scope.
1914 
20### Query Parameters
15## Query parameters
2116 
2217- `starting_at: string`
2318 
2419 Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.
2520 
21 format: date-time
22 
2623- `bucket_width: optional "1d" or "1h" or "1m"`
2724 
2825 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 34
3734 
3835 Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.
3936 
37 maxItems: 100
38 
4039 - `"0-200k"`
4140 
4241 - `"200k-1M"`
from line 44
4544 
4645 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.
4746 
47 format: date-time
48 
4849- `exclude_deleted_users: optional boolean`
4950 
5051 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.
5152 
53 default: false
54 
5255- `group_by: optional array of "context_window" or "cost_type" or "inference_geo" or 6 more`
5356 
5457 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.
5558 
59 maxItems: 100
60 
5661 - `"context_window"`
5762 
5863 - `"cost_type"`
from line 80
7580 
7681 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.
7782 
83 maxItems: 100
84 
7885 - `"global"`
7986 
8087 - `"not_available"`
from line 92
8592 
8693 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.
8794 
95 default: 20, maximum: 1000, minimum: 1
96 
8897- `models: optional array of string`
8998 
9099 Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.
91100 
101 maxItems: 100
102 
92103- `order: optional "asc" or "desc"`
93104 
94105 Sort direction. Defaults to `desc`.
95106 
107 default: desc
108 
96109 - `"asc"`
97110 
98111 - `"desc"`
from line 114
101114 
102115 Metric to rank actors by. Defaults to `amount`.
103116 
117 default: amount
118 
104119 - `"amount"`
105120 
106121 - `"list_amount"`
from line 128
113128 
114129 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.
115130 
131 maxItems: 100
132 
116133- `rbac_group_ids: optional array of string`
117134 
118135 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.
119136 
137 maxItems: 100
138 
120139- `slack_channel_ids: optional array of string`
121140 
122141 Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.
123142 
143 maxItems: 100
144 
124145- `speeds: optional array of "fast" or "standard"`
125146 
126147 Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.
127148 
149 maxItems: 100
150 
128151 - `"fast"`
129152 
130153 - `"standard"`
from line 156
133156 
134157 Filter to specific users by tagged user ID.
135158 
136### Returns
159 maxItems: 100
137160 
138- `UserCost object { data, data_refreshed_at, has_more, 2 more }`
161## Returns
139162 
140 - `data: array of object { actor, amount, context_window, 13 more }`
163- `UserCost object`
141164 
165 - `data: array of object`
166 
142167 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.
143168 
144169 - `actor: AnalyticsUserActor`
from line 186
161186 
162187 Actor type. Always `"user_actor"`.
163188 
164 - `"user_actor"`
165 
166189 - `user_id: string`
167190 
168191 Tagged user ID.
from line 216
193216 
194217 Currency code for the cost amount. Currently always `"USD"`.
195218 
196 - `"USD"`
219 default: USD
197220 
198221 - `ending_at: string or null`
199222 
200223 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.
201224 
225 format: date-time
226 
202227 - `inference_geo: "global" or "us" or null`
203228 
204229 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 268
243268 
244269 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.
245270 
271 format: date-time
272 
246273 - `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`
247274 
248275 Token type when cost_type=tokens; null otherwise.
from line 288
261288 
262289 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).
263290 
291 format: date-time
292 
264293 - `has_more: boolean`
265294 
266295 Whether another page is available. When true, pass `next_page` as the `page` parameter to fetch it.
from line 302
273302 
274303 ID of the Organization.
275304 
276### Example
305## Example
277306 
278```http
307```bash
279308curl https://api.anthropic.com/v1/organizations/analytics/user_cost_report \
280309 -H 'anthropic-version: 2023-06-01' \
281310 -H "X-Api-Key: $ANTHROPIC_ADMIN_API_KEY"
282311```
283312 
284#### Response
313### Response (200)
285314 
286315```json
287316{
Feedback