curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code\
?starting_at=2025-08-08\
&limit=20" \
--header "anthropic-version: 2023-06-01" \
--header "content-type: application/json" \
--header "x-api-key: $ANTHROPIC_ADMIN_KEY"{
"data": [
{
"actor": {
"email_address": "<string>"
},
"core_metrics": {
"commits_by_claude_code": 123,
"lines_of_code": {
"added": 123,
"removed": 123
},
"num_sessions": 123,
"pull_requests_by_claude_code": 123
},
"date": "2023-11-07T05:31:56Z",
"model_breakdown": [
{
"estimated_cost": {
"amount": 123,
"currency": "<string>"
},
"model": "<string>",
"tokens": {
"cache_creation": 123,
"cache_read": 123,
"input": 123,
"output": 123
}
}
],
"organization_id": "<string>",
"terminal_type": "<string>",
"tool_actions": {},
"subscription_type": "enterprise"
}
],
"has_more": true,
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}取得 Claude Code 使用報告
Retrieve daily aggregated usage metrics for Claude Code users. Enables organizations to analyze developer productivity and build custom dashboards.
curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code\
?starting_at=2025-08-08\
&limit=20" \
--header "anthropic-version: 2023-06-01" \
--header "content-type: application/json" \
--header "x-api-key: $ANTHROPIC_ADMIN_KEY"{
"data": [
{
"actor": {
"email_address": "<string>"
},
"core_metrics": {
"commits_by_claude_code": 123,
"lines_of_code": {
"added": 123,
"removed": 123
},
"num_sessions": 123,
"pull_requests_by_claude_code": 123
},
"date": "2023-11-07T05:31:56Z",
"model_breakdown": [
{
"estimated_cost": {
"amount": 123,
"currency": "<string>"
},
"model": "<string>",
"tokens": {
"cache_creation": 123,
"cache_read": 123,
"input": 123,
"output": 123
}
}
],
"organization_id": "<string>",
"terminal_type": "<string>",
"tool_actions": {},
"subscription_type": "enterprise"
}
],
"has_more": true,
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}Documentation Index
Fetch the complete documentation index at: https://docs.claude.com/llms.txt
Use this file to discover all available pages before exploring further.
Headers
Query Parameters
UTC date in YYYY-MM-DD format. Returns metrics for this single day only.
^\d{4}-\d{2}-\d{2}$Number of records per page (default: 20, max: 1000).
1 <= x <= 1000Opaque cursor token from previous response's next_page field.
Response
Successful Response
List of Claude Code usage records for the requested date.
Show child attributes
Show child attributes
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.
"page_MjAyNS0wNS0xNFQwMDowMDowMFo="
Was this page helpful?