Learning resourcesReviewed · Anthropic

Claude Usage and Cost Analytics API documentation

Anthropic's Usage and Cost Analytics API documentation is for administrators, finance teams and developers who track historical Claude organization usage and spending. It documents a beta API with two endpoints that report token usage and cost for Claude Console and Claude Enterprise organizations. There are three main catches. First, the API isn't available to claude.ai Team plan organizations or to individual Console accounts, although a company on the Team plan that also has a Claude Console organization can use it through that organization. Second, each organization type needs its own kind of credential. Third, data typically refreshes within four hours and can take up to 24 hours. The page covers grouping and filtering, date limits, data freshness, migration from older reports, and code samples in several languages.

Researched 15 Nov 2026

In short.

Anthropic's Usage and Cost Analytics API documentation is for administrators, finance teams and developers who track historical Claude organization usage and spending. It describes a beta API for Claude Console and Claude Enterprise organizations. The main catches are about access, credentials and timing. The API isn't available to claude.ai Team plan organizations, though a company that also has a Claude Console organization can use it through that organization. It also isn't available to individual Console accounts until they set up an organization. Each organization type uses its own credential: Console organizations use Admin API credentials, Enterprise organizations use read:analytics keys, and the AWS and Google Cloud versions use their own cloud sign-in and IAM permissions. Data typically refreshes within four hours of the underlying usage and can take up to 24 hours. Technically, the page describes two GET endpoints, /v1/organizations/analytics/usage and /v1/organizations/analytics/cost. They return ranked rows grouped by up to five dimensions, such as model, workspace, API key and actor. On the cost endpoint, the extra cost_type and token_type dimensions don't count toward that limit, and limit doesn't apply to them, so a page of cost rows can hold more rows than limit. Rows can be split into optional 1-minute, 1-hour or 1-day UTC buckets, filtered, paged with a cursor and stamped with a data_refreshed_at time. The page also has migration tables for teams moving from the legacy Usage and Cost API or the Claude Enterprise report endpoints. Its examples are illustrative and the live API's behaviour is unverified. All behaviour described is the documentation's own account.

Researched and written by an AI model and checked by a second AI model. How it works

The source is the complete Usage and Cost Analytics API documentation page at [https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api.md]. Pages it links to are separate documents and are excluded: the API reference, the Admin API key instructions, the authentication and key-expiration pages, the Workload Identity Federation pages, the legacy Usage and Cost API, the Enterprise Analytics API, the Claude Code Analytics API, the cloud-platform pages and Pricing. Claims that depend on them remain unknown. The page's request and response examples are illustrative, and the live behaviour of the API, SDKs and CLI is unverified. All behaviour described is the documentation's own account. The page shows no licence text or reuse terms.

The overview

What this resource is

This resource is a single documentation page titled Usage and Cost Analytics API, on Anthropic's platform documentation site at [https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api]. The page describes an API. It is not a software package, a model or a tool you install. The API reports historical token usage and cost for a Claude Console or Claude Enterprise organization.

The API has two endpoints. GET /v1/organizations/analytics/usage reports token counts and request counts. GET /v1/organizations/analytics/cost reports cost in USD. The page says the API is in beta and that every request must send the header anthropic-beta: analytics-usage-cost-2026-08-24 together with an anthropic-version header. The official SDKs and the ant command-line tool send both headers automatically.

The page says that for Claude Console organizations the data is similar to what the Usage and Cost pages of the Claude Console show.

Overall assessment

As documentation, the page is detailed and specific. It gives documented request examples in cURL, the ant CLI, Python, TypeScript, C#, Go, Java, PHP and Ruby. It shows an example response shape and explains how rows, grouping, filtering, ordering and time buckets interact. It states limits plainly: a 31-day maximum span, a 24-hour maximum for per-minute buckets, and data that can lag by up to 24 hours. It also includes two migration tables, so teams on older reporting endpoints can see what changes.

The main reservation is that the API is labelled beta, and the page does not say whether or how its behaviour, header value or field names may change. The page also leaves some detail to linked pages. For example, it says the API reference lists every dimension, filter and value. The page gives no pricing for calling the endpoints themselves. Everything the page says about behaviour is Anthropic's own description, and how the live API behaves against that description is unverified.

