cURL
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.
GET
/
v1
/
organizations
/
usage_report
/
claude_code
cURL
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="
}The Admin API is unavailable for individual accounts. To collaborate with teammates and add members, set up your organization in Console → Settings → Organization.
Headers
Query Parameters
UTC date in YYYY-MM-DD format. Returns metrics for this single day only.
Pattern:
^\d{4}-\d{2}-\d{2}$Number of records per page (default: 20, max: 1000).
Required range:
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.
Example:
"page_MjAyNS0wNS0xNFQwMDowMDowMFo="
Was this page helpful?
⌘I