> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# claude-opus-5

> Send text, images, prior assistant turns, and tool results. Claude Opus 5 generates the next message and can return text, thinking, or tool-use content blocks.



## OpenAPI

````yaml api-reference/model-api/anthropic/openapi/claude-opus-5/openapi.yaml POST /v1/messages
openapi: 3.1.0
info:
  title: Claude Opus 5
  description: >-
    Anthropic Claude Opus 5 via AnyFast. The model has a 1M-token context
    window, supports up to 128K output tokens, and uses adaptive thinking by
    default.
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/messages:
    post:
      summary: Create a Message
      description: >-
        Send text, images, prior assistant turns, and tool results. Claude Opus
        5 generates the next message and can return text, thinking, or tool-use
        content blocks.
      operationId: createMessageClaudeOpus5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - max_tokens
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - claude-opus-5
                  description: Model ID.
                  example: claude-opus-5
                messages:
                  type: array
                  minItems: 1
                  description: Input messages. Each message has a role and content.
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                        description: The role of the message author.
                      content:
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - text
                                    - image
                                    - tool_result
                                text:
                                  type: string
                                source:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - base64
                                        - url
                                    media_type:
                                      type: string
                                    data:
                                      type: string
                                    url:
                                      type: string
                                      format: uri
                                tool_use_id:
                                  type: string
                                content:
                                  oneOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: object
                                is_error:
                                  type: boolean
                        description: >-
                          The content of the message. Either a string or an
                          array of content blocks.
                  example:
                    - role: user
                      content: Hello, Claude!
                max_tokens:
                  type: integer
                  minimum: 1
                  maximum: 128000
                  description: >-
                    The maximum number of tokens to generate before stopping.
                    Claude Opus 5 supports up to 128K output tokens.
                  example: 4096
                system:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                          text:
                            type: string
                  description: System prompt. Provides context and instructions to Claude.
                metadata:
                  type: object
                  properties:
                    user_id:
                      type: string
                      description: >-
                        An external identifier for the user who is associated
                        with the request.
                  description: An object describing metadata about the request.
                stop_sequences:
                  type: array
                  items:
                    type: string
                  description: >-
                    Custom text sequences that will cause the model to stop
                    generating.
                stream:
                  type: boolean
                  default: false
                  description: >-
                    Whether to incrementally stream the response using
                    server-sent events.
                tools:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                      - input_schema
                    properties:
                      name:
                        type: string
                        description: Name of the tool.
                      description:
                        type: string
                        description: Description of what the tool does.
                      input_schema:
                        type: object
                        description: JSON Schema for the tool input.
                  description: Definitions of tools that the model may use.
                tool_choice:
                  type: object
                  required:
                    - type
                  properties:
                    type:
                      type: string
                      enum:
                        - auto
                        - any
                        - tool
                      default: auto
                      description: How the model should use the provided tools.
                    name:
                      type: string
                      description: The name of the tool to use (when type is "tool").
                  description: How the model should use the provided tools.
                output_config:
                  type: object
                  properties:
                    effort:
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                        - xhigh
                        - max
                      default: high
                      description: >-
                        Controls adaptive thinking depth and token usage. Claude
                        Opus 5 defaults to high.
                  description: >-
                    Output controls for models that support adaptive thinking
                    effort.
                thinking:
                  type: object
                  required:
                    - type
                  properties:
                    type:
                      type: string
                      enum:
                        - adaptive
                        - disabled
                      default: adaptive
                      description: >-
                        Whether to explicitly use adaptive thinking or disable
                        thinking.
                  description: >-
                    Adaptive thinking is the default. Manual extended thinking
                    is not supported. Disabling thinking is valid only with low,
                    medium, or high effort; xhigh or max returns a 400 error.
      responses:
        '200':
          description: Message created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Message:
      type: object
      required:
        - id
        - type
        - role
        - content
        - model
        - stop_reason
        - usage
      properties:
        id:
          type: string
          example: msg_01XFDUDYJgAACzvnptvVoYEL
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - text
                  - thinking
                  - tool_use
              text:
                type: string
              thinking:
                type: string
              signature:
                type: string
              id:
                type: string
              name:
                type: string
              input:
                type: object
          example:
            - type: text
              text: Hello! How can I help you today?
        model:
          type: string
          example: claude-opus-5
        stop_reason:
          type: string
          enum:
            - end_turn
            - max_tokens
            - stop_sequence
            - tool_use
            - refusal
            - null
          description: Includes `refusal` for requests that the model declines.
        stop_sequence:
          type: string
          nullable: true
        stop_details:
          type: object
          nullable: true
          additionalProperties: true
          description: Additional stop information when the serving platform provides it.
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            cache_creation_input_tokens:
              type: integer
            cache_read_input_tokens:
              type: integer
            cache_creation:
              type: object
              properties:
                ephemeral_1h_input_tokens:
                  type: integer
                ephemeral_5m_input_tokens:
                  type: integer
            output_tokens_details:
              type: object
              properties:
                thinking_tokens:
                  type: integer
    Error:
      type: object
      properties:
        type:
          type: string
          example: error
        error:
          type: object
          properties:
            type:
              type: string
              example: invalid_request_error
            message:
              type: string
              example: Invalid request parameters
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````