Anthropic Cost API

Service-level cost reporting

Operations 1

GET /v1/organizations/cost_report Anthropic Get Cost 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-cost-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-cost-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Anthropic Usage Cost 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: Cost
  description: Service-level cost reporting
paths:
  /v1/organizations/cost_report:
    get:
      summary: Anthropic Get Cost Report
      description: 'Service-level cost breakdowns for the organization in USD, including Messages, Batches, Files, Skills, and Claude Code line items.

        '
      operationId: getCostReport
      tags:
      - Cost
      parameters:
      - $ref: '#/components/parameters/AnthropicVersion'
      - $ref: '#/components/parameters/StartingAt'
      - $ref: '#/components/parameters/EndingAt'
      - $ref: '#/components/parameters/Bucket'
      - $ref: '#/components/parameters/GroupBy'
      - $ref: '#/components/parameters/WorkspaceIds'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Page'
      responses:
        '200':
          description: Cost report.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostReport'
        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'
    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:
    CostReport:
      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
                    description:
                      type: string
                    cost_type:
                      type: string
                    context_window:
                      type: string
                      nullable: true
                    model:
                      type: string
                      nullable: true
                    service_tier:
                      type: string
                      nullable: true
                    token_type:
                      type: string
                      nullable: true
                    currency:
                      type: string
                      default: USD
                    amount:
                      type: string
        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