Anthropic Usage API

Token usage and consumption reporting

Operations 1

GET /v1/organizations/usage_report/messages Anthropic Get Messages Usage Report #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/anthropic-usage-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

anthropic-usage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Anthropic and Cost Usage API
  description: 'Programmatically access your organization''s API usage and cost data via the Usage & Cost Admin API. The Usage API tracks token consumption across your organization with breakdowns by model, workspace, and service tier. The Cost API retrieves service-level cost breakdowns in USD. Both endpoints require an Admin API key (sk-ant-admin...).

    '
  version: 2023-06-01
  contact:
    name: Anthropic Support
    url: https://support.claude.com
  license:
    name: Anthropic Terms of Service
    url: https://www.anthropic.com/terms
servers:
- url: https://api.anthropic.com
  description: Production Server
security:
- AdminApiKeyAuth: []
tags:
- name: Usage
  description: Token usage and consumption reporting
paths:
  /v1/organizations/usage_report/messages:
    get:
      summary: Anthropic Get Messages Usage Report
      description: 'Aggregated token usage for Messages API requests, broken down by day, model, workspace, and service tier.

        '
      operationId: getMessagesUsageReport
      tags:
      - Usage
      parameters:
      - $ref: '#/components/parameters/AnthropicVersion'
      - $ref: '#/components/parameters/StartingAt'
      - $ref: '#/components/parameters/EndingAt'
      - $ref: '#/components/parameters/Bucket'
      - $ref: '#/components/parameters/GroupBy'
      - $ref: '#/components/parameters/Models'
      - $ref: '#/components/parameters/WorkspaceIds'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Page'
      responses:
        '200':
          description: Usage report.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageReport'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    StartingAt:
      name: starting_at
      in: query
      required: true
      description: RFC3339 inclusive lower bound for the report window.
      schema:
        type: string
        format: date-time
    WorkspaceIds:
      name: workspace_ids
      in: query
      required: false
      explode: true
      schema:
        type: array
        items:
          type: string
    AnthropicVersion:
      name: anthropic-version
      in: header
      required: true
      schema:
        type: string
        default: '2023-06-01'
    Models:
      name: models
      in: query
      required: false
      explode: true
      schema:
        type: array
        items:
          type: string
    Bucket:
      name: bucket_width
      in: query
      required: false
      description: Aggregation bucket size.
      schema:
        type: string
        enum:
        - 1h
        - 1d
        default: 1d
    Page:
      name: page
      in: query
      required: false
      schema:
        type: string
    Limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 20
    GroupBy:
      name: group_by
      in: query
      required: false
      description: Dimensions to group the report by.
      explode: true
      schema:
        type: array
        items:
          type: string
          enum:
          - workspace_id
          - api_key_id
          - model
          - service_tier
          - context_window
    EndingAt:
      name: ending_at
      in: query
      required: false
      description: RFC3339 exclusive upper bound for the report window.
      schema:
        type: string
        format: date-time
  schemas:
    UsageReport:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              starting_at:
                type: string
                format: date-time
              ending_at:
                type: string
                format: date-time
              results:
                type: array
                items:
                  type: object
                  properties:
                    workspace_id:
                      type: string
                      nullable: true
                    api_key_id:
                      type: string
                      nullable: true
                    model:
                      type: string
                      nullable: true
                    service_tier:
                      type: string
                      nullable: true
                    context_window:
                      type: string
                      nullable: true
                    uncached_input_tokens:
                      type: integer
                    cache_read_input_tokens:
                      type: integer
                    cache_creation_5m_input_tokens:
                      type: integer
                    cache_creation_1h_input_tokens:
                      type: integer
                    output_tokens:
                      type: integer
                    server_tool_use:
                      type: object
        has_more:
          type: boolean
        next_page:
          type: string
          nullable: true
    Error:
      type: object
      properties:
        type:
          type: string
        error:
          type: object
          properties:
            type:
              type: string
            message:
              type: string
  responses:
    ErrorResponse:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    AdminApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key