cURL
curl "https://api.anthropic.com/v1/organizations/cost_report\
?starting_at=2025-08-01T00:00:00Z\
&group_by[]=workspace_id\
&group_by[]=description\
&limit=1" \
--header "anthropic-version: 2023-06-01" \
--header "content-type: application/json" \
--header "x-api-key: $ANTHROPIC_ADMIN_KEY"{
"data": [
{
"starting_at": "<string>",
"ending_at": "<string>",
"results": [
{
"currency": "<string>",
"amount": "<string>",
"workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
"description": "Claude Sonnet 4 Usage - Input Tokens",
"cost_type": "tokens",
"context_window": "0-200k",
"model": "claude-sonnet-4-20250514",
"service_tier": "standard",
"token_type": "uncached_input_tokens"
}
]
}
],
"has_more": true,
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}获取成本报告
GET
/
v1
/
organizations
/
cost_report
cURL
curl "https://api.anthropic.com/v1/organizations/cost_report\
?starting_at=2025-08-01T00:00:00Z\
&group_by[]=workspace_id\
&group_by[]=description\
&limit=1" \
--header "anthropic-version: 2023-06-01" \
--header "content-type: application/json" \
--header "x-api-key: $ANTHROPIC_ADMIN_KEY"{
"data": [
{
"starting_at": "<string>",
"ending_at": "<string>",
"results": [
{
"currency": "<string>",
"amount": "<string>",
"workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
"description": "Claude Sonnet 4 Usage - Input Tokens",
"cost_type": "tokens",
"context_window": "0-200k",
"model": "claude-sonnet-4-20250514",
"service_tier": "standard",
"token_type": "uncached_input_tokens"
}
]
}
],
"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
Maximum number of time buckets to return in the response.
Required range:
1 <= x <= 31Example:
7
Optionally set to the next_page token from the previous response.
Example:
"page_MjAyNS0wNS0xNFQwMDowMDowMFo="
Time buckets that start on or after this RFC 3339 timestamp will be returned. Each time bucket will be snapped to the start of the minute/hour/day in UTC.
Example:
"2024-10-30T23:58:27.427722Z"
Time buckets that end before this RFC 3339 timestamp will be returned.
Example:
"2024-10-30T23:58:27.427722Z"
Group by any subset of the available options.
Available options:
workspace_id, description Example:
"workspace_id"
Time granularity of the response data.
Available options:
1d Allowed value:
"1d"Example:
"1d"
Response
Successful Response
Was this page helpful?
⌘I