Anthropic Models API

List and inspect Claude models including Opus 4.7, Sonnet 4.6, and Haiku 4.5. The response includes max_input_tokens, max_tokens, and a capabilities object for every model so clients can discover model properties programmatically.

OpenAPI Specification

anthropic-models-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Anthropic Admin Agents Models API
  description: Manage administrative functions for Anthropic organizations, workspaces, users, invites, and API keys.
  version: 1.0.0
  contact:
    name: Anthropic
    url: https://www.anthropic.com
    email: support@anthropic.com
  license:
    name: Anthropic API License
    url: https://www.anthropic.com/terms
servers:
- url: https://api.anthropic.com/v1
  description: Production Server
security:
- AdminApiKeyAuth: []
tags:
- name: Models
  description: APIs for listing and retrieving model information
paths:
  /v1/models:
    get:
      summary: Anthropic List Available Models
      description: 'List available models. The Models API response can be used to determine

        which models are available for use in the API. More recently released

        models are listed first.

        '
      operationId: listModels
      tags:
      - Models
      x-microcks-operation:
        dispatcher: FALLBACK
        dispatcherRules: ''
        delay: 100
      parameters:
      - $ref: '#/components/parameters/AnthropicVersionHeader'
      - $ref: '#/components/parameters/AnthropicBetaHeader'
      - $ref: '#/components/parameters/BeforeIdQuery'
      - $ref: '#/components/parameters/AfterIdQuery'
      - $ref: '#/components/parameters/LimitQuery'
      - $ref: '#/components/parameters/ApiKeyHeader'
      - $ref: '#/components/parameters/ContentTypeHeader'
      - $ref: '#/components/parameters/BrowserAccessHeader'
      responses:
        '200':
          description: Successful Response
          headers:
            retry-after:
              $ref: '#/components/headers/RetryAfter'
            anthropic-ratelimit-requests-limit:
              $ref: '#/components/headers/RateLimitRequestsLimit'
            anthropic-ratelimit-requests-remaining:
              $ref: '#/components/headers/RateLimitRequestsRemaining'
            anthropic-ratelimit-requests-reset:
              $ref: '#/components/headers/RateLimitRequestsReset'
            anthropic-ratelimit-tokens-limit:
              $ref: '#/components/headers/RateLimitTokensLimit'
            anthropic-ratelimit-tokens-remaining:
              $ref: '#/components/headers/RateLimitTokensRemaining'
            anthropic-ratelimit-tokens-reset:
              $ref: '#/components/headers/RateLimitTokensReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListModelsResponse'
              examples:
                ListModelsSuccessExample:
                  $ref: '#/components/examples/ListModelsResponseExample'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                BadRequestExample:
                  $ref: '#/components/examples/ErrorBadRequestExample'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                UnauthorizedExample:
                  $ref: '#/components/examples/ErrorUnauthorizedExample'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                RateLimitExample:
                  $ref: '#/components/examples/ErrorRateLimitExample'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                ServerErrorExample:
                  $ref: '#/components/examples/ErrorServerExample'
  /v1/models/{model_id}:
    get:
      summary: Anthropic Get A Specific Model
      description: 'Get a specific model. The Models API response can be used to determine

        information about a specific model or resolve a model alias to a model ID.

        '
      operationId: getModel
      tags:
      - Models
      x-microcks-operation:
        dispatcher: FALLBACK
        dispatcherRules: ''
        delay: 100
      parameters:
      - $ref: '#/components/parameters/ModelIdPath'
      - $ref: '#/components/parameters/AnthropicVersionHeader'
      - $ref: '#/components/parameters/AnthropicBetaHeader'
      - $ref: '#/components/parameters/ApiKeyHeader'
      - $ref: '#/components/parameters/ContentTypeHeader'
      - $ref: '#/components/parameters/BrowserAccessHeader'
      responses:
        '200':
          description: Successful Response
          headers:
            retry-after:
              $ref: '#/components/headers/RetryAfter'
            anthropic-ratelimit-requests-limit:
              $ref: '#/components/headers/RateLimitRequestsLimit'
            anthropic-ratelimit-requests-remaining:
              $ref: '#/components/headers/RateLimitRequestsRemaining'
            anthropic-ratelimit-requests-reset:
              $ref: '#/components/headers/RateLimitRequestsReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelInfo'
              examples:
                GetModelSuccessExample:
                  $ref: '#/components/examples/ModelInfoExample'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                BadRequestExample:
                  $ref: '#/components/examples/ErrorBadRequestExample'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                UnauthorizedExample:
                  $ref: '#/components/examples/ErrorUnauthorizedExample'
        '404':
          description: Model Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                NotFoundExample:
                  $ref: '#/components/examples/ErrorNotFoundExample'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                RateLimitExample:
                  $ref: '#/components/examples/ErrorRateLimitExample'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                ServerErrorExample:
                  $ref: '#/components/examples/ErrorServerExample'
