Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

usage-cost-analytics-api changedmanage-claude/usage-cost-analytics-api

Nearest release: v2.1.330, published under an hour before 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+25added
Lines−25removed
From line 801 where the diff opens
First seen 29 Oct 2026 this site's first read of the page
Recorded edits6to this page, all time

The whole hunk

from line 801, old and new numbered
/
lines
from line 801
801801 
802802This section is for organizations that call the legacy [Usage and Cost API](https://platform.claude.com/docs/en/manage-claude/usage-cost-api) (`/v1/organizations/usage_report/messages` and `/v1/organizations/cost_report`). Your credential and the `anthropic-version` header carry over. So do the names `starting_at` and `ending_at`, the `[]` suffix on array parameters, the pagination field names, and the token and cost field names. The usage endpoint’s bucket widths (`1m`, `1h`, `1d`) carry over too. The following table lists what changes:
803803 
804| Usage and Cost API | Usage and Cost Analytics API |
805| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
806| No beta header | `anthropic-beta: analytics-usage-cost-2026-08-24` on every request |
807| Data typically appears within 5 minutes | Data typically refreshes within 4 hours and can take up to 24 hours (see [Data freshness](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#data-freshness)) |
808| `data` is a list of time buckets, oldest first, including empty ones, each with a `results` list whose entries hold dimensions and metrics side by side | `data` is a list of rows ranked by `order_by`, each with its own `starting_at` and `ending_at`, dimensions in `group`, and metrics in `usage` or `cost`. Combinations with no usage or cost have no row. |
809| `bucket_width`, default `1d` | `time_bucket_width`, no default. Pass `time_bucket_width=1d` to keep daily rows; omit it for whole-range totals. The cost endpoint also accepts every filter and `1m` and `1h` buckets. |
810| `limit` counts time buckets per page | `limit` counts rows per page (1 to 1,000, default 20), so the number of pages depends on how many combinations have data |
811| Any date range, paged forward by bucket | `starting_at` on or after January 1, 2026, and within the last 365 days, at most 31 days per request, `ending_at` required with `time_bucket_width`, and at most 24 hours with `1m` buckets (see [Date ranges and time buckets](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#date-ranges-and-time-buckets)). Split longer ranges into several requests. |
812| `account_ids[]`, `service_account_ids[]`, `group_by[]=account_id`, `group_by[]=service_account_id` | `actor_ids[]` with the same tagged IDs, and `group_by[]=actor` or `actor_type`; read `actor.user_id` or `actor.service_account_id`. See [Actors](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#actors). |
813| `context_window[]` | `context_windows[]` |
814| `group_by[]=description` on the cost report, with a `description` string | No `description`. Group by the structured dimensions instead: any of `model`, `cost_type`, `token_type`, `context_window`, `service_tier`, `inference_geo`, and `speed`, all of which fit in one request. |
815| An unknown API key or workspace ID returns an error | It matches nothing, including a misspelled `models[]` name. Each list takes up to 100 values. |
816| `workspace_id: null` for the default workspace | The default workspace’s real `workspace_id` (see [How is the default workspace represented?](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#how-is-the-default-workspace-represented)) |
817| `inference_geo: "not_available"` and `service_tier: "standard"` on usage with no geo or tier | `null` for both. `inference_geos[]=not_available` still matches the rows with no inference geo. |
818| Cost `service_tier` is `standard` or `batch`; `amount` such as `"123.45"` | The actual tier; `amount` with six decimal places, such as `"123.450000"`, plus `list_amount`. |
819| Code execution not in the usage report; no request counts | Code execution appears as usage rows with `model: null`; adds `requests` on both endpoints and `total_tokens` on usage rows |
804| Usage and Cost API | Usage and Cost Analytics API |
805| ----- | ----- |
806| No beta header | `anthropic-beta: analytics-usage-cost-2026-08-24` on every request |
807| Data typically appears within 5 minutes | Data typically refreshes within 4 hours and can take up to 24 hours (see [Data freshness](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#data-freshness)) |
808| `data` is a list of time buckets, oldest first, including empty ones, each with a `results` list whose entries hold dimensions and metrics side by side | `data` is a list of rows ranked by `order_by`, each with its own `starting_at` and `ending_at`, dimensions in `group`, and metrics in `usage` or `cost`. Combinations with no usage or cost have no row. |
809| `bucket_width`, default `1d` | `time_bucket_width`, no default. Pass `time_bucket_width=1d` to keep daily rows; omit it for whole-range totals. The cost endpoint also accepts every filter and `1m` and `1h` buckets. |
810| `limit` counts time buckets per page | `limit` counts rows per page (1 to 1,000, default 20), so the number of pages depends on how many combinations have data |
811| Any date range, paged forward by bucket | `starting_at` on or after January 1, 2026, and within the last 365 days, at most 31 days per request, `ending_at` required with `time_bucket_width`, and at most 24 hours with `1m` buckets (see [Date ranges and time buckets](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#date-ranges-and-time-buckets)). Split longer ranges into several requests. |
812| `account_ids[]`, `service_account_ids[]`, `group_by[]=account_id`, `group_by[]=service_account_id` | `actor_ids[]` with the same tagged IDs, and `group_by[]=actor` or `actor_type`; read `actor.user_id` or `actor.service_account_id`. See [Actors](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#actors). |
813| `context_window[]` | `context_windows[]` |
814| `group_by[]=description` on the cost report, with a `description` string | No `description`. Group by the structured dimensions instead: any of `model`, `cost_type`, `token_type`, `context_window`, `service_tier`, `inference_geo`, and `speed`, all of which fit in one request. |
815| An unknown API key or workspace ID returns an error | It matches nothing, including a misspelled `models[]` name. Each list takes up to 100 values. |
816| `workspace_id: null` for the default workspace | The default workspace’s real `workspace_id` (see [How is the default workspace represented?](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api#how-is-the-default-workspace-represented)) |
817| `inference_geo: "not_available"` and `service_tier: "standard"` on usage with no geo or tier | `null` for both. `inference_geos[]=not_available` still matches the rows with no inference geo. |
818| Cost `service_tier` is `standard` or `batch`; `amount` such as `"123.45"` | The actual tier; `amount` with six decimal places, such as `"123.450000"`, plus `list_amount`. |
819| Code execution not in the usage report; no request counts | Code execution appears as usage rows with `model: null`; adds `requests` on both endpoints and `total_tokens` on usage rows |
820820 
821821Two things differ for a Claude Enterprise organization:
822822 
from line 1255
12551255 
12561256Your key, the earliest date, the 365-day lookback and 31-day span, the filter and dimension names and values (except `user_ids[]` and the Claude Tag product value), the user `actor` fields, the metric and amount fields, `data_refreshed_at`, the cursor rules, and the [organization-level rate limit](https://platform.claude.com/docs/en/manage-claude/analytics-api#working-with-the-api) carry over. The only new header is the `analytics-usage-cost-2026-08-24` beta header. What changes:
12571257 
1258| Claude Enterprise reports | Usage and Cost Analytics API |
1259| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1258| Claude Enterprise reports | Usage and Cost Analytics API |
1259| ----- | ----- |
12601260| `usage_report` and `cost_report` return time buckets, oldest first, including empty ones, each holding at most its top 100 groups; `bucket_width` defaults to `1d` and `limit` counts buckets | Rows covering every combination with data, ranked by `order_by`, each with its own `starting_at` and `ending_at`, dimensions in `group`, and metrics in `usage` or `cost`. `time_bucket_width` is optional and `limit` counts rows. |
1261| The time-bucket parameter is `bucket_width` | It is `time_bucket_width`, with the same values |
1262| On `usage_report` and `cost_report`, `ending_at` is optional with `bucket_width` and `1m` buckets can span up to 31 days | `ending_at` required with `time_bucket_width`; `1m` buckets span at most 24 hours per request |
1263| `user_usage_report` and `user_cost_report` return one row per user | `group_by[]=actor&actor_types[]=user_actor`. Without the filter you also get rows for non-user identities and an `actor: null` row for unattributed usage. |
1264| Claude Tag usage has `product: "claude-tag"` | `product: "claude_tag"`; `products[]` accepts either spelling |
1265| An unrecognized `models[]` name returns a 400 error | It matches nothing |
1266| `user_ids[]` | `actor_ids[]` with the same tagged `user_...` IDs |
1267| `exclude_deleted_users` on the per-user reports | Requires `group_by[]=actor`; without it, the request returns a 400 error. It drops only rows whose `actor` is a user with `deleted: true`; rows for other identities and rows with `actor: null` stay. |
1261| The time-bucket parameter is `bucket_width` | It is `time_bucket_width`, with the same values |
1262| On `usage_report` and `cost_report`, `ending_at` is optional with `bucket_width` and `1m` buckets can span up to 31 days | `ending_at` required with `time_bucket_width`; `1m` buckets span at most 24 hours per request |
1263| `user_usage_report` and `user_cost_report` return one row per user | `group_by[]=actor&actor_types[]=user_actor`. Without the filter you also get rows for non-user identities and an `actor: null` row for unattributed usage. |
1264| Claude Tag usage has `product: "claude-tag"` | `product: "claude_tag"`; `products[]` accepts either spelling |
1265| An unrecognized `models[]` name returns a 400 error | It matches nothing |
1266| `user_ids[]` | `actor_ids[]` with the same tagged `user_...` IDs |
1267| `exclude_deleted_users` on the per-user reports | Requires `group_by[]=actor`; without it, the request returns a 400 error. It drops only rows whose `actor` is a user with `deleted: true`; rows for other identities and rows with `actor: null` stay. |
12681268 
12691269Per-user cost for a month, before:
12701270 
Feedback