> ## 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 接口

> - 使用 OpenAI Responses 协议调用 MiniMax-M3.1-Flash 模型
- **输入形态**：`input` 可以是一段纯文本，也可以是输入项数组（消息、函数调用、函数结果）
- **多模态输入**：在消息的 `content` 中混合 `input_text`、`input_image`、`input_video` 内容块
- **系统指令**：通过 `instructions` 下达，等价于首条 system 消息
- **思考模式**：始终开启，`reasoning.effort` 调节思考深度；思考内容以 `reasoning` 输出项返回
- **流式输出**：语义化 SSE 事件，以 `response.completed` 结束，**不发送 `[DONE]`**
- **工具调用**：支持 Function Calling
- **上下文缓存**：相同前缀自动命中，命中部分体现在 `usage.input_tokens_details.cached_tokens`

**无状态**：不保存响应，不支持 `previous_response_id`。多轮对话时，将上一轮 `output` 中的所有项按顺序原样追加到 `input`，保留 `reasoning` 项中的 `content`、`summary` 和 `encrypted_content` 等字段。执行工具后，再追加与函数调用项 `call_id` 相同的 `function_call_output` 项。

**流式事件**：`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`、`response.output_item.done`，终止事件为 `response.completed`。每个事件都带 `sequence_number` 用于排序。

<Note>
  **BaseURL 说明**：默认 BaseURL 为 `https://direct.evolink.ai`，对文本模型支持更好，支持长连接；`https://api.evolink.ai` 是多模态主力地址，对文本模型作为备用地址使用。
</Note>


## OpenAPI

````yaml cn/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 完整参数文档 (Responses API)
  description: |-
    MiniMax-M3.1-Flash Responses 接口的完整 API 参考。

    **模型能力**：
    - 上下文长度：**1,000,000 tokens**（1M）
    - 最大输出：**524,288 tokens**（512K），推荐 **131,072 tokens**（128K），思考 token 计入其中
    - 思考模式：始终开启，通过 `reasoning.effort` 调节思考深度，默认 `max`
    - 多模态输入：支持文本、图像、视频
    - 工具调用：支持 Function Calling
    - 上下文缓存：相同前缀自动命中，命中部分按缓存命中价计费

    **无状态**：不保存响应，多轮对话需要客户端每次携带完整历史。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 生产环境（推荐）
  - url: https://api.evolink.ai
    description: 备用地址
security:
  - bearerAuth: []
tags:
  - name: 对话生成
    description: AI 对话生成相关接口
