Claude Platform Docs
AdminMonitoring

Usage and Cost API

The legacy Admin API usage and cost report endpoints for Claude Console organizations. For new integrations, use the Usage and Cost Analytics API.

If your company has a Claude Console organization, you can use the Admin API with that organization; see the Admin API keys and tokens page. An individual Console account must first set up an organization on the Organization settings page (platform.claude.com/settings/organization) in the Claude Console.

The Usage and Cost API provides programmatic and granular access to historical API usage and cost data for your organization. This data is similar to what the Claude Console shows on the Usage page (platform.claude.com/usage) and the Cost page (platform.claude.com/cost).

This API allows you to better monitor, analyze, and optimize your Claude implementations:

  • Accurate usage tracking: Get precise token counts and usage patterns instead of relying solely on response token counting
  • Cost reconciliation: Match internal records with Anthropic billing for finance and accounting teams
  • Product performance and improvement: Monitor product performance while measuring if changes to the system have improved it, or set up alerting
  • Rate limit optimization: Optimize features such as prompt caching or specific prompts to use your allocated capacity efficiently
  • Advanced analysis: Perform deeper data analysis than what’s available in Console

Authenticate with an Admin API key or an OAuth token with the org:admin scope. You can also use a personal or service account key scoped to the organization. A personal or service account key has the permissions of its user or service account. Keys scoped to a single workspace, including workspace keys, don’t work. See the Admin API page’s Authentication section.

These endpoints are not available to Claude Enterprise organizations, which use an Analytics API key with the Usage and Cost Analytics API.

Claude Platform on AWS: Use the Usage and Cost Analytics API instead of the Usage and Cost API.

Claude Models on Google Cloud (Anthropic managed): Of the Usage and Cost API endpoints, only the usage endpoint is available. Call it through the organization-level base URL with Google Cloud credentials instead of an Admin API key. The only predefined IAM role that allows this call is roles/claude.admin. For cost data, use the Usage and Cost Analytics API or the Cost page in the Claude Console.

Which API do you need?

The APIs you can call, and the key each one takes, depend on which Claude product your organization uses:

APIClaude Console (Claude Platform)Claude Enterprise (claude.ai)
Usage and Cost Analytics API (recommended)Admin API key (sk-ant-admin01-...) or another Admin API credentialAnalytics API key
Usage and Cost API (legacy), which this page documentsAdmin API key or another Admin API credentialNot available
Claude Enterprise Analytics API cost and usage endpoints (legacy)Not availableAnalytics API key

Claude Enterprise parent organizations do not appear in Claude Console and carry no Admin API keys, so for them the Analytics API key is the only path to this data. See Analytics APIs for how to create each key type and which plans the Claude Enterprise cost data applies to.

Partner solutions

Leading observability platforms offer ready-to-use integrations for monitoring your Claude API usage and cost, without writing custom code. These integrations provide dashboards, alerting, and analytics to help you manage your API usage effectively.

Cloud intelligence platform for tracking and forecasting costs

LLM Observability with automatic tracing and monitoring

Agentless integration for easy LLM observability with out-of-the-box dashboards and alerts

FinOps platform for cloud and AI cost management

Advanced querying and visualization through OpenTelemetry

Usage and cost attribution to Jira work items

FinOps platform for LLM cost & usage observability

Quick start

Get your organization’s daily usage for the last 7 days:

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2025-01-08T00:00:00Z&\
ending_at=2025-01-15T00:00:00Z&\
bucket_width=1d" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Usage API

Track token consumption across your organization with detailed breakdowns by model, workspace, and service tier with the /v1/organizations/usage_report/messages endpoint.

Key concepts

  • Time buckets: Aggregate usage data in fixed intervals (1m, 1h, or 1d).
  • Token tracking: Measure uncached input, cached input, cache creation, and output tokens.
  • Filtering & grouping: Filter by API key, workspace, model, service tier, context window, data residency, or speed, and group results by these dimensions.
  • Server tool usage: Track usage of server-side tools such as web search.

For complete parameter details and response schemas, see the Usage API referencePreview with links to the API reference available — press Tab until focus enters the card, Escape to return..

Basic examples

Daily usage by model

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2025-01-01T00:00:00Z&\
ending_at=2025-01-08T00:00:00Z&\
group_by[]=model&\
bucket_width=1d" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Hourly usage with filtering

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2025-01-15T00:00:00Z&\
ending_at=2025-01-15T23:59:59Z&\
models[]=claude-opus-5-5&\
service_tiers[]=batch&\
context_window[]=0-200k&\
bucket_width=1h" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Filter usage by API keys and workspaces

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2025-01-01T00:00:00Z&\
ending_at=2025-01-08T00:00:00Z&\
api_key_ids[]=apikey_01Rj2N8SVvo6BePZj99NhmiT&\
api_key_ids[]=apikey_01ABC123DEF456GHI789JKL&\
workspace_ids[]=wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ&\
workspace_ids[]=wrkspc_01XYZ789ABC123DEF456MNO&\
bucket_width=1d" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Data residency

