apicheats.dev anthropic/llms.txt Raw .md
GET

GET /v1/organizations/usage_report/claude_code?beta=true — Claude API

Beta

Anthropic API key (required); https://api.anthropic.com

Claude API

Get Claude Code Usage Report

Base URL
https://api.anthropic.com
Auth
x-api-key: <ANTHROPIC_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 224 tokens · Vary: Accept

Critical gotchas

Authentication uses the x-api-key header and requests also require an anthropic-version header.

The official OpenAPI URL is discovered from the SDK repository manifest and must remain under Anthropic's trusted Stainless storage prefix.

cURL

curl -X GET 'https://api.anthropic.com/v1/organizations/usage_report/claude_code?beta=true&starting_at=example-starting-at&limit=20&page=example-page' \  -H "x-api-key: $ANTHROPIC_API_KEY" \  -H 'anthropic-version: 2023-06-01'

Parameters

Name In Type Required Description
starting_at query string Yes UTC date in YYYY-MM-DD format. Returns metrics for this single day only.
limit query integer No Number of records per page (default: 20, max: 1000).
page query string No Opaque cursor token from previous response's `next_page` field.

Response 200 OK

{
  "data": [
    {
      "actor": {
        "email_address": "string",
        "type": "string"
      },
      "core_metrics": {
        "commits_by_claude_code": 0,
        "lines_of_code": {
          "added": 0,
          "removed": 0
        },
        "num_sessions": 0,
        "pull_requests_by_claude_code": 0
      },
      "customer_type": "api",
      "date": "2026-09-03T00:00:00Z",
      "is_remote": true,
      "model_breakdown": [
        {
          "estimated_cost": {
            "amount": "[recursive or deeply nested schema]",
            "currency": "[recursive or deeply nested schema]"
          },
          "model": "string",
          "tokens": {
            "cache_creation": "[recursive or deeply nested schema]",
            "cache_read": "[recursive or deeply nested schema]",
            "input": "[recursive or deeply nested schema]",
            "output": "[recursive or deeply nested schema]"
          }
        }
      ],
      "organization_id": "string",
      "subscription_type": "enterprise",
      "terminal_type": "string",
      "tool_actions": {}
    }
  ],
  "has_more": true,
  "next_page": "string"
}
Get a free Claude API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.