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

# Claude - Messages API

> - Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
- The Messages API can be used for either single queries or stateless multi-turn conversations.

<Note>
  **BaseURL**: The default BaseURL is `https://direct.evolink.ai`, which has better support for text models and long-lived connections. `https://api.evolink.ai` is the primary endpoint for multimodal services and serves as a fallback address for text models.
</Note>


## OpenAPI

````yaml en/api-manual/language-series/claude/claude-messages-api.json POST /v1/messages
openapi: 3.1.0
info:
  title: Claude Messages API
  description: >-
    Send a structured list of input messages with text and/or image content, and
    the model will generate the next message in the conversation. The Messages
    API can be used for either single queries or stateless multi-turn
    conversations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: Production (recommended)
  - url: https://api.evolink.ai
    description: Alternative URL
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Claude AI message generation and conversation APIs
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: Create a Message
      description: >-
        - Send a structured list of input messages with text and/or image
        content, and the model will generate the next message in the
        conversation.

        - The Messages API can be used for either single queries or stateless
        multi-turn conversations.
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageParams'
            example:
              model: claude-opus-5
              max_tokens: 1024
              messages:
                - role: user
                  content: Hello, world
      responses:
        '200':
          description: Message object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                model: claude-haiku-4-5-20251001
                id: msg_bdrk_017XLrAa77zWvfBGQ6ESvrxz
                type: message
                role: assistant
                content:
                  - type: text
                    text: |-
                      # Hey there! 👋

                      How's it going? What can I help you with today?
                stop_reason: end_turn
                stop_sequence: null
                usage:
                  input_tokens: 8
                  cache_creation_input_tokens: 0
                  cache_read_input_tokens: 0
                  output_tokens: 24
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Invalid request
                  type: invalid_request_error
                request_id: <string>
                type: error
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Authentication error
                  type: authentication_error
                request_id: <string>
                type: error
        '402':
          description: Billing error
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Billing error
                  type: billing_error
                request_id: <string>
                type: error
                fallback_suggestion: https://evolink.ai/dashboard/billing
        '403':
          description: Permission error
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Permission denied
                  type: permission_error
                request_id: <string>
                type: error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Not found
                  type: not_found_error
                request_id: <string>
                type: error
        '429':
          description: Rate limit error
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Rate limited
                  type: rate_limit_error
                request_id: <string>
                type: error
                fallback_suggestion: retry after 60 seconds
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Internal server error
                  type: api_error
                request_id: <string>
                type: error
                fallback_suggestion: try again later
        '503':
          description: Service overloaded
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Overloaded
                  type: overloaded_error
                request_id: <string>
                type: error
                fallback_suggestion: retry after 30 seconds
        '524':
          description: Cloudflare gateway timeout error
          content:
            application/json:
              schema:
                $ref: 5d0ca42d-5ea4-441f-acb7-88f1fc915e62
              example:
                error:
                  message: Request timeout
                  type: timeout_error
                request_id: <string>
                type: error
                fallback_suggestion: >-
                  Please switch the BaseURL to https://direct.evolink.ai; this
                  endpoint is better for long-running tasks