Track your data residency controls by grouping and filtering usage with the inference_geo dimension. This is useful for verifying geographic routing across your organization.

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2026-02-01T00:00:00Z&\
ending_at=2026-02-08T00:00:00Z&\
group_by[]=inference_geo&\
group_by[]=model&\
bucket_width=1d" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

You can also filter to a specific geo. Valid values are global, us, and not_available:

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2026-02-01T00:00:00Z&\
ending_at=2026-02-08T00:00:00Z&\
inference_geos[]=us&\
group_by[]=model&\
bucket_width=1d" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Fast mode

Track fast mode usage by grouping and filtering with the speed dimension. This is useful for monitoring standard versus fast mode usage.

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2026-02-01T00:00:00Z&\
ending_at=2026-02-08T00:00:00Z&\
group_by[]=speed&\
group_by[]=model&\
bucket_width=1d" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

You can also filter to a specific speed. Valid values are standard and fast:

cURL
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2026-02-01T00:00:00Z&\
ending_at=2026-02-08T00:00:00Z&\
speeds[]=fast&\
group_by[]=model&\
bucket_width=1d" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Time granularity limits

GranularityDefault limitMaximum limitUse case
1m60 buckets1,440 bucketsMinute-level analysis
1h24 buckets168 bucketsDaily patterns
1d7 buckets31 bucketsWeekly/monthly reports

Cost API

Retrieve service-level cost breakdowns in USD with the /v1/organizations/cost_report endpoint.

Key concepts

  • Currency: All costs are in USD, reported as decimal strings in lowest units (cents).
  • Cost types: Track token usage, web search, and code execution costs.
  • Grouping: Group costs by workspace or description for detailed breakdowns. When grouping by description, responses include parsed fields such as model and inference_geo.
  • Time buckets: Only daily granularity (1d) is available.

For complete parameter details and response schemas, see the Cost API referencePreview with links to the API reference available — press Tab until focus enters the card, Escape to return..

Basic example

cURL
curl "https://api.anthropic.com/v1/organizations/cost_report?\
starting_at=2025-01-01T00:00:00Z&\
ending_at=2025-01-31T00:00:00Z&\
group_by[]=workspace_id&\
group_by[]=description" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Pagination

Both endpoints support pagination for large datasets:

  1. Make your initial request.
  2. If has_more is true, use the next_page value in your next request.
  3. Continue until has_more is false.
cURL
# First request
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2025-01-01T00:00:00Z&\
ending_at=2025-01-31T00:00:00Z&\
limit=7" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

# Response includes: "has_more": true, "next_page": "page_xyz..."

# Next request with pagination
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2025-01-01T00:00:00Z&\
ending_at=2025-01-31T00:00:00Z&\
limit=7&\
page=page_xyz..." \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Common use cases

Explore detailed implementations in the Claude Cookbook:

  • Daily usage reports: Track token consumption trends
  • Cost attribution: Allocate expenses by workspace for chargebacks
  • Cache efficiency: Measure and optimize prompt caching
  • Budget monitoring: Set up alerts for spending thresholds
  • CSV export: Generate reports for finance teams

Frequently asked questions

How fresh is the data?

Usage data typically appears within about 30 minutes after an API request completes, though delays can be longer. The API returns a time bucket only after it ends, so results leave out the current UTC minute, hour, or day. A bucket that ended in the last 30 minutes or so can be incomplete or empty until its usage arrives.

Cost data is daily, so each UTC day appears only after it ends, and the most recent day can be incomplete.

The API supports polling once per minute for sustained use. For short bursts (for example, downloading paginated data), more frequent polling is acceptable. Cache results for dashboards that need frequent updates.

How do I track code execution usage?

Code execution costs appear in the cost endpoint grouped under Code Execution Usage in the description field. Code execution is not included in the usage endpoint.

How do I track Priority Tier usage?

Filter or group by service_tier in the usage endpoint and look for the priority value. Priority Tier costs are not available in the cost endpoint.

What happens with playground usage?

API usage from playground in the Claude Console (and from the legacy Anthropic Workbench before it) is not associated with an API key, so api_key_id is null even when grouping by that dimension.

Why does the usage report show a service account that I didn’t create?

Usage from some Claude Managed Agents sessions is reported under an Anthropic-managed service account (svac_...). It isn’t listed with the service accounts that you create. See Find session usage across your organization.

How is the default workspace represented?

Usage and costs attributed to the default workspace have a null value for workspace_id.

How do I get per-user cost breakdowns for Claude Code?

Call the cost endpoint of the Usage and Cost Analytics API with products[]=claude_code&group_by[]=actor. For cost by API key, group by api_key_id instead. For details, see How do I get per-user cost for Claude Code? on the Usage and Cost Analytics API page. The Claude Code Analytics API also provides per-user estimated costs and productivity metrics.

See also

Use the Usage and Cost APIs to deliver a better experience for your users, manage costs, and preserve your rate limit. Learn more about some of these other features:

Was this page helpful?