Who it is for

The page is aimed at people who need to see who or what is using tokens and money in a Claude Console or Claude Enterprise organization. Its own list of uses is: attribute spend by workspace, API key, model, service tier or identity; find top consumers; build daily, hourly or per-minute time series for dashboards and finance reports; and use one integration for both Claude Console and Claude Enterprise organizations.

It suits developers who write scripts or services that collect usage data, and finance or platform teams who feed that data into reports. It also suits teams already using the legacy Usage and Cost API or the Claude Enterprise report endpoints, because the page includes migration guidance for them.

Organizations on the claude.ai Team plan and individual Claude Console accounts cannot use it as they are. The page states that the Admin API is not available to them. A company on the Team plan that also has a Claude Console organization can use the API with that organization. An individual Console account must first set up an organization. A beginner can follow the quick start but needs to understand API keys, HTTP headers and query parameters. They also need the credential that fits their organization. For a Console organization, that is an Admin API credential. For an Enterprise organization, it is a read:analytics key created by the primary owner. On the AWS and Google Cloud versions described on the page, it is the cloud provider's sign-in with the right IAM permissions.

What the API can do

Usage rows carry these metrics: uncached_input_tokens, cache_creation (split into ephemeral_5m_input_tokens and ephemeral_1h_input_tokens), cache_read_input_tokens, output_tokens, total_tokens, server_tool_use.web_search_requests, and requests. The usage endpoint can order by total_tokens (default), output_tokens, uncached_input_tokens, requests or time.

Cost rows carry a cost object with amount (after discounts, before credits), list_amount (at list prices), currency (always USD) and requests. The cost endpoint orders by amount (default), list_amount or time. It has two extra grouping dimensions, cost_type and token_type. The page's example shows cost types of tokens, web_search, code_execution and session_usage, with five token-type rows per model. It names only cache_read_input_tokens as a token type.

Grouping through group_by[] accepts up to five dimensions. On the cost endpoint, cost_type and token_type don't count toward that limit. The limit parameter doesn't apply to them either, so grouping by them can put more rows on a page than the limit value. The example response lists these dimensions: product, model, context_window, inference_geo, speed, slack_channel_id, claude_tag_category, claude_tag_user_id, rbac_group_id, workspace_id, service_tier, user_profile_id, agent_id, environment_id, deployment_id, session_id, actor, actor_type and api_key_id. Most dimensions have a matching list filter such as models[]. Each filter takes up to 100 values. Values within one filter combine with OR, and different filters combine with AND.

The actor dimension attributes a request to a user, a service account, a federated cloud identity (an AWS or Google Cloud principal), or the API key itself. Usage that cannot be attributed has actor: null. The page also says that products[]=claude_code with group_by[]=actor gives per-user Claude Code cost. The page says the usage and cost API reference lists every dimension, filter and value. That reference is a separate page, so the dimensions named on this page may not be the full set.

Using it

Requirements

Claude Console organizations authenticate with an Admin API key or another Admin API credential, such as an OAuth token with the org:admin scope. An OAuth token goes in an authorization: Bearer header instead of x-api-key. Claude Enterprise organizations use a key with the read:analytics scope. The primary owner creates it in claude.ai after the Analytics API is enabled for the organization.

The page says the Admin API is not available to organizations on the claude.ai Team plan or to individual Console accounts. A company on the Team plan that also has a Claude Console organization can use the API with that organization. An individual Console account must first set up an organization on the Organization page in the Claude Console.

Two cloud versions are described. For Claude Platform on AWS, requests use the Claude Platform on AWS base URL and authentication. AWS IAM authorizes them through the ListAccountUsage and ListAccountCost actions, and each request covers only the workspaces in the region of the endpoint called. For Claude Models on Google Cloud (Anthropic managed), requests go to the organization-level base URL with Google Cloud credentials. They need the usageAnalytics.list permission for usage and costAnalytics.list for cost.

Every request needs the beta header and an anthropic-version header. The examples read a key from the ANTHROPIC_API_KEY environment variable. To use an SDK or the command line, you need the matching client library or the ant CLI. The page does not give install steps or version numbers for them. Some snippets include their import lines, such as the C# and Java examples. Others leave out imports or the surrounding setup.