components:
  schemas:
    CreateMessageParams:
      additionalProperties: false
      properties:
        model:
          $ref: '#/components/schemas/Model'
          description: >-
            Body param: The model used to generate the response. Select one of
            the supported model IDs listed below.
          examples:
            - claude-opus-5
        max_tokens:
          description: >-
            Body param: The maximum number of tokens to generate before
            stopping.


            The model may stop before reaching this limit. Supported models can
            have different maximum output limits.
          type: integer
          minimum: 1
          examples:
            - 1024
        messages:
          description: >-
            Body param: Input messages.


            Our models are trained to operate on alternating `user` and
            `assistant` conversational turns. When creating a new `Message`, you
            specify the prior conversational turns with the `messages`
            parameter, and the model then generates the next `Message` in the
            conversation. Consecutive `user` or `assistant` turns in your
            request will be combined into a single turn.


            Each input message must be an object with a `role` and `content`.
            You can specify a single `user`-role message, or you can include
            multiple `user` and `assistant` messages.


            If the final message uses the `assistant` role, the response content
            will continue immediately from the content in that message. This can
            be used to constrain part of the model's response.


            Example with a single `user` message:


            ```json [{ "role": "user", "content": "Hello, Claude" }] ```


            Example with multiple conversational turns:


            ```json [   { "role": "user", "content": "Hello there." },   {
            "role": "assistant", "content": "Hi, I'm Claude. How can I help
            you?" },   { "role": "user", "content": "Can you explain LLMs in
            plain English?" } ] ```


            Example with a partially-filled response from Claude:


            ```json [   {     "role": "user",     "content": "What's the Greek
            name for Sun? (A) Sol (B) Helios (C) Sun"   },   { "role":
            "assistant", "content": "The best answer is (" } ] ```


            Each input message `content` may be either a single `string` or an
            array of content blocks, where each block has a specific `type`.
            Using a `string` for `content` is shorthand for an array of one
            content block of type `"text"`. The following input messages are
            equivalent:


            ```json { "role": "user", "content": "Hello, Claude" } ```


            ```json { "role": "user", "content": [{ "type": "text", "text":
            "Hello, Claude" }] } ```


            Note that if you want to include a system prompt, you can use the
            top-level `system` parameter — there is no `"system"` role for input
            messages in the Messages API.


            There is a limit of 100,000 messages in a single request.
          items:
            $ref: '#/components/schemas/BetaMessageParam'
          type: array
          minItems: 1
          maxItems: 100000
        container:
          anyOf:
            - $ref: '#/components/schemas/BetaContainerParams'
            - type: string
            - type: 'null'
          description: 'Body param: Container identifier for reuse across requests.'
        output_config:
          $ref: '#/components/schemas/BetaOutputConfig'
          description: >-
            Body param: Configuration options for the model's output, such as
            the output format.
        stop_sequences:
          description: >-
            Body param: Custom text sequences that will cause the model to stop
            generating.


            Our models will normally stop when they have naturally completed
            their turn, which will result in a response `stop_reason` of
            `"end_turn"`.


            If you want the model to stop generating when it encounters custom
            strings of text, you can use the `stop_sequences` parameter. If the
            model encounters one of the custom sequences, the response
            `stop_reason` value will be `"stop_sequence"` and the response
            `stop_sequence` value will contain the matched stop sequence.
          items:
            type: string
          type: array
        stream:
          description: >-
            Body param: Whether to incrementally stream the response using
            server-sent events.
          type: boolean
        system:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/BetaTextBlockParam'
              type: array
          description: >-
            Body param: System prompt.


            Use this parameter to provide context and instructions, such as
            assigning the model a specific goal or role.
        temperature:
          type: number
          minimum: 0
          maximum: 1
          examples:
            - 1
        thinking:
          $ref: '#/components/schemas/BetaThinkingConfigParam'
          description: >-
            Body param: Configuration for enabling extended thinking.


            When enabled, responses include `thinking` content blocks before the
            final answer. `budget_tokens` must be at least 1,024 and counts
            toward `max_tokens`.
        tool_choice:
          $ref: '#/components/schemas/BetaToolChoice'
          description: >-
            Body param: How the model should use the provided tools. The model
            can use a specific tool, any available tool, decide by itself, or
            not use tools at all.
        tools:
          description: >-
            Body param: Definitions of client tools that the model may use.


            If you include `tools` in your API request, the model may return
            `tool_use` content blocks that represent the model's use of those
            tools. You can then run the tools using the generated input and
            return results in `tool_result` content blocks.


            Each tool definition includes:


            - `name`: Name of the tool.

            - `description`: Optional, but strongly recommended description of
            the tool.

            - `input_schema`: JSON schema for the tool input.
          items:
            $ref: '#/components/schemas/BetaTool'
          type: array
        top_k:
          type: integer
          minimum: 0
          examples:
            - 5
        top_p:
          type: number
          minimum: 0
          maximum: 1
          examples:
            - 0.7
      required:
        - model
        - messages
        - max_tokens
      type: object
    Message:
      type: object
      required:
        - id
        - type
        - role
        - content
        - model
        - stop_reason
        - stop_sequence
        - usage
      properties:
        id:
          type: string
          description: |-
            Unique object identifier.

            The format and length of IDs may change over time.
          examples:
            - msg_013Zva2CMHLNnXjNJJKqJ2EF
          title: Id
        type:
          type: string
          const: message
          description: |-
            Object type.

            For Messages, this is always `"message"`.
          title: Type
        role:
          type: string
          const: assistant
          description: |-
            Conversational role of the generated message.

            This will always be `"assistant"`.
          title: Role
        content:
          type: array
          description: >-
            Content generated by the model.


            This is an array of content blocks, each of which has a `type` that
            determines its shape.
          items:
            anyOf:
              - $ref: '#/components/schemas/ResponseTextBlock'
              - $ref: '#/components/schemas/ResponseThinkingBlock'
              - $ref: '#/components/schemas/ResponseRedactedThinkingBlock'
              - $ref: '#/components/schemas/ResponseToolUseBlock'
              - $ref: '#/components/schemas/ResponseServerToolUseBlock'
              - $ref: '#/components/schemas/ResponseWebSearchToolResultBlock'
              - $ref: '#/components/schemas/ResponseWebFetchToolResultBlock'
              - $ref: '#/components/schemas/ResponseCodeExecutionToolResultBlock'
              - $ref: '#/components/schemas/ResponseBashCodeExecutionToolResultBlock'
              - $ref: >-
                  #/components/schemas/ResponseTextEditorCodeExecutionToolResultBlock
              - $ref: '#/components/schemas/ResponseMCPToolUseBlock'
              - $ref: '#/components/schemas/ResponseMCPToolResultBlock'
              - $ref: '#/components/schemas/ResponseContainerUploadBlock'
          title: Content
        model:
          type: string
          description: The model that handled the request.
          enum:
            - claude-haiku-4-5-20251001
            - claude-sonnet-4-5-20250929
            - claude-opus-4-5-20251101
            - claude-opus-4-6
            - claude-fable-5
            - claude-opus-5
            - claude-opus-4-8
            - claude-opus-4-7
            - claude-sonnet-4-6
            - claude-sonnet-5
          examples:
            - claude-opus-5
          title: Model
        stop_reason:
          type: string
          nullable: true
          description: >-
            The reason that generation stopped.


            A model safety refusal may be returned as a successful Message
            response with `stop_reason: "refusal"`. This is different from an
            HTTP `403 permission_error`, which indicates an account or
            authorization problem.
          enum:
            - end_turn
            - max_tokens
            - stop_sequence
            - tool_use
            - pause_turn
            - refusal
            - model_context_window_exceeded
          title: Stop Reason
        stop_sequence:
          type: string
          nullable: true
          description: Which custom stop sequence was generated, if any.
          title: Stop Sequence
        usage:
          $ref: '#/components/schemas/Usage'
          description: Billing and rate-limit usage.
        context_management:
          anyOf:
            - $ref: '#/components/schemas/ResponseContextManagement'
            - type: 'null'
          description: Context management response.
        container:
          anyOf:
            - $ref: '#/components/schemas/Container'
            - type: 'null'
          description: Information about the container used in this request.
    Model:
      type: string
      enum:
        - claude-haiku-4-5-20251001
        - claude-sonnet-4-5-20250929
        - claude-opus-4-5-20251101
        - claude-opus-4-6
        - claude-fable-5
        - claude-opus-5
        - claude-opus-4-8
        - claude-opus-4-7
        - claude-sonnet-4-6
        - claude-sonnet-5
      description: The model that will complete your prompt.
    BetaMessageParam:
      additionalProperties: false
      properties:
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/BetaContentBlockParam'
              type: array
        role:
          enum:
            - user
            - assistant
          type: string
      required:
        - content
        - role
      type: object
    BetaContainerParams:
      additionalProperties: false
      description: Container parameters with skills to be loaded.
      properties:
        id:
          description: Container id
          type:
            - string
            - 'null'
        skills:
          anyOf:
            - items:
                $ref: '#/components/schemas/BetaSkillParams'
              type: array
            - type: 'null'
          description: List of skills to load in the container
      type: object
    BetaOutputConfig:
      additionalProperties: false
      properties:
        effort:
          description: All possible effort levels.
          enum:
            - low
            - medium
            - high
            - xhigh
            - max
            - null
          type:
            - string
            - 'null'
        format:
          anyOf:
            - $ref: '#/components/schemas/BetaJSONOutputFormat'
            - type: 'null'
          description: A JSON schema that defines the required response format.
        task_budget:
          anyOf:
            - $ref: '#/components/schemas/BetaTokenTaskBudget'
            - type: 'null'
          description: User-configurable total token budget across contexts.
      type: object
    BetaTextBlockParam:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        citations:
          anyOf:
            - items:
                $ref: '#/components/schemas/BetaTextCitationParam'
              type: array
            - type: 'null'
        text:
          type: string
        type:
          const: text
          type: string
      required:
        - text
        - type
      type: object
    BetaThinkingConfigParam:
      anyOf:
        - $ref: '#/components/schemas/BetaThinkingConfigEnabled'
        - $ref: '#/components/schemas/BetaThinkingConfigDisabled'
        - $ref: '#/components/schemas/BetaThinkingConfigAdaptive'
      description: >-
        Configuration for enabling extended thinking.


        When enabled, responses include `thinking` content blocks before the
        final answer. `budget_tokens` must be at least 1,024 and counts toward
        `max_tokens`.
    BetaToolChoice:
      anyOf:
        - $ref: '#/components/schemas/BetaToolChoiceAuto'
        - $ref: '#/components/schemas/BetaToolChoiceAny'
        - $ref: '#/components/schemas/BetaToolChoiceTool'
        - $ref: '#/components/schemas/BetaToolChoiceNone'
      description: >-
        How the model should use the provided tools. The model can use a
        specific tool, any available tool, decide by itself, or not use tools at
        all.
    BetaTool:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
            type: string
          type: array
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        defer_loading:
          description: >-
            If true, tool will not be included in initial system prompt. Only
            loaded when returned via tool_reference from tool search.
          type: boolean
        description:
          description: >-
            Description of what this tool does.


            Tool descriptions should be as detailed as possible. The more
            information that the model has about what the tool is and how to use
            it, the better it will perform. You can use natural language
            descriptions to reinforce important aspects of the tool input JSON
            schema.
          type: string
        eager_input_streaming:
          description: >-
            Enable eager input streaming for this tool. When true, tool input
            parameters will be streamed incrementally as they are generated, and
            types will be inferred on-the-fly rather than buffering the full
            JSON output. When false, streaming is disabled for this tool even if
            the fine-grained-tool-streaming beta is active. When null (default),
            uses the default behavior based on beta headers.
          type:
            - boolean
            - 'null'
        input_examples:
          items:
            additionalProperties: {}
            type: object
          type: array
        input_schema:
          $ref: '#/components/schemas/BetaTool.InputSchema'
          description: >-
            [JSON schema](https://json-schema.org/draft/2020-12) for this tool's
            input.


            This defines the shape of the `input` that your tool accepts and
            that the model will produce.
        name:
          description: >-
            Name of the tool.


            This is how the tool will be called by the model and in `tool_use`
            blocks.
          type: string
        strict:
          description: When true, guarantees schema validation on tool names and inputs
          type: boolean
        type:
          enum:
            - custom
            - null
          type:
            - string
            - 'null'
      required:
        - input_schema
        - name
      type: object
    ResponseTextBlock:
      properties:
        citations:
          anyOf:
            - items:
                discriminator:
                  mapping:
                    char_location:
                      $ref: '#/components/schemas/ResponseCharLocationCitation'
                    content_block_location:
                      $ref: >-
                        #/components/schemas/ResponseContentBlockLocationCitation
                    page_location:
                      $ref: '#/components/schemas/ResponsePageLocationCitation'
                    search_result_location:
                      $ref: >-
                        #/components/schemas/ResponseSearchResultLocationCitation
                    web_search_result_location:
                      $ref: >-
                        #/components/schemas/ResponseWebSearchResultLocationCitation
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/ResponseCharLocationCitation'
                  - $ref: '#/components/schemas/ResponsePageLocationCitation'
                  - $ref: '#/components/schemas/ResponseContentBlockLocationCitation'
                  - $ref: >-
                      #/components/schemas/ResponseWebSearchResultLocationCitation
                  - $ref: '#/components/schemas/ResponseSearchResultLocationCitation'
              type: array
            - type: 'null'
          default: null
          description: >-
            Citations supporting the text block.


            The type of citation returned will depend on the type of document
            being cited. Citing a PDF results in `page_location`, plain text
            results in `char_location`, and content document results in
            `content_block_location`.
          title: Citations
        text:
          maxLength: 5000000
          minLength: 0
          title: Text
          type: string
        type:
          const: text
          default: text
          title: Type
          type: string
      required:
        - citations
        - text
        - type
      title: Text
      type: object
    ResponseThinkingBlock:
      properties:
        signature:
          title: Signature
          type: string
        thinking:
          title: Thinking
          type: string
        type:
          const: thinking
          default: thinking
          title: Type
          type: string
      required:
        - signature
        - thinking
        - type
      title: Thinking
      type: object
    ResponseRedactedThinkingBlock:
      properties:
        data:
          title: Data
          type: string
        type:
          const: redacted_thinking
          default: redacted_thinking
          title: Type
          type: string
      required:
        - data
        - type
      title: Redacted thinking
      type: object
    ResponseToolUseBlock:
      properties:
        id:
          pattern: ^[a-zA-Z0-9_-]+$
          title: Id
          type: string
        input:
          additionalProperties: true
          title: Input
          type: object
        name:
          minLength: 1
          title: Name
          type: string
        type:
          const: tool_use
          default: tool_use
          title: Type
          type: string
      required:
        - id
        - input
        - name
        - type
      title: Tool use
      type: object
    ResponseServerToolUseBlock:
      properties:
        id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: Id
          type: string
        input:
          additionalProperties: true
          title: Input
          type: object
        name:
          enum:
            - web_search
            - web_fetch
            - code_execution
            - bash_code_execution
            - text_editor_code_execution
          title: Name
          type: string
        type:
          const: server_tool_use
          default: server_tool_use
          title: Type
          type: string
      required:
        - id
        - input
        - name
        - type
      title: Server tool use
      type: object
    ResponseWebSearchToolResultBlock:
      properties:
        content:
          anyOf:
            - $ref: '#/components/schemas/ResponseWebSearchToolResultError'
            - items:
                $ref: '#/components/schemas/ResponseWebSearchResultBlock'
              type: array
          title: Content
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: Tool Use Id
          type: string
        type:
          const: web_search_tool_result
          default: web_search_tool_result
          title: Type
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: Web search tool result
      type: object
    ResponseWebFetchToolResultBlock:
      properties:
        content:
          anyOf:
            - $ref: '#/components/schemas/ResponseWebFetchToolResultError'
            - $ref: '#/components/schemas/ResponseWebFetchResultBlock'
          title: Content
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: Tool Use Id
          type: string
        type:
          const: web_fetch_tool_result
          default: web_fetch_tool_result
          title: Type
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: ResponseWebFetchToolResultBlock
      type: object
    ResponseCodeExecutionToolResultBlock:
      properties:
        content:
          anyOf:
            - $ref: '#/components/schemas/ResponseCodeExecutionToolResultError'
            - $ref: '#/components/schemas/ResponseCodeExecutionResultBlock'
          title: Content
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: Tool Use Id
          type: string
        type:
          const: code_execution_tool_result
          default: code_execution_tool_result
          title: Type
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: Code execution tool result
      type: object
    ResponseBashCodeExecutionToolResultBlock:
      properties:
        content:
          anyOf:
            - $ref: '#/components/schemas/ResponseBashCodeExecutionToolResultError'
            - $ref: '#/components/schemas/ResponseBashCodeExecutionResultBlock'
          title: Content
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: Tool Use Id
          type: string
        type:
          const: bash_code_execution_tool_result
          default: bash_code_execution_tool_result
          title: Type
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: ResponseBashCodeExecutionToolResultBlock
      type: object
    ResponseTextEditorCodeExecutionToolResultBlock:
      properties:
        content:
          anyOf:
            - $ref: >-
                #/components/schemas/ResponseTextEditorCodeExecutionToolResultError
            - $ref: >-
                #/components/schemas/ResponseTextEditorCodeExecutionViewResultBlock
            - $ref: >-
                #/components/schemas/ResponseTextEditorCodeExecutionCreateResultBlock
            - $ref: >-
                #/components/schemas/ResponseTextEditorCodeExecutionStrReplaceResultBlock
          title: Content
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: Tool Use Id
          type: string
        type:
          const: text_editor_code_execution_tool_result
          default: text_editor_code_execution_tool_result
          title: Type
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: ResponseTextEditorCodeExecutionToolResultBlock
      type: object
    ResponseMCPToolUseBlock:
      properties:
        id:
          pattern: ^[a-zA-Z0-9_-]+$
          title: Id
          type: string
        input:
          additionalProperties: true
          title: Input
          type: object
        name:
          description: The name of the MCP tool
          title: Name
          type: string
        server_name:
          description: The name of the MCP server
          title: Server Name
          type: string
        type:
          const: mcp_tool_use
          default: mcp_tool_use
          title: Type
          type: string
      required:
        - id
        - input
        - name
        - server_name
        - type
      title: MCP tool use
      type: object
    ResponseMCPToolResultBlock:
      properties:
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ResponseTextBlock'
              type: array
          title: Content
        is_error:
          default: false
          title: Is Error
          type: boolean
        tool_use_id:
          pattern: ^[a-zA-Z0-9_-]+$
          title: Tool Use Id
          type: string
        type:
          const: mcp_tool_result
          default: mcp_tool_result
          title: Type
          type: string
      required:
        - content
        - is_error
        - tool_use_id
        - type
      title: MCP tool result
      type: object
    ResponseContainerUploadBlock:
      description: Response model for a file uploaded to the container.
      properties:
        file_id:
          title: File Id
          type: string
        type:
          const: container_upload
          default: container_upload
          title: Type
          type: string
      required:
        - file_id
        - type
      title: Container upload
      type: object
    Usage:
      properties:
        cache_creation:
          anyOf:
            - $ref: '#/components/schemas/CacheCreation'
            - type: 'null'
          default: null
          description: Breakdown of cached tokens by TTL
        cache_creation_input_tokens:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: The number of input tokens used to create the cache entry.
          examples:
            - 2051
          title: Cache Creation Input Tokens
        cache_read_input_tokens:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: The number of input tokens read from the cache.
          examples:
            - 2051
          title: Cache Read Input Tokens
        input_tokens:
          description: The number of input tokens which were used.
          examples:
            - 2095
          minimum: 0
          title: Input Tokens
          type: integer
        output_tokens:
          description: The number of output tokens which were used.
          examples:
            - 503
          minimum: 0
          title: Output Tokens
          type: integer
        server_tool_use:
          anyOf:
            - $ref: '#/components/schemas/ServerToolUsage'
            - type: 'null'
          default: null
          description: The number of server tool requests.
        service_tier:
          anyOf:
            - enum:
                - standard
                - priority
                - batch
              type: string
            - type: 'null'
          default: null
          description: If the request used the priority, standard, or batch tier.
          title: Service Tier
      required:
        - cache_creation
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - input_tokens
        - output_tokens
        - server_tool_use
        - service_tier
      title: Usage
      type: object
    ResponseContextManagement:
      properties:
        applied_edits:
          description: List of context management edits that were applied.
          items:
            discriminator:
              mapping:
                clear_thinking_20251015:
                  $ref: '#/components/schemas/ResponseClearThinking20251015Edit'
                clear_tool_uses_20250919:
                  $ref: '#/components/schemas/ResponseClearToolUses20250919Edit'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/ResponseClearToolUses20250919Edit'
              - $ref: '#/components/schemas/ResponseClearThinking20251015Edit'
          title: Applied Edits
          type: array
      required:
        - applied_edits
      title: ResponseContextManagement
      type: object
    Container:
      description: >-
        Information about the container used in the request (for the code
        execution tool)
      properties:
        expires_at:
          description: The time at which the container will expire.
          format: date-time
          title: Expires At
          type: string
        id:
          description: Identifier for the container used in this request
          title: Id
          type: string
        skills:
          anyOf:
            - items:
                $ref: '#/components/schemas/Skill'
              type: array
            - type: 'null'
          default: null
          description: Skills loaded in the container
          title: Skills
      required:
        - expires_at
        - id
        - skills
      title: Container
      type: object
    BetaContentBlockParam:
      anyOf:
        - $ref: '#/components/schemas/BetaTextBlockParam'
        - $ref: '#/components/schemas/BetaImageBlockParam'
        - $ref: '#/components/schemas/BetaRequestDocumentBlock'
        - $ref: '#/components/schemas/BetaSearchResultBlockParam'
        - $ref: '#/components/schemas/BetaThinkingBlockParam'
        - $ref: '#/components/schemas/BetaRedactedThinkingBlockParam'
        - $ref: '#/components/schemas/BetaToolUseBlockParam'
        - $ref: '#/components/schemas/BetaToolResultBlockParam'
      description: Regular text content.
    BetaSkillParams:
      additionalProperties: false
      description: Specification for a skill to be loaded in a container (request model).
      properties:
        skill_id:
          description: Skill ID
          type: string
        type:
          description: >-
            Type of skill - either 'anthropic' (built-in) or 'custom'
            (user-defined)
          enum:
            - anthropic
            - custom
          type: string
        version:
          description: Skill version or 'latest' for most recent version
          type: string
      required:
        - skill_id
        - type
      type: object
    BetaJSONOutputFormat:
      additionalProperties: false
      properties:
        schema:
          additionalProperties: {}
          description: The JSON schema of the format
          type: object
        type:
          const: json_schema
          type: string
      required:
        - schema
        - type
      type: object
    BetaTokenTaskBudget:
      additionalProperties: false
      description: User-configurable total token budget across contexts.
      properties:
        remaining:
          description: >-
            Remaining tokens in the budget. Use this to track usage across
            contexts when implementing compaction client-side. Defaults to total
            if not provided.
          type:
            - number
            - 'null'
        total:
          description: Total token budget across all contexts in the session.
          type: number
        type:
          const: tokens
          description: The budget type. Currently only 'tokens' is supported.
          type: string
      required:
        - total
        - type
      type: object
    BetaCacheControlEphemeral:
      additionalProperties: false
      properties:
        ttl:
          description: |-
            The time-to-live for the cache control breakpoint.

            Available values:

            - `5m`: 5 minutes
            - `1h`: 1 hour

            Defaults to `5m`.
          enum:
            - 5m
            - 1h
          type: string
        type:
          const: ephemeral
          type: string
      required:
        - type
      type: object
    BetaTextCitationParam:
      anyOf:
        - $ref: '#/components/schemas/BetaCitationCharLocationParam'
        - $ref: '#/components/schemas/BetaCitationPageLocationParam'
        - $ref: '#/components/schemas/BetaCitationContentBlockLocationParam'
        - $ref: '#/components/schemas/BetaCitationWebSearchResultLocationParam'
        - $ref: '#/components/schemas/BetaCitationSearchResultLocationParam'
    BetaThinkingConfigEnabled:
      additionalProperties: false
      properties:
        budget_tokens:
          description: >-
            Determines how many tokens the model can use for its internal
            reasoning process. Larger budgets can enable more thorough analysis
            for complex problems.


            Must be at least 1,024 and less than `max_tokens`.
          type: integer
          minimum: 1024
        type:
          const: enabled
          type: string
      required:
        - budget_tokens
        - type
      type: object
    BetaThinkingConfigDisabled:
      additionalProperties: false
      properties:
        type:
          const: disabled
          type: string
      required:
        - type
      type: object
    BetaThinkingConfigAdaptive:
      additionalProperties: false
      properties:
        type:
          const: adaptive
          type: string
      required:
        - type
      type: object
    BetaToolChoiceAuto:
      additionalProperties: false
      description: The model will automatically decide whether to use tools.
      properties:
        disable_parallel_tool_use:
          description: >-
            Whether to disable parallel tool use.


            Defaults to `false`. If set to `true`, the model will output at most
            one tool use.
          type: boolean
        type:
          const: auto
          type: string
      required:
        - type
      type: object
    BetaToolChoiceAny:
      additionalProperties: false
      description: The model will use any available tools.
      properties:
        disable_parallel_tool_use:
          description: >-
            Whether to disable parallel tool use.


            Defaults to `false`. If set to `true`, the model will output exactly
            one tool use.
          type: boolean
        type:
          const: any
          type: string
      required:
        - type
      type: object
    BetaToolChoiceTool:
      additionalProperties: false
      description: The model will use the specified tool with `tool_choice.name`.
      properties:
        disable_parallel_tool_use:
          description: >-
            Whether to disable parallel tool use.


            Defaults to `false`. If set to `true`, the model will output exactly
            one tool use.
          type: boolean
        name:
          description: The name of the tool to use.
          type: string
        type:
          const: tool
          type: string
      required:
        - name
        - type
      type: object
    BetaToolChoiceNone:
      additionalProperties: false
      description: The model will not be allowed to use tools.
      properties:
        type:
          const: none
          type: string
      required:
        - type
      type: object
    BetaTool.InputSchema:
      additionalProperties: {}
      description: >-
        [JSON schema](https://json-schema.org/draft/2020-12) for this tool's
        input.


        This defines the shape of the `input` that your tool accepts and that
        the model will produce.
      properties:
        properties:
          anyOf:
            - {}
            - type: 'null'
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
        type:
          const: object
          type: string
      required:
        - type
      type: object
    ResponseCharLocationCitation:
      properties:
        cited_text:
          title: Cited Text
          type: string
        document_index:
          minimum: 0
          title: Document Index
          type: integer
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Title
        end_char_index:
          title: End Char Index
          type: integer
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: File Id
        start_char_index:
          minimum: 0
          title: Start Char Index
          type: integer
        type:
          const: char_location
          default: char_location
          title: Type
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_char_index
        - file_id
        - start_char_index
        - type
      title: Character location
      type: object
    ResponseContentBlockLocationCitation:
      properties:
        cited_text:
          title: Cited Text
          type: string
        document_index:
          minimum: 0
          title: Document Index
          type: integer
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Title
        end_block_index:
          title: End Block Index
          type: integer
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: File Id
        start_block_index:
          minimum: 0
          title: Start Block Index
          type: integer
        type:
          const: content_block_location
          default: content_block_location
          title: Type
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_block_index
        - file_id
        - start_block_index
        - type
      title: Content block location
      type: object
    ResponsePageLocationCitation:
      properties:
        cited_text:
          title: Cited Text
          type: string
        document_index:
          minimum: 0
          title: Document Index
          type: integer
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Title
        end_page_number:
          title: End Page Number
          type: integer
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: File Id
        start_page_number:
          minimum: 1
          title: Start Page Number
          type: integer
        type:
          const: page_location
          default: page_location
          title: Type
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_page_number
        - file_id
        - start_page_number
        - type
      title: Page location
      type: object
    ResponseSearchResultLocationCitation:
      properties:
        cited_text:
          title: Cited Text
          type: string
        end_block_index:
          title: End Block Index
          type: integer
        search_result_index:
          minimum: 0
          title: Search Result Index
          type: integer
        source:
          title: Source
          type: string
        start_block_index:
          minimum: 0
          title: Start Block Index
          type: integer
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        type:
          const: search_result_location
          default: search_result_location
          title: Type
          type: string
      required:
        - cited_text
        - end_block_index
        - search_result_index
        - source
        - start_block_index
        - title
        - type
      title: ResponseSearchResultLocationCitation
      type: object
    ResponseWebSearchResultLocationCitation:
      properties:
        cited_text:
          title: Cited Text
          type: string
        encrypted_index:
          title: Encrypted Index
          type: string
        title:
          anyOf:
            - maxLength: 512
              type: string
            - type: 'null'
          title: Title
        type:
          const: web_search_result_location
          default: web_search_result_location
          title: Type
          type: string
        url:
          title: Url
          type: string
      required:
        - cited_text
        - encrypted_index
        - title
        - type
        - url
      title: ResponseWebSearchResultLocationCitation
      type: object
    ResponseWebSearchToolResultError:
      properties:
        error_code:
          $ref: '#/components/schemas/WebSearchToolResultErrorCode'
        type:
          const: web_search_tool_result_error
          default: web_search_tool_result_error
          title: Type
          type: string
      required:
        - error_code
        - type
      title: ResponseWebSearchToolResultError
      type: object
    ResponseWebSearchResultBlock:
      properties:
        encrypted_content:
          title: Encrypted Content
          type: string
        page_age:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Page Age
        title:
          title: Title
          type: string
        type:
          const: web_search_result
          default: web_search_result
          title: Type
          type: string
        url:
          title: Url
          type: string
      required:
        - encrypted_content
        - page_age
        - title
        - type
        - url
      title: ResponseWebSearchResultBlock
      type: object
    ResponseWebFetchToolResultError:
      properties:
        error_code:
          $ref: '#/components/schemas/WebFetchToolResultErrorCode'
        type:
          const: web_fetch_tool_result_error
          default: web_fetch_tool_result_error
          title: Type
          type: string
      required:
        - error_code
        - type
      title: ResponseWebFetchToolResultError
      type: object
    ResponseWebFetchResultBlock:
      properties:
        content:
          $ref: '#/components/schemas/ResponseDocumentBlock'
        retrieved_at:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: ISO 8601 timestamp when the content was retrieved
          title: Retrieved At
        type:
          const: web_fetch_result
          default: web_fetch_result
          title: Type
          type: string
        url:
          description: Fetched content URL
          title: Url
          type: string
      required:
        - content
        - retrieved_at
        - type
        - url
      title: ResponseWebFetchResultBlock
      type: object
    ResponseCodeExecutionToolResultError:
      properties:
        error_code:
          $ref: '#/components/schemas/CodeExecutionToolResultErrorCode'
        type:
          const: code_execution_tool_result_error
          default: code_execution_tool_result_error
          title: Type
          type: string
      required:
        - error_code
        - type
      title: Code execution tool error
      type: object
    ResponseCodeExecutionResultBlock:
      properties:
        content:
          items:
            $ref: '#/components/schemas/ResponseCodeExecutionOutputBlock'
          title: Content
          type: array
        return_code:
          title: Return Code
          type: integer
        stderr:
          title: Stderr
          type: string
        stdout:
          title: Stdout
          type: string
        type:
          const: code_execution_result
          default: code_execution_result
          title: Type
          type: string
      required:
        - content
        - return_code
        - stderr
        - stdout
        - type
      title: Code execution result
      type: object
    ResponseBashCodeExecutionToolResultError:
      properties:
        error_code:
          $ref: '#/components/schemas/BashCodeExecutionToolResultErrorCode'
        type:
          const: bash_code_execution_tool_result_error
          default: bash_code_execution_tool_result_error
          title: Type
          type: string
      required:
        - error_code
        - type
      title: ResponseBashCodeExecutionToolResultError
      type: object
    ResponseBashCodeExecutionResultBlock:
      properties:
        content:
          items:
            $ref: '#/components/schemas/ResponseBashCodeExecutionOutputBlock'
          title: Content
          type: array
        return_code:
          title: Return Code
          type: integer
        stderr:
          title: Stderr
          type: string
        stdout:
          title: Stdout
          type: string
        type:
          const: bash_code_execution_result
          default: bash_code_execution_result
          title: Type
          type: string
      required:
        - content
        - return_code
        - stderr
        - stdout
        - type
      title: ResponseBashCodeExecutionResultBlock
      type: object
    ResponseTextEditorCodeExecutionToolResultError:
      properties:
        error_code:
          $ref: '#/components/schemas/TextEditorCodeExecutionToolResultErrorCode'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Error Message
        type:
          const: text_editor_code_execution_tool_result_error
          default: text_editor_code_execution_tool_result_error
          title: Type
          type: string
      required:
        - error_code
        - error_message
        - type
      title: ResponseTextEditorCodeExecutionToolResultError
      type: object
    ResponseTextEditorCodeExecutionViewResultBlock:
      properties:
        content:
          title: Content
          type: string
        file_type:
          enum:
            - text
            - image
            - pdf
          title: File Type
          type: string
        num_lines:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Num Lines
        start_line:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Start Line
        total_lines:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Total Lines
        type:
          const: text_editor_code_execution_view_result
          default: text_editor_code_execution_view_result
          title: Type
          type: string
      required:
        - content
        - file_type
        - num_lines
        - start_line
        - total_lines
        - type
      title: ResponseTextEditorCodeExecutionViewResultBlock
      type: object
    ResponseTextEditorCodeExecutionCreateResultBlock:
      properties:
        is_file_update:
          title: Is File Update
          type: boolean
        type:
          const: text_editor_code_execution_create_result
          default: text_editor_code_execution_create_result
          title: Type
          type: string
      required:
        - is_file_update
        - type
      title: ResponseTextEditorCodeExecutionCreateResultBlock
      type: object
    ResponseTextEditorCodeExecutionStrReplaceResultBlock:
      properties:
        lines:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: Lines
        new_lines:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: New Lines
        new_start:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: New Start
        old_lines:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Old Lines
        old_start:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Old Start
        type:
          const: text_editor_code_execution_str_replace_result
          default: text_editor_code_execution_str_replace_result
          title: Type
          type: string
      required:
        - lines
        - new_lines
        - new_start
        - old_lines
        - old_start
        - type
      title: ResponseTextEditorCodeExecutionStrReplaceResultBlock
      type: object
    CacheCreation:
      properties:
        ephemeral_1h_input_tokens:
          default: 0
          description: The number of input tokens used to create the 1 hour cache entry.
          minimum: 0
          title: Ephemeral 1H Input Tokens
          type: integer
        ephemeral_5m_input_tokens:
          default: 0
          description: The number of input tokens used to create the 5 minute cache entry.
          minimum: 0
          title: Ephemeral 5M Input Tokens
          type: integer
      required:
        - ephemeral_1h_input_tokens
        - ephemeral_5m_input_tokens
      title: CacheCreation
      type: object
    ServerToolUsage:
      properties:
        web_fetch_requests:
          default: 0
          description: The number of web fetch tool requests.
          examples:
            - 2
          minimum: 0
          title: Web Fetch Requests
          type: integer
        web_search_requests:
          default: 0
          description: The number of web search tool requests.
          examples:
            - 0
          minimum: 0
          title: Web Search Requests
          type: integer
      required:
        - web_fetch_requests
        - web_search_requests
      title: ServerToolUsage
      type: object
    ResponseClearThinking20251015Edit:
      properties:
        cleared_input_tokens:
          description: Number of input tokens cleared by this edit.
          minimum: 0
          title: Cleared Input Tokens
          type: integer
        cleared_thinking_turns:
          description: Number of thinking turns that were cleared.
          minimum: 0
          title: Cleared Thinking Turns
          type: integer
        type:
          const: clear_thinking_20251015
          default: clear_thinking_20251015
          description: The type of context management edit applied.
          title: Type
          type: string
      required:
        - cleared_input_tokens
        - cleared_thinking_turns
        - type
      title: ResponseClearThinking20251015Edit
      type: object
    ResponseClearToolUses20250919Edit:
      properties:
        cleared_input_tokens:
          description: Number of input tokens cleared by this edit.
          minimum: 0
          title: Cleared Input Tokens
          type: integer
        cleared_tool_uses:
          description: Number of tool uses that were cleared.
          minimum: 0
          title: Cleared Tool Uses
          type: integer
        type:
          const: clear_tool_uses_20250919
          default: clear_tool_uses_20250919
          description: The type of context management edit applied.
          title: Type
          type: string
      required:
        - cleared_input_tokens
        - cleared_tool_uses
        - type
      title: ResponseClearToolUses20250919Edit
      type: object
    Skill:
      description: A skill that was loaded in a container (response model).
      properties:
        skill_id:
          description: Skill ID
          maxLength: 64
          minLength: 1
          title: Skill Id
          type: string
        type:
          description: >-
            Type of skill - either 'anthropic' (built-in) or 'custom'
            (user-defined)
          enum:
            - anthropic
            - custom
          title: Type
          type: string
        version:
          description: Skill version or 'latest' for most recent version
          maxLength: 64
          minLength: 1
          title: Version
          type: string
      required:
        - skill_id
        - type
        - version
      title: Skill
      type: object
    BetaImageBlockParam:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        source:
          anyOf:
            - $ref: '#/components/schemas/BetaBase64ImageSource'
            - $ref: '#/components/schemas/BetaURLImageSource'
            - $ref: '#/components/schemas/BetaFileImageSource'
        type:
          const: image
          type: string
      required:
        - source
        - type
      type: object
    BetaRequestDocumentBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaCitationsConfigParam'
            - type: 'null'
        context:
          type:
            - string
            - 'null'
        source:
          anyOf:
            - $ref: '#/components/schemas/BetaBase64PDFSource'
            - $ref: '#/components/schemas/BetaPlainTextSource'
            - $ref: '#/components/schemas/BetaContentBlockSource'
            - $ref: '#/components/schemas/BetaURLPDFSource'
            - $ref: '#/components/schemas/BetaFileDocumentSource'
        title:
          type:
            - string
            - 'null'
        type:
          const: document
          type: string
      required:
        - source
        - type
      type: object
    BetaSearchResultBlockParam:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        citations:
          $ref: '#/components/schemas/BetaCitationsConfigParam'
        content:
          items:
            $ref: '#/components/schemas/BetaTextBlockParam'
          type: array
        source:
          type: string
        title:
          type: string
        type:
          const: search_result
          type: string
      required:
        - content
        - source
        - title
        - type
      type: object
    BetaThinkingBlockParam:
      additionalProperties: false
      properties:
        signature:
          type: string
        thinking:
          type: string
        type:
          const: thinking
          type: string
      required:
        - signature
        - thinking
        - type
      type: object
    BetaRedactedThinkingBlockParam:
      additionalProperties: false
      properties:
        data:
          type: string
        type:
          const: redacted_thinking
          type: string
      required:
        - data
        - type
      type: object
    BetaToolUseBlockParam:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
          description: Tool invocation directly from the model.
        id:
          type: string
        input: {}
        name:
          type: string
        type:
          const: tool_use
          type: string
      required:
        - id
        - input
        - name
        - type
      type: object
    BetaToolResultBlockParam:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        content:
          anyOf:
            - type: string
            - items:
                anyOf:
                  - $ref: '#/components/schemas/BetaTextBlockParam'
                  - $ref: '#/components/schemas/BetaImageBlockParam'
                  - $ref: '#/components/schemas/BetaSearchResultBlockParam'
                  - $ref: '#/components/schemas/BetaRequestDocumentBlock'
                  - $ref: '#/components/schemas/BetaToolReferenceBlockParam'
              type: array
        is_error:
          type: boolean
        tool_use_id:
          type: string
        type:
          const: tool_result
          type: string
      required:
        - tool_use_id
        - type
      type: object
    BetaCitationCharLocationParam:
      additionalProperties: false
      properties:
        cited_text:
          type: string
        document_index:
          type: number
        document_title:
          type:
            - string
            - 'null'
        end_char_index:
          type: number
        start_char_index:
          type: number
        type:
          const: char_location
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_char_index
        - start_char_index
        - type
      type: object
    BetaCitationPageLocationParam:
      additionalProperties: false
      properties:
        cited_text:
          type: string
        document_index:
          type: number
        document_title:
          type:
            - string
            - 'null'
        end_page_number:
          type: number
        start_page_number:
          type: number
        type:
          const: page_location
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_page_number
        - start_page_number
        - type
      type: object
    BetaCitationContentBlockLocationParam:
      additionalProperties: false
      properties:
        cited_text:
          description: >-
            The full text of the cited block range, concatenated.


            Always equals the contents of
            `content[start_block_index:end_block_index]` joined together. The
            text block is the minimal citable unit; this field is never a
            substring of a single block. Not counted toward output tokens, and
            not counted toward input tokens when sent back in subsequent turns.
          type: string
        document_index:
          type: number
        document_title:
          type:
            - string
            - 'null'
        end_block_index:
          description: >-
            Exclusive 0-based end index of the cited block range in the source's
            `content` array.


            Always greater than `start_block_index`; a single-block citation has
            `end_block_index = start_block_index + 1`.
          type: number
        start_block_index:
          description: >-
            0-based index of the first cited block in the source's `content`
            array.
          type: number
        type:
          const: content_block_location
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_block_index
        - start_block_index
        - type
      type: object
    BetaCitationWebSearchResultLocationParam:
      additionalProperties: false
      properties:
        cited_text:
          type: string
        encrypted_index:
          type: string
        title:
          type:
            - string
            - 'null'
        type:
          const: web_search_result_location
          type: string
        url:
          type: string
      required:
        - cited_text
        - encrypted_index
        - title
        - type
        - url
      type: object
    BetaCitationSearchResultLocationParam:
      additionalProperties: false
      properties:
        cited_text:
          description: >-
            The full text of the cited block range, concatenated.


            Always equals the contents of
            `content[start_block_index:end_block_index]` joined together. The
            text block is the minimal citable unit; this field is never a
            substring of a single block. Not counted toward output tokens, and
            not counted toward input tokens when sent back in subsequent turns.
          type: string
        end_block_index:
          description: >-
            Exclusive 0-based end index of the cited block range in the source's
            `content` array.


            Always greater than `start_block_index`; a single-block citation has
            `end_block_index = start_block_index + 1`.
          type: number
        search_result_index:
          description: >-
            0-based index of the cited search result among all `search_result`
            content blocks in the request, in the order they appear across
            messages and tool results.


            Counted separately from `document_index`; server-side web search
            results are not included in this count.
          type: number
        source:
          type: string
        start_block_index:
          description: >-
            0-based index of the first cited block in the source's `content`
            array.
          type: number
        title:
          type:
            - string
            - 'null'
        type:
          const: search_result_location
          type: string
      required:
        - cited_text
        - end_block_index
        - search_result_index
        - source
        - start_block_index
        - title
        - type
      type: object
    WebSearchToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - max_uses_exceeded
        - too_many_requests
        - query_too_long
      title: WebSearchToolResultErrorCode
      type: string
    WebFetchToolResultErrorCode:
      enum:
        - invalid_tool_input
        - url_too_long
        - url_not_allowed
        - url_not_accessible
        - unsupported_content_type
        - too_many_requests
        - max_uses_exceeded
        - unavailable
      title: WebFetchToolResultErrorCode
      type: string
    ResponseDocumentBlock:
      properties:
        citations:
          anyOf:
            - $ref: '#/components/schemas/ResponseCitationsConfig'
            - type: 'null'
          default: null
          description: Citation configuration for the document
        source:
          discriminator:
            mapping:
              base64:
                $ref: '#/components/schemas/Base64PDFSource'
              text:
                $ref: '#/components/schemas/PlainTextSource'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/Base64PDFSource'
            - $ref: '#/components/schemas/PlainTextSource'
          title: Source
        title:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The title of the document
          title: Title
        type:
          const: document
          default: document
          title: Type
          type: string
      required:
        - citations
        - source
        - title
        - type
      title: ResponseDocumentBlock
      type: object
    CodeExecutionToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
      title: CodeExecutionToolResultErrorCode
      type: string
    ResponseCodeExecutionOutputBlock:
      properties:
        file_id:
          title: File Id
          type: string
        type:
          const: code_execution_output
          default: code_execution_output
          title: Type
          type: string
      required:
        - file_id
        - type
      title: ResponseCodeExecutionOutputBlock
      type: object
    BashCodeExecutionToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
        - output_file_too_large
      title: BashCodeExecutionToolResultErrorCode
      type: string
    ResponseBashCodeExecutionOutputBlock:
      properties:
        file_id:
          title: File Id
          type: string
        type:
          const: bash_code_execution_output
          default: bash_code_execution_output
          title: Type
          type: string
      required:
        - file_id
        - type
      title: ResponseBashCodeExecutionOutputBlock
      type: object
    TextEditorCodeExecutionToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
        - file_not_found
      title: TextEditorCodeExecutionToolResultErrorCode
      type: string
    BetaBase64ImageSource:
      additionalProperties: false
      properties:
        data:
          type: string
        media_type:
          enum:
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
          type: string
        type:
          const: base64
          type: string
      required:
        - data
        - media_type
        - type
      type: object
    BetaURLImageSource:
      additionalProperties: false
      properties:
        type:
          const: url
          type: string
        url:
          type: string
      required:
        - type
        - url
      type: object
    BetaFileImageSource:
      additionalProperties: false
      properties:
        file_id:
          type: string
        type:
          const: file
          type: string
      required:
        - file_id
        - type
      type: object
    BetaCitationsConfigParam:
      additionalProperties: false
      properties:
        enabled:
          type: boolean
      type: object
    BetaBase64PDFSource:
      additionalProperties: false
      properties:
        data:
          type: string
        media_type:
          const: application/pdf
          type: string
        type:
          const: base64
          type: string
      required:
        - data
        - media_type
        - type
      type: object
    BetaPlainTextSource:
      additionalProperties: false
      properties:
        data:
          type: string
        media_type:
          const: text/plain
          type: string
        type:
          const: text
          type: string
      required:
        - data
        - media_type
        - type
      type: object
    BetaContentBlockSource:
      additionalProperties: false
      properties:
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/BetaContentBlockSourceContent'
              type: array
        type:
          const: content
          type: string
      required:
        - content
        - type
      type: object
    BetaURLPDFSource:
      additionalProperties: false
      properties:
        type:
          const: url
          type: string
        url:
          type: string
      required:
        - type
        - url
      type: object
    BetaFileDocumentSource:
      additionalProperties: false
      properties:
        file_id:
          type: string
        type:
          const: file
          type: string
      required:
        - file_id
        - type
      type: object
    BetaDirectCaller:
      additionalProperties: false
      description: Tool invocation directly from the model.
      properties:
        type:
          const: direct
          type: string
      required:
        - type
      type: object
    BetaServerToolCaller:
      additionalProperties: false
      description: Tool invocation generated by a server-side tool.
      properties:
        tool_id:
          type: string
        type:
          const: code_execution_20250825
          type: string
      required:
        - tool_id
        - type
      type: object
    BetaServerToolCaller20260120:
      additionalProperties: false
      properties:
        tool_id:
          type: string
        type:
          const: code_execution_20260120
          type: string
      required:
        - tool_id
        - type
      type: object
    BetaToolReferenceBlockParam:
      additionalProperties: false
      description: Tool reference block that can be included in tool_result content.
      properties:
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: Create a cache control breakpoint at this content block.
        tool_name:
          type: string
        type:
          const: tool_reference
          type: string
      required:
        - tool_name
        - type
      type: object
    ResponseCitationsConfig:
      properties:
        enabled:
          default: false
          title: Enabled
          type: boolean
      required:
        - enabled
      title: ResponseCitationsConfig
      type: object
    Base64PDFSource:
      additionalProperties: false
      properties:
        data:
          format: byte
          title: Data
          type: string
        media_type:
          const: application/pdf
          title: Media Type
          type: string
        type:
          const: base64
          title: Type
          type: string
      required:
        - data
        - media_type
        - type
      title: PDF (base64)
      type: object
    PlainTextSource:
      additionalProperties: false
      properties:
        data:
          title: Data
          type: string
        media_type:
          const: text/plain
          title: Media Type
          type: string
        type:
          const: text
          title: Type
          type: string
      required:
        - data
        - media_type
        - type
      title: Plain text
      type: object
    BetaContentBlockSourceContent:
      anyOf:
        - $ref: '#/components/schemas/BetaTextBlockParam'
        - $ref: '#/components/schemas/BetaImageBlockParam'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##All APIs require Bearer Token authentication##


        **Get API Key:**


        Visit [API Key Management Page](https://evolink.ai/dashboard/keys) to
        get your API Key


        **Add to request header:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````