paths:
  /v1/responses:
    post:
      tags:
        - 对话生成
      summary: MiniMax-M3.1-Flash Responses 接口（OpenAI 兼容）
      description: >-
        - 使用 OpenAI Responses 协议调用 MiniMax-M3.1-Flash 模型

        - **输入形态**：`input` 可以是一段纯文本，也可以是输入项数组（消息、函数调用、函数结果）

        - **多模态输入**：在消息的 `content` 中混合 `input_text`、`input_image`、`input_video`
        内容块

        - **系统指令**：通过 `instructions` 下达，等价于首条 system 消息

        - **思考模式**：始终开启，`reasoning.effort` 调节思考深度；思考内容以 `reasoning` 输出项返回

        - **流式输出**：语义化 SSE 事件，以 `response.completed` 结束，**不发送 `[DONE]`**

        - **工具调用**：支持 Function Calling

        - **上下文缓存**：相同前缀自动命中，命中部分体现在 `usage.input_tokens_details.cached_tokens`


        **无状态**：不保存响应，不支持 `previous_response_id`。多轮对话时，将上一轮 `output`
        中的所有项按顺序原样追加到 `input`，保留 `reasoning` 项中的 `content`、`summary` 和
        `encrypted_content` 等字段。执行工具后，再追加与函数调用项 `call_id` 相同的
        `function_call_output` 项。


        **流式事件**：`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`、`response.output_item.done`，终止事件为
        `response.completed`。每个事件都带 `sequence_number` 用于排序。
      operationId: createResponseMiniMaxM31Flash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              simple_text:
                summary: 单轮文本对话
                value:
                  model: MiniMax-M3.1-Flash
                  input: Explain recursion in one sentence.
                  max_output_tokens: 131072
              with_instructions:
                summary: 使用系统指令
                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: 多轮对话（输入项数组）
                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: 调节思考深度
                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: 图像理解
                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: 视频理解
                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 工具调用
                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: 回传工具执行结果并续答
                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: 流式输出
                value:
                  model: MiniMax-M3.1-Flash
                  input: Write a short poem about autumn.
                  stream: true
                  max_output_tokens: 131072
              reasoning_history:
                summary: 携带完整思考历史继续对话
                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: 生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
              examples:
                with_reasoning:
                  summary: 包含思考内容
                  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: 触发工具调用
                  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: 达到输出上限（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: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_prompt
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未认证、Token 无效或过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid authentication credentials
                  type: authentication_error
        '402':
          description: 配额不足、需要充值
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota
        '403':
          description: 无权限访问该模型
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Model access denied
                  type: permission_error
        '404':
          description: 资源不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Model not found
                  type: not_found_error
        '413':
          description: 请求体过大
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Request entity too large
                  type: invalid_request_error
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: server_error
        '502':
          description: 网关错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Bad gateway
                  type: server_error
        '503':
          description: 服务暂时不可用
          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: 模型 ID
          enum:
            - MiniMax-M3.1-Flash
          example: MiniMax-M3.1-Flash
        input:
          type:
            - string
            - array
          description: >-
            模型输入


            - **字符串形态**：整段文本按一条 `user` 消息处理

            - **数组形态**：输入项列表，支持
            `message`、`function_call`、`function_call_output`、`reasoning`


            **多模态**：在 `message` 项的 `content` 数组里混合
            `input_text`、`input_image`、`input_video` 块。


            **多轮对话**：接口无状态，续接对话必须把完整历史放进数组。
          items:
            $ref: '#/components/schemas/InputItem'
          example: Explain recursion in one sentence.
        instructions:
          type: string
          description: 系统级指令，等价于插入在最前面的一条 system 消息，用于设定角色、语气与输出约束。
          example: >-
            You are a technical documentation assistant. Keep your answers
            concise.
        stream:
          type: boolean
          description: |-
            是否流式返回

            - `false`（默认）：一次性返回完整响应对象
            - `true`：以语义化 SSE 事件推送，终止事件为 `response.completed`，**不会发送 `[DONE]`**
          default: false
          example: false
        max_output_tokens:
          type: integer
          description: |-
            本次生成的最大输出 token 数，**包含思考和回答**

            - 推荐 **131,072**（128K），最大 **524,288**（512K）
            - 取值过小时可能在思考阶段就达到上限，返回 `status: "incomplete"` 且没有 `message` 输出项
          minimum: 1
          maximum: 524288
          example: 131072
        reasoning:
          type: object
          description: >-
            思考配置。MiniMax-M3.1-Flash 始终进行思考，思考内容以 `reasoning` 输出项返回，其 token
            计入输出并按输出价计费。
          properties:
            effort:
              type: string
              description: 思考深度，默认 `max`。较高档位通常会增加思考 token 消耗和响应时间。
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
              default: max
              example: high
        temperature:
          type: number
          description: 采样温度，固定为 `1`
          enum:
            - 1
          default: 1
          example: 1
        top_p:
          type: number
          description: 核采样阈值，默认 0.95。
          minimum: 0
          maximum: 1
          default: 0.95
          example: 0.95
        tools:
          type: array
          description: >-
            可供模型调用的工具列表，目前只支持 `function` 类型。函数由客户端执行，并把结果以
            `function_call_output` 输入项回传。
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: string
          description: 工具选择策略，仅支持 `auto`（由模型决定是否调用工具）
          enum:
            - auto
          default: auto
          example: auto
        text:
          type: object
          description: 文本输出格式配置，`format.type` 仅支持 `text`
          properties:
            format:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - text
                  default: text
                  description: 输出格式类型
        metadata:
          type: object
          description: 请求元数据，键和值都是字符串
          additionalProperties:
            type: string
    ResponsesResponse:
      type: object
      description: >-
        Responses
        接口的响应对象。除下列字段外，响应还会回显本次请求的配置（`tools`、`tool_choice`、`temperature`、`top_p`、`text`、`reasoning`、`max_output_tokens`
        等）。
      properties:
        id:
          type: string
          description: 本次响应的唯一标识
          example: 072514d63605b7a0c83f1672230c398c
        object:
          type: string
          description: 对象类型，固定为 `response`
          example: response
        created_at:
          type: integer
          description: 创建时间，Unix 时间戳（秒）
          example: 1792401878
        status:
          type: string
          description: |-
            响应状态

            - `completed`：正常完成
            - `incomplete`：被截断，原因见 `incomplete_details`
            - `failed`：生成失败，原因见 `error`
          enum:
            - completed
            - incomplete
            - failed
          example: completed
        model:
          type: string
          description: 实际生成本次响应的模型 ID
          example: MiniMax-M3.1-Flash
        output:
          type: array
          description: >-
            输出项列表，按生成顺序排列：


            - `reasoning`：思考过程，id 形如 `<id>_rs`，含 `content`（`reasoning_text`
            块列表）、`summary`（空数组）、`encrypted_content`

            - `message`：最终回答，id 形如 `<id>_msg`，含 `content`（`output_text` 块列表）

            - `function_call`：模型发起的函数调用，id 形如 `<id>_fc_<序号>`，含
            `call_id`、`name`、`arguments`，需客户端执行后以 `function_call_output` 回传
          items:
            type: object
        output_text:
          type:
            - string
            - 'null'
          description: 便捷字段：所有 `output_text` 文本拼接后的结果；没有文本输出时为 `null`
        error:
          type:
            - object
            - 'null'
          description: 失败原因，成功时为 `null`
        incomplete_details:
          type:
            - object
            - 'null'
          description: >-
            截断原因，未截断时为 `null`。`reason` 为 `max_output_tokens`（输出达到上限）或
            `content_filter`（内容安全）
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      description: 错误响应
      properties:
        error:
          type: object
          properties:
            code:
              type:
                - integer
                - string
                - 'null'
              description: 错误代码
              example: invalid_prompt
            message:
              type: string
              description: 错误描述
              example: Invalid request parameters
            type:
              type: string
              description: 错误类型
              example: invalid_request_error
    InputItem:
      title: 输入项
      description: 输入项：消息、思考历史、函数调用或函数执行结果。
      oneOf:
        - $ref: '#/components/schemas/MessageItem'
        - $ref: '#/components/schemas/ReasoningItem'
        - $ref: '#/components/schemas/FunctionCallItem'
        - $ref: '#/components/schemas/FunctionCallOutputItem'
    Tool:
      type: object
      title: 工具定义
      required:
        - type
        - name
      properties:
        type:
          type: string
          description: 工具类型，目前只支持 `function`
          enum:
            - function
          example: function
        name:
          type: string
          description: 函数名称
          example: get_product_stock
        description:
          type: string
          description: 函数用途说明，写清楚有助于模型判断何时调用。
          example: Get the current stock level for a product.
        parameters:
          type: object
          description: 参数定义，JSON Schema 格式。
          example:
            type: object
            properties:
              product_id:
                type: string
                description: Product identifier.
            required:
              - product_id
    Usage:
      type: object
      description: Token 使用统计信息（含缓存与思考分项）
      properties:
        input_tokens:
          type: integer
          description: 输入 token 总数（含缓存命中部分）
          example: 207
        input_tokens_details:
          type: object
          description: 输入 token 详细分项
          properties:
            cached_tokens:
              type: integer
              description: |-
                命中缓存的输入 token 数

                命中部分按缓存命中价计费；未命中部分 = `input_tokens - cached_tokens`，按标准输入价计费
              example: 174
        output_tokens:
          type: integer
          description: 输出 token 数量（含思考部分）
          example: 32
        output_tokens_details:
          type: object
          description: 输出 token 详细分项
          properties:
            reasoning_tokens:
              type: integer
              description: 思考产生的 token 数（已计入 `output_tokens`）
              example: 9
        total_tokens:
          type: integer
          description: 总 token 数量 = input_tokens + output_tokens
          example: 239
    MessageItem:
      type: object
      title: 消息项
      description: 对话消息。回传历史助手消息时保留返回项的完整字段。
      required:
        - role
        - content
      properties:
        type:
          type: string
          enum:
            - message
          default: message
        id:
          type: string
          description: 输出项标识，回传历史时保持不变。
        status:
          type: string
          description: 输出项状态，回传历史时保持不变。
        role:
          type: string
          description: '消息角色，仅 `type: message` 使用。`developer` 按 `system` 处理。'
          enum:
            - user
            - assistant
            - system
            - developer
          example: user
        content:
          type:
            - string
            - array
          description: |-
            消息内容，仅 `type: message` 使用。可以是纯文本，也可以是内容块数组。

            **内容块类型**：
            - `input_text`：文本，字段 `text`
            - `input_image`：图片，字段 `image_url`
            - `input_video`：视频，字段 `video_url`
            - `output_text`：assistant 历史回复中的文本

            请求体最大 64 MB。
          items:
            $ref: '#/components/schemas/ContentPart'
          example: Explain recursion in one sentence.
    ReasoningItem:
      type: object
      title: 思考项
      description: >-
        上一轮返回的思考项。续答时按返回结构原样回传，包括 `id`、`status`、`summary`、`content` 和
        `encrypted_content`。
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - reasoning
        id:
          type: string
          description: 输出项标识，回传历史时保持不变。
        status:
          type: string
          description: 输出项状态，回传历史时保持不变。
        summary:
          type: array
          description: 思考摘要，回传历史时保持原样。
          items:
            type: object
        content:
          type: array
          description: 思考内容块，回传历史时保持原样。
          items:
            $ref: '#/components/schemas/ReasoningContentPart'
        encrypted_content:
          type: string
          description: 不透明的思考数据，回传历史时保持原样。
    FunctionCallItem:
      type: object
      title: 函数调用项
      description: 模型返回的函数调用，通过 `call_id` 与 `function_call_output` 项关联。
      required:
        - type
        - call_id
        - name
        - arguments
      properties:
        type:
          type: string
          enum:
            - function_call
        id:
          type: string
          description: 输出项标识，回传历史时保持不变。
        status:
          type: string
          description: 输出项状态，回传历史时保持不变。
        call_id:
          type: string
          description: 函数调用标识，`function_call` 与 `function_call_output` 通过它配对。
        name:
          type: string
          description: '被调用的函数名，仅 `type: function_call` 使用。'
        arguments:
          type: string
          description: '函数调用参数，JSON 字符串，仅 `type: function_call` 使用。'
    FunctionCallOutputItem:
      type: object
      title: 函数执行结果项
      description: 客户端执行函数后的结果，通过 `call_id` 与对应的函数调用项关联。
      required:
        - type
        - call_id
        - output
      properties:
        type:
          type: string
          enum:
            - function_call_output
        call_id:
          type: string
          description: 函数调用标识，`function_call` 与 `function_call_output` 通过它配对。
        output:
          type: string
          description: '函数执行结果，仅 `type: function_call_output` 使用。'
    ContentPart:
      type: object
      title: 内容块
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - input_text
            - input_image
            - input_video
            - output_text
          description: 内容块类型
        text:
          type: string
          description: 文本内容（`input_text` / `output_text`）
        image_url:
          description: >-
            图片输入，`type: input_image` 时使用。可直接传 URL / Base64 data URL 字符串，或传对象
            `{"url": "...", "detail": "low | default | high"}`
            控制解析精度（越高越细致，token 越多）。支持 JPEG / PNG / GIF / WEBP，单张最大 10 MB
          oneOf:
            - type: string
            - type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: 图片 URL 或 Base64 data URL
                detail:
                  type: string
                  enum:
                    - low
                    - default
                    - high
                  default: default
                  description: 解析精度
        video_url:
          description: >-
            视频输入，`type: input_video` 时使用。可直接传 URL / Base64 data URL 字符串，或传对象
            `{"url": "...", "fps": 1, "detail": "default",
            "max_long_side_pixel": ...}`。`fps` 为抽帧频率，默认 1，范围 [0.2, 5]，取值越低 token
            越少。支持 MP4 / AVI / MOV / MKV，URL / Base64 最大 50 MB；更大的视频通过
            `mm_file://{file_id}` 文件引用传入
          oneOf:
            - type: string
            - type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: 视频 URL、Base64 data URL 或 `mm_file://{file_id}`
                fps:
                  type: number
                  minimum: 0.2
                  maximum: 5
                  default: 1
                  description: 抽帧频率
                detail:
                  type: string
                  enum:
                    - low
                    - default
                    - high
                  default: default
                  description: 解析精度
                max_long_side_pixel:
                  type: integer
                  minimum: 1
                  description: 视频帧最长边像素限制
    ReasoningContentPart:
      type: object
      title: 思考内容块
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - reasoning_text
        text:
          type: string
          description: 思考文本。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        所有接口均需要使用 Bearer Token 进行认证

        **获取 API Key**：

        访问 [API Key 管理页面](https://evolink.ai/dashboard/keys) 获取您的 API Key

        **使用时在请求头中添加**：
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````

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