How it works

Each response is a list of rows. Every row has starting_at and ending_at, a group object holding every dimension, and a usage or cost object holding the metrics. A dimension in group is null unless you list it in group_by[]. group_by[] takes up to five dimensions, but on the cost endpoint cost_type and token_type don't count toward that limit. Each combination of the grouped dimensions that has data appears exactly once across the pages of a query. With no group_by[] and no time_bucket_width, the response is one row that totals the whole range.

Setting time_bucket_width to 1m, 1h or 1d splits each combination into UTC buckets. Buckets with no data produce no rows, so a time series has to fill gaps with zeros. By default rows are ranked by the order_by metric across the whole range, largest first. For a time series, set time_bucket_width and order_by=time. The limit parameter sets the page size, from 1 to 1,000 rows with a default of 20. That is not an absolute cap on cost rows: on the cost endpoint, limit doesn't apply to cost_type and token_type, so grouping by them can return more rows on a page than limit. The response carries has_more and next_page, and the SDKs and ant fetch later pages for you.

Data freshness is shown by data_refreshed_at. It is identical across all pages of one query, because they read the same snapshot. The page does not document the internal data pipeline. It states only the refresh behaviour.

Setup steps the page describes

First, get the credential that matches your organization type. A Console organization can create an Admin API key (the page links to separate instructions for this). It can also use another Admin API credential, such as an OAuth token with the org:admin scope, or a Workload Identity Federation rule with the org:admin scope. An Enterprise organization uses a read:analytics key. The primary owner creates it in claude.ai after the Analytics API is enabled for the organization; the page does not say who enables it. On Claude Platform on AWS and Claude Models on Google Cloud (Anthropic managed), requests use that platform's authentication and IAM permissions instead of an Admin API key. An individual Console account must first set up an organization on the Organization page at [https://platform.claude.com/settings/organization].

Second, if you use a key, put it in the ANTHROPIC_API_KEY environment variable, as the key-based examples assume. If you use an OAuth token, send it in an authorization: Bearer header instead of the x-api-key header. Third, send a request with the beta header and an anthropic-version header, or use an SDK or the ant CLI, which add them for you. The quick start asks for one week of daily usage grouped by model with limit=10.

If you call these endpoints with an Admin API key, the page advises giving the service that collects the data its own key, storing it in a secrets manager and rotating it regularly; setting a key expiration when you create the key enforces the rotation. Where you can, it recommends using a Workload Identity Federation rule with the org:admin scope instead of that Admin API key, so the service gets short-lived tokens and there is no long-lived key to leak. The page gives this advice for Admin API keys and does not extend it to Enterprise read:analytics keys or to the AWS and Google Cloud authentication. For integrations it also suggests setting a User-Agent header. Its example value is YourApp/1.0.0 followed by the app's web address, [https://yourapp.com], in parentheses. The page does not say how long setup takes.

Worked example from the page

