Usage Report
Get Messages Usage Report
Get Claude Code Usage Report
ModelsExpand Collapse
ClaudeCodeUsageReport = object { data, has_more, next_page }
data: array of object { actor, core_metrics, customer_type, 6 more } List of Claude Code usage records for the requested date.
List of Claude Code usage records for the requested date.
actor: object { email_address, type } or object { api_key_name, type } The user or API key that performed the Claude Code actions.
The user or API key that performed the Claude Code actions.
UserActor = object { email_address, type }
Email address of the user who performed Claude Code actions.
APIActor = object { api_key_name, type }
Name of the API key used to perform Claude Code actions.
core_metrics: object { commits_by_claude_code, lines_of_code, num_sessions, pull_requests_by_claude_code } Core productivity metrics measuring Claude Code usage and impact.
Core productivity metrics measuring Claude Code usage and impact.
Number of git commits created through Claude Code's commit functionality.
lines_of_code: object { added, removed } Statistics on code changes made through Claude Code.
Statistics on code changes made through Claude Code.
Total number of lines of code added across all files by Claude Code.
Total number of lines of code removed across all files by Claude Code.
Number of distinct Claude Code sessions initiated by this actor.
Number of pull requests created through Claude Code's PR functionality.
customer_type: "api" or "subscription"Type of customer account (api for API customers, subscription for Pro/Team customers).
Type of customer account (api for API customers, subscription for Pro/Team customers).
UTC date for the usage metrics in YYYY-MM-DD format.
model_breakdown: array of object { estimated_cost, model, tokens } Token usage and cost breakdown by AI model used.
Token usage and cost breakdown by AI model used.
estimated_cost: object { amount, currency } Estimated cost for using this model
Estimated cost for using this model
Estimated cost amount in minor currency units (e.g., cents for USD).
Currency code for the estimated cost (e.g., 'USD').
Name of the AI model used for Claude Code interactions.
tokens: object { cache_creation, cache_read, input, output } Token usage breakdown for this model
Token usage breakdown for this model
Number of cache creation tokens consumed by this model.
Number of cache read tokens consumed by this model.
Number of input tokens consumed by this model.
Number of output tokens generated by this model.
ID of the organization that owns the Claude Code usage.
Type of terminal or environment where Claude Code was used.
tool_actions: map[object { accepted, rejected } ]Breakdown of tool action acceptance and rejection rates by tool type.
Breakdown of tool action acceptance and rejection rates by tool type.
Number of tool action proposals that the user accepted.
Number of tool action proposals that the user rejected.
subscription_type: optional "enterprise" or "team"Subscription tier for subscription customers. null for API customers.
Subscription tier for subscription customers. null for API customers.
True if there are more records available beyond the current page.
Opaque cursor token for fetching the next page of results, or null if no more pages are available.
MessagesUsageReport = object { data, has_more, next_page }
data: array of object { ending_at, results, starting_at }
End of the time bucket (exclusive) in RFC 3339 format.
results: array of object { api_key_id, cache_creation, cache_read_input_tokens, 9 more } List of usage items for this time bucket. There may be multiple items if one or more group_by[] parameters are specified.
List of usage items for this time bucket. There may be multiple items if one or more group_by[] parameters are specified.
ID of the API key used. null if not grouping by API key or for usage in the Anthropic Console.
cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } The number of input tokens for cache creation.
The number of input tokens for cache creation.
The number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 5 minute cache entry.
The number of input tokens read from the cache.
context_window: "0-200k" or "200k-1M"Context window used. null if not grouping by context window.
Context window used. null if not grouping by context window.
Inference geo used matching requests' inference_geo parameter if set, otherwise the workspace's default_inference_geo.
For models that do not support specifying inference_geo the value is "not_available". Always null if not grouping by inference geo.
Model used. null if not grouping by model.
The number of output tokens generated.
server_tool_use: object { web_search_requests } Server-side tool usage metrics.
Server-side tool usage metrics.
The number of web search requests made.
service_tier: "standard" or "batch" or "priority" or 3 moreService tier used. null if not grouping by service tier.
Service tier used. null if not grouping by service tier.
speed: "standard" or "fast"Speed of the usage (research preview). null if not grouping by speed.
Only returned when the fast-mode-2026-02-01 beta header is provided.
Speed of the usage (research preview). null if not grouping by speed.
Only returned when the fast-mode-2026-02-01 beta header is provided.
The number of uncached input tokens processed.
ID of the Workspace used. null if not grouping by workspace or for the default workspace.
Start of the time bucket (inclusive) in RFC 3339 format.
Indicates if there are more results.
Token to provide in as page in the subsequent request to retrieve the next page of data.