> ## 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.

# MiniMax-M3.1-Flash - Responses API

> - Call MiniMax-M3.1-Flash using the OpenAI Responses protocol
- **Input**: `input` accepts plain text or an array of input items (messages, function calls, and function results)
- **Multimodal input**: combine `input_text`, `input_image`, and `input_video` blocks in message `content`
- **System instructions**: use `instructions`, equivalent to an initial system message
- **Reasoning**: always enabled; adjust depth with `reasoning.effort`. Reasoning is returned as `reasoning` output items
- **Streaming**: semantic SSE events ending with `response.completed`, without a `[DONE]` marker
- **Tool calling**: Function Calling
- **Context caching**: matching prefixes are cached automatically; cached tokens are reported in `usage.input_tokens_details.cached_tokens`

**Stateless requests**: Responses are not stored and `previous_response_id` is not supported. For each turn, append every item from the previous `output` to `input` in its original order, preserving all fields, including `content`, `summary`, and `encrypted_content` in reasoning items. After executing a tool, append a `function_call_output` item with the same `call_id` as the function call.

**Streaming events**: `response.created`, `response.in_progress`, `response.output_item.added`, `response.content_part.added`, `response.reasoning_text.delta` / `response.reasoning_text.done`, `response.output_text.delta` / `response.output_text.done`, `response.content_part.done`, and `response.output_item.done`, ending with `response.completed`. Each event includes a `sequence_number` for ordering.

<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/minimax-m3.1-flash/minimax-m3.1-flash-responses.json POST /v1/responses
openapi: 3.1.0
info:
  title: MiniMax-M3.1-Flash API Reference (Responses API)
  description: >-
    Complete API reference for MiniMax-M3.1-Flash using the Responses API.


    **Model capabilities**:

    - Context window: **1,000,000 tokens** (1M)

    - Maximum output: **524,288 tokens** (512K); **131,072 tokens** (128K)
    recommended, including reasoning tokens

    - Reasoning: always enabled; adjust depth with `reasoning.effort`, which
    defaults to `max`

    - Multimodal input: text, images, and video

    - Tool calling: Function Calling

    - Context caching: matching prefixes are cached automatically and billed at
    the cache-hit rate


    **Stateless requests**: Responses are not stored. Include the complete
    conversation history with each request.
  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: Chat Completion
    description: AI chat completion related endpoints