components:
  examples:
    ErrorServerExample:
      summary: Server error
      value:
        type: api_error
        message: An internal server error occurred
    ListModelsResponseExample:
      summary: List of available models
      value:
        data:
        - id: claude-sonnet-4-20250514
          type: model
          display_name: Claude Sonnet 4
          created_at: '2025-05-14T00:00:00Z'
        - id: claude-3-5-sonnet-20241022
          type: model
          display_name: Claude 3.5 Sonnet
          created_at: '2024-10-22T00:00:00Z'
        - id: claude-3-haiku-20240307
          type: model
          display_name: Claude 3 Haiku
          created_at: '2024-03-07T00:00:00Z'
        first_id: claude-sonnet-4-20250514
        has_more: true
        last_id: claude-3-haiku-20240307
    ErrorRateLimitExample:
      summary: Rate limit error
      value:
        type: rate_limit_error
        message: Rate limit exceeded. Please retry after some time.
    ErrorNotFoundExample:
      summary: Not found error
      value:
        type: not_found_error
        message: The requested model was not found
    ModelInfoExample:
      summary: Claude Sonnet 4 model info
      value:
        id: claude-sonnet-4-20250514
        type: model
        display_name: Claude Sonnet 4
        created_at: '2025-05-14T00:00:00Z'
    ErrorBadRequestExample:
      summary: Bad request error
      value:
        type: invalid_request_error
        message: Invalid request format
    ErrorUnauthorizedExample:
      summary: Unauthorized error
      value:
        type: authentication_error
        message: Invalid or missing API key
  parameters:
    BrowserAccessHeader:
      name: anthropic-dangerous-direct-browser-access
      in: header
      required: false
      description: Enable CORS.
      schema:
        type: string
        default: 'true'
    AnthropicVersionHeader:
      name: anthropic-version
      in: header
      required: true
      description: 'The version of the Anthropic API you want to use. Read more about

        versioning and our version history here.

        '
      schema:
        type: string
        default: '2023-06-01'
    BeforeIdQuery:
      name: before_id
      in: query
      description: 'ID of the object to use as a cursor for pagination. When provided,

        returns the page of results immediately before this object.

        '
      schema:
        type: string
    ContentTypeHeader:
      name: Content-Type
      in: header
      required: true
      description: The content type.
      schema:
        type: string
        default: application/json
    AnthropicBetaHeader:
      name: anthropic-beta
      in: header
      description: 'Optional header to specify the beta version(s) you want to use. To

        use multiple betas, use a comma separated list like beta1,beta2 or

        specify the header multiple times for each beta.

        '
      required: false
      schema:
        type: array
        items:
          type: string
      style: simple
      explode: false
    AfterIdQuery:
      name: after_id
      in: query
      description: 'ID of the object to use as a cursor for pagination. When provided,

        returns the page of results immediately after this object.

        '
      schema:
        type: string
    ModelIdPath:
      name: model_id
      in: path
      required: true
      description: Model identifier or alias.
      schema:
        type: string
      example: claude-sonnet-4-20250514
    LimitQuery:
      name: limit
      in: query
      description: 'Number of items to return per page. Defaults to 20. Ranges from 1 to 1000.

        '
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 20
    ApiKeyHeader:
      name: x-api-key
      in: header
      required: true
      description: A valid API token.
      schema:
        type: string
  schemas:
    ErrorResponse:
      type: object
      required:
      - type
      - message
      properties:
        type:
          type: string
          description: The type of error
        message:
          type: string
          description: A human-readable error message
    ListModelsResponse:
      type: object
      required:
      - data
      - first_id
      - has_more
      - last_id
      properties:
        data:
          type: array
          description: List of available models
          items:
            $ref: '#/components/schemas/ModelInfo'
        first_id:
          type: string
          nullable: true
          description: 'First ID in the data list. Can be used as the before_id for the previous page.

            '
        has_more:
          type: boolean
          description: 'Indicates if there are more results in the requested page direction.

            '
        last_id:
          type: string
          nullable: true
          description: 'Last ID in the data list. Can be used as the after_id for the next page.

            '
    ModelInfo:
      type: object
      required:
      - id
      - type
      - display_name
      - created_at
      properties:
        id:
          type: string
          description: Unique identifier for the model.
        type:
          type: string
          enum:
          - model
          description: Object type. For models, this is always "model".
        display_name:
          type: string
          description: Human-readable name of the model.
        created_at:
          type: string
          format: date-time
          description: The date and time when the model was created.
  headers:
    RateLimitRequestsReset:
      description: 'The time when the request rate limit will be fully replenished,

        provided in RFC 3339 format.

        '
      schema:
        type: string
    RetryAfter:
      description: 'The number of seconds to wait until you can retry the request.

        Earlier retries will fail.

        '
      schema:
        type: string
    RateLimitRequestsRemaining:
      description: 'The number of requests remaining before being rate limited.

        '
      schema:
        type: string
    RateLimitTokensLimit:
      description: 'The maximum number of tokens allowed within any rate limit period.

        '
      schema:
        type: string
    RateLimitTokensReset:
      description: 'The time when the token rate limit will be fully replenished,

        provided in RFC 3339 format.

        '
      schema:
        type: string
    RateLimitRequestsLimit:
      description: 'The maximum number of requests allowed within any rate limit period.

        '
      schema:
        type: string
    RateLimitTokensRemaining:
      description: 'The number of tokens remaining (rounded to the nearest thousand)

        before being rate limited.

        '
      schema:
        type: string
  securitySchemes:
    AdminApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Admin API key for authentication (starts with sk-ant-admin...).