The quick start requests daily token usage for the first week of September 2026, grouped by model, 10 rows per page. In cURL it is a GET to [https://api.anthropic.com/v1/organizations/analytics/usage] with the query parameters starting_at=2026-09-01T00:00:00Z, ending_at=2026-09-08T00:00:00Z, time_bucket_width=1d, group_by[]=model and limit=10. The headers are anthropic-version, anthropic-beta: analytics-usage-cost-2026-08-24 and x-api-key.

The sample response has one row for a model called claude-sonnet-5 on 3 September. It shows 1,284,500 uncached input tokens, 215,300 five-minute cache-creation tokens, 3,200,000 cache-read tokens, 891,000 output tokens, 5,590,800 total tokens, 12 web search requests and 4,210 requests. It also shows has_more: true, a next_page cursor and data_refreshed_at. These numbers are illustrative sample data from the documentation, not measurements.

A cost example groups by model, cost_type and token_type for a month. Its sample row shows amount "41280.000000" and list_amount "51600.000000". The page says amounts are decimal strings in cents with six decimal places, so "41280.000000" is $412.80 USD. When grouping by cost_type or token_type, requests is null on every row. Other examples cover a week of usage for one workspace and API key split by service tier, ranking actors by request count, and per-user cost split by product. The FAQ gives the query for per-user Claude Code cost.

These examples are illustrative, and how they behave against the live API is unverified.

Assessment & evidence

Limitations and cautions

The API is in beta, and the page says nothing about stability guarantees or a deprecation policy for the beta header.

Data is not real-time. It typically refreshes within 4 hours and can take up to 24 hours. The page contrasts this with the legacy Usage and Cost API, whose data typically appears within 5 minutes. Values can be revised as late events arrive, until about 7 days after the end of the calendar month, so figures for the current month can still change. For final totals, the page advises querying only months that ended at least 7 days ago.

Range limits: starting_at must be on or after 1 January 2026 and within the last 365 days. A request can span at most 31 days, and per-minute buckets at most 24 hours. ending_at is required whenever time_bucket_width is set. Both ends are rounded down to a UTC bucket boundary, or to the hour when no bucket width is set. Longer reports must be split into several requests.

Coverage varies by organization type. Some dimensions apply only to Console organizations (api_key_id) or only to Enterprise organizations (slack_channel_id). A dimension that does not apply is null on every row and its filter matches nothing. The exception is rbac_group_id, which returns an error when teams are not available. On Claude Platform on AWS, each request covers only one region's workspaces, and user_profile_id, claude_tag_category, claude_tag_user_id and the Managed Agents dimensions are null on every row. An unknown or misspelled model, API key or workspace value matches nothing instead of returning an error, so a typo can look like an empty result. Some Claude Managed Agents usage is attributed to an Anthropic-managed service account that is not listed with the service accounts you create, and its api_key_id is null. The live API's behaviour is unverified.

Reasoning behind the assessment

The page is concrete about request shape, response shape, limits and migration differences, so anyone with credentials can check its claims against the API. It names specific parameter limits. group_by[] takes up to five dimensions, not counting the cost endpoint's cost_type and token_type. Filters take up to 100 values. Pages hold 1 to 1,000 rows, though cost_type and token_type grouping can return more rows than limit. It also gives date constraints, scopes and IAM permissions. These are the details a developer needs to decide whether the API fits.

The migration tables compare the new API with two earlier report families. They show it is meant to replace the legacy Usage and Cost API for Console organizations. For Enterprise, the legacy report endpoints remain supported. The page says the new API gives every group in every time bucket instead of the top 100 groups per bucket that usage_report and cost_report return. It also allows grouping by actor or actor_type with other dimensions, and ranks rows by the endpoint's supported order_by metrics or by time bucket. This is the page's own positioning and has not been independently verified.

The page leaves some detail to linked pages, such as the API reference, the Admin API key instructions and the Pricing page. Claims that depend on them remain unknown. The sample values and dates in the examples come from the documentation, so they should not be read as real measurements.

Alternatives and related options

The page itself names several related options. The Claude Console Usage and Cost pages show similar data in a web interface, with no code needed. The legacy Usage and Cost API (/v1/organizations/usage_report/messages and /v1/organizations/cost_report) returns time buckets. According to the page's table, its data typically appears within 5 minutes, faster than the new API's typical 4-hour refresh. However, it has no request counts and leaves code execution out of the usage report. It also groups by account_id or service_account_id rather than the newer actor dimension.

For Enterprise organizations, the legacy report endpoints usage_report, cost_report, user_usage_report and user_cost_report remain supported. Of these, usage_report and cost_report return at most the top 100 groups in each time bucket, while user_usage_report and user_cost_report return one row per user. The Claude Code Analytics API reports per-user Claude Code activity and estimated cost for Console organizations. The page also links to an Analytics APIs overview that explains which analytics API and key type an organization needs.

The page does not mention third-party monitoring or billing tools, so how they compare is unknown.

Evidence base

The Usage and Cost Analytics API page is a single documentation page from Anthropic. It includes an introduction, authentication notes, notes on the AWS and Google Cloud versions, a quick start, sections on the usage and cost endpoints, rules for date ranges and data freshness, two migration sections and a short FAQ.

The page is vendor documentation. Its request and response examples are illustrative, and the live API's behaviour is unverified. The page includes no changelog, benchmarks or independent reviews, so statements about behaviour are Anthropic's own account. Linked references such as the API reference, the Admin API key instructions and the Pricing page are separate documents, and what they say is not established by this page.

Access & freshness

Costs

The page does not state any charge for calling the usage or cost endpoints, and it does not state a rate limit for Console organizations. The cost of querying is therefore unknown. For Claude Enterprise, the migration section says an organization-level rate limit carries over from the Enterprise Analytics API. The page links to that API's documentation for details, and the limit itself is not stated on this page.

The API reports what Claude usage costs. It does not set prices. The page links to a separate Pricing page and does not list token prices itself. Two details affect how to read the cost data. First, amount is after discounts and before any credits are applied, and list_amount is at list prices. Second, requests served under a Priority Tier commitment show service_tier: priority on the usage endpoint but add zero token cost to amount and list_amount. The commitment fee is billed separately and is not in this data. Web search on those requests is billed at the standard rate, and requests beyond committed capacity are priced at the standard tier. Totals from this API may therefore not match a full invoice.

The page does not mention indirect costs such as engineering time, key management or storing the results. Those are unknown.

Rights and licence

The page shows no licence, copyright notice or reuse terms for its documentation text or code samples. Whether you may copy, adapt or redistribute the documentation and its examples is therefore unknown.

The page does not identify the service terms that apply to using the API, so what those terms permit is unknown. Access depends on having the credential that matches the organization type: Admin API credentials for Console organizations, read:analytics keys for Enterprise organizations, and cloud authentication with IAM permissions on the AWS and Google Cloud versions, as described under requirements. The page offers no downloadable package.

Freshness and change risk

As of 15 November 2026, the page shows no publication or last-updated date. It does contain several dates. These include the beta header value analytics-usage-cost-2026-08-24 and the anthropic-version value 2026-10-21 used in the examples. There are also example date ranges and timestamps in September and October 2026, a sample data_refreshed_at of 18 September 2026, and the rule that starting_at must be on or after 1 January 2026. None of these establishes when the page was published or last updated.

The API is labelled beta, and the page does not say whether or when the header, field names or limits may change, or what stability guarantees apply. It is sensible to check the live page and the API reference before building on it. The page's own text also affects how current any report built from it can be. Data typically refreshes within 4 hours of the underlying usage, can take up to 24 hours, and can be revised until about 7 days after the end of the calendar month.

Suggested next steps

Before building on this API, confirm that your organization is eligible. It must be a Claude Console or Claude Enterprise organization. A company on the claude.ai Team plan can use a separate Claude Console organization if it has one, and an individual Console account must first set up an organization. Then confirm you can get the credential your organization type needs. A Console organization needs an Admin API credential, such as an Admin API key or an org:admin OAuth token sent as a Bearer token. An Enterprise organization needs a read:analytics key created by the primary owner after the Analytics API is enabled. On Claude Platform on AWS or Claude Models on Google Cloud, you need the cloud provider's authentication and the listed IAM permissions. Check the live API reference for the full list of dimensions, filters and values, because the page leaves that list to it.

If data that typically refreshes within 4 hours, and sometimes takes up to 24, is acceptable, try the quick start request with a small range and a limit of 10. If you call the endpoints with an Admin API key, follow the page's advice for that key: give the collecting service its own key, store it in a secrets manager, rotate it regularly and set an expiration when you create it, or, where you can, use a Workload Identity Federation rule with the org:admin scope instead so there is no long-lived key to leak. The page attaches this advice to Admin API keys and gives no equivalent guidance for Enterprise read:analytics keys or cloud authentication. If you rely on the legacy Usage and Cost API or the Enterprise report endpoints, read the migration table before switching. It lists changes to the beta header, bucket parameter names, empty-bucket handling, pagination and the freshness delay.

For finance reporting, query months that ended at least 7 days ago, and remember that the cost data excludes Priority Tier commitment fees and is calculated before credits are applied. The live API's behaviour is unverified, so treat the page's examples as illustrations.

Evidence for this report

selected-page.txtselected · checked 2026-11-15