paths:
  /v1/responses:
    post:
      tags:
        - Chat Completion
      summary: MiniMax-M3.1-Flash Responses API (OpenAI Compatible)
      description: >-
        - Call MiniMax-M3.1-Flash using the OpenAI Responses protocol

        - **Input**: `input` accepts plain text or an array of input items
        (messages, function calls, and function results)

        - **Multimodal input**: combine `input_text`, `input_image`, and
        `input_video` blocks in message `content`

        - **System instructions**: use `instructions`, equivalent to an initial
        system message

        - **Reasoning**: always enabled; adjust depth with `reasoning.effort`.
        Reasoning is returned as `reasoning` output items

        - **Streaming**: semantic SSE events ending with `response.completed`,
        without a `[DONE]` marker

        - **Tool calling**: Function Calling

        - **Context caching**: matching prefixes are cached automatically;
        cached tokens are reported in `usage.input_tokens_details.cached_tokens`


        **Stateless requests**: Responses are not stored and
        `previous_response_id` is not supported. For each turn, append every
        item from the previous `output` to `input` in its original order,
        preserving all fields, including `content`, `summary`, and
        `encrypted_content` in reasoning items. After executing a tool, append a
        `function_call_output` item with the same `call_id` as the function
        call.


        **Streaming events**: `response.created`, `response.in_progress`,
        `response.output_item.added`, `response.content_part.added`,
        `response.reasoning_text.delta` / `response.reasoning_text.done`,
        `response.output_text.delta` / `response.output_text.done`,
        `response.content_part.done`, and `response.output_item.done`, ending
        with `response.completed`. Each event includes a `sequence_number` for
        ordering.
      operationId: createResponseMiniMaxM31Flash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              simple_text:
                summary: Single-turn text conversation
                value:
                  model: MiniMax-M3.1-Flash
                  input: Explain recursion in one sentence.
                  max_output_tokens: 131072
              with_instructions:
                summary: Using system instructions
                value:
                  model: MiniMax-M3.1-Flash
                  instructions: >-
                    You are a technical documentation assistant. Keep your
                    answers concise.
                  input: Explain how context caching works.
                  max_output_tokens: 131072
              multi_turn:
                summary: Multi-turn conversation (input item array)
                value:
                  model: MiniMax-M3.1-Flash
                  input:
                    - type: message
                      role: user
                      content: Suggest three names for a note-taking app.
                    - type: message
                      role: assistant
                      content: NoteFlow, ClearPage, QuickNote.
                    - type: message
                      role: user
                      content: Suggest five alternatives to the second name.
                  max_output_tokens: 131072
              reasoning_effort:
                summary: Adjust reasoning depth
                value:
                  model: MiniMax-M3.1-Flash
                  input: >-
                    A bat and a ball cost 1.10 in total. The bat costs 1.00 more
                    than the ball. How much does the ball cost?
                  reasoning:
                    effort: high
                  max_output_tokens: 131072
              vision_url:
                summary: Image understanding
                value:
                  model: MiniMax-M3.1-Flash
                  input:
                    - type: message
                      role: user
                      content:
                        - type: input_text
                          text: Describe this image.
                        - type: input_image
                          image_url: https://example.com/photo.jpg
                  max_output_tokens: 131072
              video_url:
                summary: Video understanding
                value:
                  model: MiniMax-M3.1-Flash
                  input:
                    - type: message
                      role: user
                      content:
                        - type: input_text
                          text: Summarize this video.
                        - type: input_video
                          video_url:
                            url: https://example.com/video.mp4
                            fps: 1
                            detail: default
                  max_output_tokens: 131072
              function_calling:
                summary: Function Calling (tool invocation)
                value:
                  model: MiniMax-M3.1-Flash
                  input: Check the stock for product demo-item-001.
                  tools:
                    - type: function
                      name: get_product_stock
                      description: Get the current stock level for a product.
                      parameters:
                        type: object
                        properties:
                          product_id:
                            type: string
                            description: Product identifier.
                        required:
                          - product_id
                  max_output_tokens: 131072
              function_result:
                summary: Continue with a tool execution result
                value:
                  model: MiniMax-M3.1-Flash
                  reasoning:
                    effort: medium
                  max_output_tokens: 131072
                  input:
                    - type: message
                      role: user
                      content: >-
                        Use get_product_stock to check product demo-item-001.
                        After receiving the tool result, report whether it is in
                        stock and its quantity. Do not guess the stock level.
                    - id: 0725233e825de1d0656437967fc024e1_msg
                      type: message
                      status: completed
                      role: assistant
                      content:
                        - type: output_text
                          text: I'll check the stock level for that product now.
                          annotations: []
                    - id: 0725233e825de1d0656437967fc024e1_fc_0
                      type: function_call
                      status: completed
                      call_id: call_function_izs7qcnzfksd_1
                      name: get_product_stock
                      arguments: '{"product_id": "demo-item-001"}'
                    - type: function_call_output
                      call_id: call_function_izs7qcnzfksd_1
                      output: >-
                        {"product_id": "demo-item-001", "in_stock": true,
                        "quantity": 24}
                  tools:
                    - type: function
                      name: get_product_stock
                      description: Get the current stock level for a product.
                      parameters:
                        type: object
                        properties:
                          product_id:
                            type: string
                            description: Product identifier.
                        required:
                          - product_id
                  tool_choice: auto
              streaming:
                summary: Streaming output
                value:
                  model: MiniMax-M3.1-Flash
                  input: Write a short poem about autumn.
                  stream: true
                  max_output_tokens: 131072
              reasoning_history:
                summary: Continue with complete reasoning history
                value:
                  model: MiniMax-M3.1-Flash
                  reasoning:
                    effort: medium
                  max_output_tokens: 131072
                  input:
                    - type: message
                      role: user
                      content: >-
                        Find the smallest positive integer n such that n mod 7 =
                        3, n mod 11 = 5, and n mod 13 = 7. Return only n.
                    - id: 0725233a85e23431681447327cbcd9d2_rs
                      type: reasoning
                      status: completed
                      summary: []
                      content:
                        - type: reasoning_text
                          text: >-
                            We need solve CRT. Need only n. Compute. n=3 mod7, 5
                            mod11,7 mod13. Product 1001. Let's solve.


                            Use n=3+7a. mod11: 3+7a=5 =>7a=2 mod11. inverse7=8
                            (56=1), a=16=5 mod11. a=5+11b. n=38+77b. mod13:
                            38+77b = 12+12b mod13 (77=12,38=12) equals7
                            =>12b=-5=8 mod13. inverse12=12, b=96 mod13 =5? 91
                            remainder5. n=38+385=423. Check 423 mod7 3 (420),
                            mod11 5 (418), mod13 7 (416). Smallest positive 423.
                            Only n.
                      encrypted_content: >-
                        Ahlub3JtYWwtcmVhc29uaW5nLTIwMjYxMDExjehfvIf2rUinmic9ZiAutly0DD3lHqWEni9ENDziUw0nX-F6VPZLM7x1NbRWbytJNcLH9XQIa-KLYgd-it6XmXzYLvck3xOPOG9wtDdxUnjdBhuuj9dkWrkx0kbK8MFT5UreZ7EcxoRZybrs3oELf2BK_WtDUFOm_FbZXKwNbg76pTCFDoRke0Er0GMWjmi5L8GE7hGnvvBQjHXrwQ88G0L2p6STay-n1FJ5prqz6Q4LEF-xu7FqGjDmh9haliI638ivcQ9XGo9_DLUrtKMh1K4UYN87j2H7vbjbJPJaw6oJ61ZF8Ngk1FSuHUvLB540QKwBJKnClMcvw-ih3CdKRdSTPRfIYlsYOkNCwEWrLwHarLTHG5HzeakMO_5usxOAvzXVDUKRIX7W62x9xKCnVl_Gp0E91dLtlU3U8j_ZZvYCj9pMvd_n_Ba82OUpFxvoXv2R2H1H8bfzztGg5E88fH6OMwoMS5OYa45nCoRFA11Bw7G8OEVqBiPzS48EY1JPjPTC5lBco0CUoeUAHPXeD7jmO-D3LhIL1-3erJ_mxP0ZeiCWUckYaFE2EliolooAHqkoVBmy5Q
                    - id: 0725233a85e23431681447327cbcd9d2_msg
                      type: message
                      status: completed
                      role: assistant
                      content:
                        - type: output_text
                          text: '423'
                          annotations: []
                    - type: message
                      role: user
                      content: Add one to that result. Return only the new integer.
      responses:
        '200':
          description: Generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
              examples:
                with_reasoning:
                  summary: Response with reasoning
                  value:
                    id: 0725233a85e23431681447327cbcd9d2
                    object: response
                    created_at: 1792405562
                    model: MiniMax-M3.1-Flash
                    status: completed
                    output:
                      - id: 0725233a85e23431681447327cbcd9d2_rs
                        type: reasoning
                        status: completed
                        summary: []
                        content:
                          - type: reasoning_text
                            text: >-
                              We need solve CRT. Need only n. Compute. n=3 mod7,
                              5 mod11,7 mod13. Product 1001. Let's solve.


                              Use n=3+7a. mod11: 3+7a=5 =>7a=2 mod11. inverse7=8
                              (56=1), a=16=5 mod11. a=5+11b. n=38+77b. mod13:
                              38+77b = 12+12b mod13 (77=12,38=12) equals7
                              =>12b=-5=8 mod13. inverse12=12, b=96 mod13 =5? 91
                              remainder5. n=38+385=423. Check 423 mod7 3 (420),
                              mod11 5 (418), mod13 7 (416). Smallest positive
                              423. Only n.
                        encrypted_content: >-
                          Ahlub3JtYWwtcmVhc29uaW5nLTIwMjYxMDExjehfvIf2rUinmic9ZiAutly0DD3lHqWEni9ENDziUw0nX-F6VPZLM7x1NbRWbytJNcLH9XQIa-KLYgd-it6XmXzYLvck3xOPOG9wtDdxUnjdBhuuj9dkWrkx0kbK8MFT5UreZ7EcxoRZybrs3oELf2BK_WtDUFOm_FbZXKwNbg76pTCFDoRke0Er0GMWjmi5L8GE7hGnvvBQjHXrwQ88G0L2p6STay-n1FJ5prqz6Q4LEF-xu7FqGjDmh9haliI638ivcQ9XGo9_DLUrtKMh1K4UYN87j2H7vbjbJPJaw6oJ61ZF8Ngk1FSuHUvLB540QKwBJKnClMcvw-ih3CdKRdSTPRfIYlsYOkNCwEWrLwHarLTHG5HzeakMO_5usxOAvzXVDUKRIX7W62x9xKCnVl_Gp0E91dLtlU3U8j_ZZvYCj9pMvd_n_Ba82OUpFxvoXv2R2H1H8bfzztGg5E88fH6OMwoMS5OYa45nCoRFA11Bw7G8OEVqBiPzS48EY1JPjPTC5lBco0CUoeUAHPXeD7jmO-D3LhIL1-3erJ_mxP0ZeiCWUckYaFE2EliolooAHqkoVBmy5Q
                      - id: 0725233a85e23431681447327cbcd9d2_msg
                        type: message
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: '423'
                            annotations: []
                    output_text: '423'
                    usage:
                      input_tokens: 239
                      output_tokens: 190
                      total_tokens: 429
                      input_tokens_details:
                        cached_tokens: 174
                      output_tokens_details:
                        reasoning_tokens: 189
                    error: null
                    incomplete_details: null
                    instructions: null
                    metadata: {}
                    tools: null
                    tool_choice: auto
                    temperature: 1
                    top_p: 0.95
                    text:
                      format:
                        type: text
                    reasoning:
                      effort: medium
                      summary: null
                    max_output_tokens: 2048
                    max_tool_calls: null
                    parallel_tool_calls: true
                    previous_response_id: null
                    conversation: null
                    store: false
                    service_tier: null
                    safety_identifier: null
                    truncation: disabled
                function_call:
                  summary: Tool call
                  value:
                    id: 0725233e825de1d0656437967fc024e1
                    object: response
                    created_at: 1792405566
                    model: MiniMax-M3.1-Flash
                    status: completed
                    output:
                      - id: 0725233e825de1d0656437967fc024e1_msg
                        type: message
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: I'll check the stock level for that product now.
                            annotations: []
                      - id: 0725233e825de1d0656437967fc024e1_fc_0
                        type: function_call
                        status: completed
                        call_id: call_function_izs7qcnzfksd_1
                        name: get_product_stock
                        arguments: '{"product_id": "demo-item-001"}'
                    output_text: I'll check the stock level for that product now.
                    usage:
                      input_tokens: 479
                      output_tokens: 43
                      total_tokens: 522
                      input_tokens_details:
                        cached_tokens: 174
                    error: null
                    incomplete_details: null
                    instructions: null
                    metadata: {}
                    tools:
                      - type: function
                        name: get_product_stock
                        description: Get the current stock level for a product.
                        parameters:
                          properties:
                            product_id:
                              description: Product identifier.
                              type: string
                          required:
                            - product_id
                          type: object
                    tool_choice: auto
                    temperature: 1
                    top_p: 0.95
                    text:
                      format:
                        type: text
                    reasoning:
                      effort: medium
                      summary: null
                    max_output_tokens: 2048
                    max_tool_calls: null
                    parallel_tool_calls: true
                    previous_response_id: null
                    conversation: null
                    store: false
                    service_tier: null
                    safety_identifier: null
                    truncation: disabled
                incomplete:
                  summary: Output limit reached (status=incomplete)
                  value:
                    id: 072514375f41347e5f4de3c6ceb8fd87
                    object: response
                    created_at: 1792401719
                    model: MiniMax-M3.1-Flash
                    status: incomplete
                    output:
                      - id: 072514375f41347e5f4de3c6ceb8fd87_rs
                        type: reasoning
                        status: completed
                        summary: []
                        content:
                          - type: reasoning_text
                            text: I need to explain the process step by step.
                        encrypted_content: >-
                          Ahlub3JtYWwtcmVhc29uaW5nLTIwMjYxMDExv21cbZ66-fbVryqevLX4LJWxZguAnQBWN1xlN33KB5qCPkM8IMN2pVWWIclGFlVn6ZZ0CBzkPpHqkdCVqpYbDWc3gQl2Qmf0uD4s3wo
                    output_text: null
                    usage:
                      input_tokens: 211
                      output_tokens: 8
                      total_tokens: 219
                      input_tokens_details:
                        cached_tokens: 195
                      output_tokens_details:
                        reasoning_tokens: 8
                    error: null
                    incomplete_details:
                      reason: max_output_tokens
                    instructions: null
                    metadata: {}
                    tools: null
                    tool_choice: auto
                    temperature: 1
                    top_p: 0.95
                    text:
                      format:
                        type: text
                    reasoning:
                      effort: max
                      summary: null
                    max_output_tokens: 8
                    max_tool_calls: null
                    parallel_tool_calls: true
                    previous_response_id: null
                    conversation: null
                    store: false
                    service_tier: null
                    safety_identifier: null
                    truncation: disabled
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_prompt
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: Unauthenticated, invalid or expired token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid authentication credentials
                  type: authentication_error
        '402':
          description: Insufficient quota, recharge required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota
        '403':
          description: Access denied for this model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Model access denied
                  type: permission_error
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Model not found
                  type: not_found_error
        '413':
          description: Request body too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Request entity too large
                  type: invalid_request_error
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: server_error
        '502':
          description: Bad gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Bad gateway
                  type: server_error
        '503':
          description: Service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: server_error
components:
  schemas:
    ResponsesRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: Model ID.
          enum:
            - MiniMax-M3.1-Flash
          example: MiniMax-M3.1-Flash
        input:
          type:
            - string
            - array
          description: >-
            Model input.


            - **String**: treated as a single `user` message

            - **Array**: input items of type `message`, `function_call`,
            `function_call_output`, or `reasoning`


            **Multimodal input**: combine `input_text`, `input_image`, and
            `input_video` blocks in message `content`.


            **Conversation history**: requests are stateless. Include the
            complete history in the array for each turn.
          items:
            $ref: '#/components/schemas/InputItem'
          example: Explain recursion in one sentence.
        instructions:
          type: string
          description: >-
            System-level instructions, equivalent to a system message inserted
            at the very front; used to set the role, tone and output
            constraints.
          example: >-
            You are a technical documentation assistant. Keep your answers
            concise.
        stream:
          type: boolean
          description: >-
            Whether to stream the response.


            - `false` (default): return the complete response at once

            - `true`: send semantic SSE events ending with `response.completed`,
            without a `[DONE]` marker
          default: false
          example: false
        max_output_tokens:
          type: integer
          description: >-
            Maximum output tokens, **including reasoning and the final answer**.


            - Recommended: **131,072** (128K); maximum: **524,288** (512K)

            - A small budget may be exhausted during reasoning, resulting in
            `status: "incomplete"` without a `message` output item
          minimum: 1
          maximum: 524288
          example: 131072
        reasoning:
          type: object
          description: >-
            Reasoning configuration. MiniMax-M3.1-Flash always uses reasoning,
            returned as `reasoning` output items. Reasoning tokens count toward
            the output budget and are billed at the output rate.
          properties:
            effort:
              type: string
              description: >-
                Reasoning depth. Defaults to `max`. Higher levels typically
                increase reasoning token usage and response time.
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
              default: max
              example: high
        temperature:
          type: number
          description: Sampling temperature. Fixed at `1`.
          enum:
            - 1
          default: 1
          example: 1
        top_p:
          type: number
          description: Nucleus sampling threshold. Defaults to 0.95.
          minimum: 0
          maximum: 1
          default: 0.95
          example: 0.95
        tools:
          type: array
          description: >-
            Tools available to the model. Only `function` tools are supported.
            Execute the function on the client and return its result as a
            `function_call_output` input item.
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: string
          description: >-
            Tool selection strategy. Only `auto` is supported; the model decides
            whether to call a tool.
          enum:
            - auto
          default: auto
          example: auto
        text:
          type: object
          description: >-
            Text output format configuration. `format.type` only supports
            `text`.
          properties:
            format:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - text
                  default: text
                  description: Output format type
        metadata:
          type: object
          description: Request metadata. Keys and values must be strings.
          additionalProperties:
            type: string
    ResponsesResponse:
      type: object
      description: >-
        Responses API response object. In addition to the fields below, the
        response includes the request configuration, such as `tools`,
        `tool_choice`, `temperature`, `top_p`, `text`, `reasoning`, and
        `max_output_tokens`.
      properties:
        id:
          type: string
          description: Unique identifier for this response
          example: 072514d63605b7a0c83f1672230c398c
        object:
          type: string
          description: Object type, always `response`
          example: response
        created_at:
          type: integer
          description: Creation time as a Unix timestamp (seconds)
          example: 1792401878
        status:
          type: string
          description: |-
            Response status.

            - `completed`: generation completed
            - `incomplete`: generation was truncated; see `incomplete_details`
            - `failed`: generation failed; see `error`
          enum:
            - completed
            - incomplete
            - failed
          example: completed
        model:
          type: string
          description: ID of the model that actually generated this response
          example: MiniMax-M3.1-Flash
        output:
          type: array
          description: >-
            Output items in generation order:


            - `reasoning`: reasoning content, with an ID such as `<id>_rs`,
            `content` (`reasoning_text` blocks), `summary` (an empty array), and
            `encrypted_content`

            - `message`: final answer, with an ID such as `<id>_msg` and
            `content` (`output_text` blocks)

            - `function_call`: a function call, with an ID such as
            `<id>_fc_<index>`, `call_id`, `name`, and `arguments`. Execute it on
            the client and return a `function_call_output` item
          items:
            type: object
        output_text:
          type:
            - string
            - 'null'
          description: >-
            Convenience field containing all `output_text` blocks concatenated.
            `null` when there is no text output.
        error:
          type:
            - object
            - 'null'
          description: Failure reason; `null` on success
        incomplete_details:
          type:
            - object
            - 'null'
          description: >-
            Truncation details, or `null` if generation was not truncated.
            `reason` is `max_output_tokens` (output limit reached) or
            `content_filter` (content safety).
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      description: Error response
      properties:
        error:
          type: object
          properties:
            code:
              type:
                - integer
                - string
                - 'null'
              description: Error code
              example: invalid_prompt
            message:
              type: string
              description: Error description
              example: Invalid request parameters
            type:
              type: string
              description: Error type
              example: invalid_request_error
    InputItem:
      title: Input item
      description: >-
        Input item: a message, reasoning history, function call, or function
        result.
      oneOf:
        - $ref: '#/components/schemas/MessageItem'
        - $ref: '#/components/schemas/ReasoningItem'
        - $ref: '#/components/schemas/FunctionCallItem'
        - $ref: '#/components/schemas/FunctionCallOutputItem'
    Tool:
      type: object
      title: Tool definition
      required:
        - type
        - name
      properties:
        type:
          type: string
          description: Tool type. Only `function` is supported.
          enum:
            - function
          example: function
        name:
          type: string
          description: Function name
          example: get_product_stock
        description:
          type: string
          description: Function description to help the model decide when to call it.
          example: Get the current stock level for a product.
        parameters:
          type: object
          description: Parameter definition in JSON Schema format.
          example:
            type: object
            properties:
              product_id:
                type: string
                description: Product identifier.
            required:
              - product_id
    Usage:
      type: object
      description: Token usage statistics, including caching and reasoning details.
      properties:
        input_tokens:
          type: integer
          description: Total input tokens, including cached tokens.
          example: 207
        input_tokens_details:
          type: object
          description: Detailed breakdown of input tokens
          properties:
            cached_tokens:
              type: integer
              description: >-
                Number of cached input tokens.


                Cached tokens are billed at the cache-hit rate. Uncached tokens
                (`input_tokens - cached_tokens`) are billed at the standard
                input rate.
              example: 174
        output_tokens:
          type: integer
          description: Number of output tokens (including the thinking portion)
          example: 32
        output_tokens_details:
          type: object
          description: Detailed breakdown of output tokens
          properties:
            reasoning_tokens:
              type: integer
              description: Reasoning tokens, already included in `output_tokens`.
              example: 9
        total_tokens:
          type: integer
          description: Total tokens = input_tokens + output_tokens
          example: 239
    MessageItem:
      type: object
      title: Message item
      description: >-
        A conversation message. Preserve every returned field when sending
        assistant history.
      required:
        - role
        - content
      properties:
        type:
          type: string
          enum:
            - message
          default: message
        id:
          type: string
          description: Output item ID. Preserve it in conversation history.
        status:
          type: string
          description: Output item status. Preserve it in conversation history.
        role:
          type: string
          description: >-
            Message role, used only with `type: message`. `developer` is treated
            as `system`.
          enum:
            - user
            - assistant
            - system
            - developer
          example: user
        content:
          type:
            - string
            - array
          description: >-
            Message content, used only for `type: message`. Accepts plain text
            or an array of content blocks.


            **Content block types**:

            - `input_text`: text in the `text` field

            - `input_image`: image in the `image_url` field

            - `input_video`: video in the `video_url` field

            - `output_text`: text from an assistant message in conversation
            history


            Maximum request body size: 64 MB.
          items:
            $ref: '#/components/schemas/ContentPart'
          example: Explain recursion in one sentence.
    ReasoningItem:
      type: object
      title: Reasoning item
      description: >-
        Reasoning returned in the previous turn. Preserve the complete item,
        including `id`, `status`, `summary`, `content`, and `encrypted_content`,
        when continuing the conversation.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - reasoning
        id:
          type: string
          description: Output item ID. Preserve it in conversation history.
        status:
          type: string
          description: Output item status. Preserve it in conversation history.
        summary:
          type: array
          description: >-
            Reasoning summary. Preserve it unchanged when passing conversation
            history.
          items:
            type: object
        content:
          type: array
          description: Reasoning content blocks. Preserve them in conversation history.
          items:
            $ref: '#/components/schemas/ReasoningContentPart'
        encrypted_content:
          type: string
          description: Opaque reasoning data. Preserve it in conversation history.
    FunctionCallItem:
      type: object
      title: Function call item
      description: >-
        A function call returned by the model, paired with a
        `function_call_output` item through `call_id`.
      required:
        - type
        - call_id
        - name
        - arguments
      properties:
        type:
          type: string
          enum:
            - function_call
        id:
          type: string
          description: Output item ID. Preserve it in conversation history.
        status:
          type: string
          description: Output item status. Preserve it in conversation history.
        call_id:
          type: string
          description: >-
            Function call identifier; `function_call` and `function_call_output`
            are paired through it.
        name:
          type: string
          description: 'Name of the called function, used only with `type: function_call`.'
        arguments:
          type: string
          description: >-
            Function call arguments as a JSON string, used only with `type:
            function_call`.
    FunctionCallOutputItem:
      type: object
      title: Function result item
      description: >-
        The result of a function executed by the client, paired with its
        function call through `call_id`.
      required:
        - type
        - call_id
        - output
      properties:
        type:
          type: string
          enum:
            - function_call_output
        call_id:
          type: string
          description: >-
            Function call identifier; `function_call` and `function_call_output`
            are paired through it.
        output:
          type: string
          description: >-
            Function execution result, used only with `type:
            function_call_output`.
    ContentPart:
      type: object
      title: Content block
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - input_text
            - input_image
            - input_video
            - output_text
          description: Content block type.
        text:
          type: string
          description: Text content (`input_text` / `output_text`).
        image_url:
          description: >-
            Image input for `type: input_image`. Accepts a URL / Base64 data URL
            string, or an object such as `{"url": "...", "detail": "low |
            default | high"}` to control resolution. Higher resolution increases
            detail and token usage. Supports JPEG / PNG / GIF / WEBP, up to 10
            MB per image.
          oneOf:
            - type: string
            - type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: Image URL or Base64 data URL.
                detail:
                  type: string
                  enum:
                    - low
                    - default
                    - high
                  default: default
                  description: Resolution level.
        video_url:
          description: >-
            Video input for `type: input_video`. Accepts a URL / Base64 data URL
            string, or an object with `url`, `fps`, `detail`, and
            `max_long_side_pixel`. `fps` is the frame sampling rate, with a
            default of 1 and a range of [0.2, 5]. Lower rates use fewer tokens.
            Supports MP4 / AVI / MOV / MKV, up to 50 MB for URL / Base64 input.
            Use an `mm_file://{file_id}` reference for larger videos.
          oneOf:
            - type: string
            - type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: >-
                    Video URL, Base64 data URL, or `mm_file://{file_id}`
                    reference.
                fps:
                  type: number
                  minimum: 0.2
                  maximum: 5
                  default: 1
                  description: Frame sampling rate.
                detail:
                  type: string
                  enum:
                    - low
                    - default
                    - high
                  default: default
                  description: Resolution level.
                max_long_side_pixel:
                  type: integer
                  minimum: 1
                  description: Maximum length of a video frame's longest side, in pixels.
    ReasoningContentPart:
      type: object
      title: Reasoning content block
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - reasoning_text
        text:
          type: string
          description: Reasoning text.
  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

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.