> ## 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 全模型接口 - Chat Completions 完整参数

> - 使用 OpenAI Chat Completions 协议调用 MiniMax 系列模型，通过 `model` 参数选择具体型号
- **多轮对话**：支持单轮或多轮上下文对话
- **系统提示词**：通过 `role=system` 消息自定义 AI 的角色和行为
- **多模态输入**：`MiniMax-M4`、`MiniMax-M3.1-Flash`、`MiniMax-M3` 的 `content` 支持文本 + 图像 / 视频混排；`MiniMax-M2.5` 仅支持文本
- **思考模式**：思考内容通过 `reasoning_content` 返回，`content` 只包含最终回答；`MiniMax-M3` 默认把思考内容以 `<think>...</think>` 放在 `content` 开头，设置 `reasoning_split: true` 后改为通过 `reasoning_content` 返回
- **流式输出**：支持 SSE 流式返回
- **工具调用**：支持 Function Calling

**流式响应说明**：当 `stream=true` 时，通过 Server-Sent Events 返回，每条消息格式为 `data: {JSON}`，结束时返回 `data: [DONE]`。`choices[].delta` 先增量返回 `reasoning_content`，再增量返回 `content` / `tool_calls`；设置 `stream_options.include_usage=true` 时，结束前额外返回一个包含 `usage` 的数据块。

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

> [!NOTE]
>
> **思考控制因模型而异**：`MiniMax-M4` 与 `MiniMax-M3.1-Flash` 始终思考，用 `reasoning_effort` 调节深度（`low` / `medium` / `high` / `xhigh` / `max`，默认 `max`），传入 `thinking.type: "disabled"` 或 `reasoning_effort: "none"` 会返回 400 错误。`MiniMax-M3` 可通过 `thinking.type: "disabled"` 关闭思考，不能调节深度。`MiniMax-M2.5` 始终思考，不能关闭，也不能调节深度。

> [!NOTE]
>
> **最大输出因模型而异**：`MiniMax-M4` 为 262,144 tokens，`MiniMax-M3.1-Flash` 与 `MiniMax-M3` 为 524,288 tokens，`MiniMax-M2.5` 为 32,768 tokens，思考 token 计入其中。从其他模型切换到 `MiniMax-M4` 时，请先确认 `max_completion_tokens` 不超过 262,144。

> [!NOTE]
>
> **图像与视频输入**：`MiniMax-M4`、`MiniMax-M3.1-Flash` 与 `MiniMax-M3` 支持，通过 `messages[].content[]` 的 `image_url`、`video_url` 内容块传入。`MiniMax-M2.5` 只接受文本。


## OpenAPI

````yaml cn/api-manual/language-series/minimax/chat-completions/chat-completions-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: MiniMax 全模型接口 - Chat Completions 完整参数
  description: >-
    通过 OpenAI 兼容的 Chat Completions 接口调用 MiniMax 文本模型的完整 API 参考。


    **收录模型**：`MiniMax-M4`、`MiniMax-M3.1-Flash`、`MiniMax-M3`、`MiniMax-M2.5`（用
    `model` 参数选择）


    **通用能力**：

    - 工具调用：支持 Function Calling

    - 流式输出：支持 SSE 流式返回

    - 上下文缓存：相同前缀自动命中，命中部分体现在
    `usage.prompt_tokens_details.cached_tokens`，按缓存命中价计费

    - 思考 token 计入输出上限，按输出价计费


    **模型间差异**（上下文长度、最大输出、思考控制、图像与视频输入）见下方 `model`、`thinking`、`reasoning_effort`
    与 `max_completion_tokens` 字段说明。


    多轮对话时，请将上一轮完整 assistant message 原样放回 `messages`，包括 `reasoning_content` 和
    `tool_calls`。
  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/chat/completions:
    post:
      tags:
        - 对话生成
      summary: MiniMax 对话接口（全模型，OpenAI 兼容）
      description: >-
        - 使用 OpenAI Chat Completions 协议调用 MiniMax 系列模型，通过 `model` 参数选择具体型号

        - **多轮对话**：支持单轮或多轮上下文对话

        - **系统提示词**：通过 `role=system` 消息自定义 AI 的角色和行为

        - **多模态输入**：`MiniMax-M4`、`MiniMax-M3.1-Flash`、`MiniMax-M3` 的 `content`
        支持文本 + 图像 / 视频混排；`MiniMax-M2.5` 仅支持文本

        - **思考模式**：思考内容通过 `reasoning_content` 返回，`content` 只包含最终回答；`MiniMax-M3`
        默认把思考内容以 `<think>...</think>` 放在 `content` 开头，设置 `reasoning_split: true`
        后改为通过 `reasoning_content` 返回

        - **流式输出**：支持 SSE 流式返回

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


        **流式响应说明**：当 `stream=true` 时，通过 Server-Sent Events 返回，每条消息格式为 `data:
        {JSON}`，结束时返回 `data: [DONE]`。`choices[].delta` 先增量返回
        `reasoning_content`，再增量返回 `content` / `tool_calls`；设置
        `stream_options.include_usage=true` 时，结束前额外返回一个包含 `usage` 的数据块。
      operationId: createChatCompletionMiniMax
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: 单轮文本对话
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content: Please introduce yourself.
                  max_completion_tokens: 131072
              multi_turn:
                summary: 多轮对话（上下文理解）
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content: What is Python?
                    - role: assistant
                      content: Python is a high-level programming language.
                    - role: user
                      content: What are its main advantages?
                  max_completion_tokens: 131072
              system_prompt:
                summary: 使用系统提示词
                value:
                  model: MiniMax-M4
                  messages:
                    - role: system
                      content: >-
                        You are a Python programming assistant. Keep your
                        answers concise.
                    - role: user
                      content: How do I read a file?
                  max_completion_tokens: 131072
              reasoning_effort:
                summary: 调节思考深度
                value:
                  model: MiniMax-M4
                  reasoning_effort: high
                  messages:
                    - role: user
                      content: >-
                        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?
                  max_completion_tokens: 131072
              image_understanding:
                summary: 图像理解（多模态输入）
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: What is shown in this image?
                        - type: image_url
                          image_url:
                            url: https://example.com/image.jpeg
                            detail: default
                  max_completion_tokens: 131072
              video_understanding:
                summary: 视频理解（多模态输入）
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Summarize this video.
                        - type: video_url
                          video_url:
                            url: https://example.com/video.mp4
                            fps: 2
                            detail: default
                  max_completion_tokens: 131072
              tool_calling:
                summary: Function Calling 工具调用
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content: Check the stock for product demo-item-001.
                  tools:
                    - type: function
                      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_completion_tokens: 131072
              streaming:
                summary: 流式输出
                value:
                  model: MiniMax-M4
                  stream: true
                  stream_options:
                    include_usage: true
                  messages:
                    - role: user
                      content: Write a short poem about spring.
                  max_completion_tokens: 131072
              flash:
                summary: 调用 MiniMax-M3.1-Flash
                value:
                  model: MiniMax-M3.1-Flash
                  messages:
                    - role: user
                      content: Please introduce yourself.
                  max_completion_tokens: 131072
              m3_disable_thinking:
                summary: MiniMax-M3 关闭思考
                description: 仅 `MiniMax-M3` 可以关闭思考；其他模型传入 `disabled` 会返回 400 错误。
                value:
                  model: MiniMax-M3
                  thinking:
                    type: disabled
                  messages:
                    - role: user
                      content: Explain recursion in one sentence.
                  max_completion_tokens: 131072
              m3_reasoning_split:
                summary: MiniMax-M3 单独返回思考内容
                description: >-
                  `MiniMax-M3` 默认把思考内容放在 `content` 开头；设置 `reasoning_split: true`
                  后改为通过 `reasoning_content` 返回。
                value:
                  model: MiniMax-M3
                  reasoning_split: true
                  messages:
                    - role: user
                      content: >-
                        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?
                  max_completion_tokens: 131072
              m25_text:
                summary: 调用 MiniMax-M2.5（仅文本）
                description: '`MiniMax-M2.5` 最大输出 32,768 tokens，只接受文本输入。'
                value:
                  model: MiniMax-M2.5
                  messages:
                    - role: user
                      content: Explain recursion in one sentence.
                  max_completion_tokens: 4096
      responses:
        '200':
          description: 对话生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
              examples:
                with_thinking:
                  summary: 包含思考内容
                  value:
                    id: example_c425f5
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: '0.05'
                          role: assistant
                          name: MiniMax AI
                          reasoning_content: >-
                            Let the ball cost x. Then 2x + 1 = 1.10, so x =
                            0.05.
                    created: 1792401901
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 281
                      total_characters: 0
                      prompt_tokens: 229
                      completion_tokens: 52
                      completion_tokens_details:
                        reasoning_tokens: 49
                      prompt_tokens_details:
                        cached_tokens: 187
                direct_answer:
                  summary: 直接回答（无思考内容）
                  value:
                    id: example_c7cb0e
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: >-
                            Recursion is a technique in which a function calls
                            itself to solve smaller instances of a problem.
                          role: assistant
                          name: MiniMax AI
                    created: 1792401868
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 219
                      total_characters: 0
                      prompt_tokens: 208
                      completion_tokens: 11
                      prompt_tokens_details:
                        cached_tokens: 58
                tool_calls:
                  summary: 触发工具调用（finish_reason=tool_calls）
                  value:
                    id: example_2d249e
                    choices:
                      - finish_reason: tool_calls
                        index: 0
                        message:
                          content: I'll check the stock for product demo-item-001.
                          role: assistant
                          name: MiniMax AI
                          tool_calls:
                            - id: call_example_1
                              type: function
                              function:
                                name: get_product_stock
                                arguments: '{"product_id": "demo-item-001"}'
                              index: 0
                    created: 1792401870
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 483
                      total_characters: 0
                      prompt_tokens: 446
                      completion_tokens: 37
                      prompt_tokens_details:
                        cached_tokens: 227
                length:
                  summary: 达到输出上限（finish_reason=length）
                  value:
                    id: example_a5ad57
                    choices:
                      - finish_reason: length
                        index: 0
                        message:
                          content: ''
                          role: assistant
                          name: MiniMax AI
                          reasoning_content: I need to explain the process step by step.
                    created: 1792401615
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 219
                      total_characters: 0
                      prompt_tokens: 211
                      completion_tokens: 8
                      completion_tokens_details:
                        reasoning_tokens: 8
                      prompt_tokens_details:
                        cached_tokens: 184
                m3_inline_thinking:
                  summary: MiniMax-M3 默认返回（思考内容在 content 开头）
                  value:
                    id: example_818ad0
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: >-
                            <think>Let the ball cost x. Then 2x + 1 = 1.10, so x
                            = 0.05.</think>


                            0.05
                          role: assistant
                    created: 1796307610
                    model: MiniMax-M3
                    object: chat.completion
                    usage:
                      total_tokens: 308
                      total_characters: 0
                      prompt_tokens: 224
                      completion_tokens: 84
                      completion_tokens_details:
                        reasoning_tokens: 78
                      prompt_tokens_details:
                        cached_tokens: 193
                m25_answer:
                  summary: MiniMax-M2.5 返回
                  value:
                    id: chatcmpl-example
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: >-
                            Recursion is a technique in which a function calls
                            itself to solve smaller instances of a problem.
                          reasoning_content: >-
                            The user wants a one-sentence definition of
                            recursion.
                          role: assistant
                    created: 1796307389
                    model: MiniMax-M2.5
                    object: chat.completion
                    usage:
                      prompt_tokens: 44
                      completion_tokens: 90
                      total_tokens: 134
                      completion_tokens_details:
                        reasoning_tokens: 84
                      prompt_tokens_details:
                        cached_tokens: 0
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: Invalid request parameters
                  type: invalid_request_error
                  param: ''
                  code: null
        '401':
          description: 未认证、Token 无效或过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 配额不足、需要充值
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota_error
        '403':
          description: 无权限访问该模型
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: 资源不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
        '413':
          description: 请求体过大
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Request body too large
                  type: request_too_large_error
                  param: messages
        '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: internal_server_error
        '502':
          description: 网关错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Bad gateway
                  type: bad_gateway_error
        '503':
          description: 服务暂时不可用
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: >-
            要调用的模型：


            | 模型 ID | 上下文 | 最大输出 | 思考 |

            |---|---|---|---|

            | `MiniMax-M4` | 1,000,000 | 262,144 | 始终思考，可调深度 |

            | `MiniMax-M3.1-Flash` | 1,000,000 | 524,288 | 始终思考，可调深度 |

            | `MiniMax-M3` | 1,000,000 | 524,288 | 默认思考，可关闭，不可调深度 |

            | `MiniMax-M2.5` | 204,800 | 32,768 | 始终思考，不可关闭或调深度 |


            最大输出包含思考 token。`MiniMax-M2.5` 只接受文本，其余三个模型支持图像与视频输入。思考的开关与深度见
            `thinking`、`reasoning_effort` 字段。
          enum:
            - MiniMax-M4
            - MiniMax-M3.1-Flash
            - MiniMax-M3
            - MiniMax-M2.5
          example: MiniMax-M4
        messages:
          type: array
          description: |-
            对话消息列表，支持多轮对话

            不同角色的消息具有不同的字段结构，请选择对应角色查看
          items:
            oneOf:
              - $ref: '#/components/schemas/SystemMessage'
              - $ref: '#/components/schemas/UserMessage'
              - $ref: '#/components/schemas/AssistantRequestMessage'
              - $ref: '#/components/schemas/ToolMessage'
            discriminator:
              propertyName: role
              mapping:
                system: '#/components/schemas/SystemMessage'
                user: '#/components/schemas/UserMessage'
                assistant: '#/components/schemas/AssistantRequestMessage'
                tool: '#/components/schemas/ToolMessage'
          minItems: 1
        reasoning_effort:
          type: string
          description: >-
            调节思考深度，可选 `low`、`medium`、`high`、`xhigh`、`max`。较高档位通常会增加思考 token
            消耗和响应时间。


            - `MiniMax-M4`、`MiniMax-M3.1-Flash`：省略时为 `max`；不接受 `none`，传入会返回 400
            错误

            - `MiniMax-M3`、`MiniMax-M2.5`：不能调节思考深度，传入会被忽略
          enum:
            - low
            - medium
            - high
            - xhigh
            - max
          example: high
        thinking:
          type: object
          description: >-
            思考开关


            - `MiniMax-M4`、`MiniMax-M3.1-Flash`：始终思考，只接受 `adaptive`，可省略；传入
            `disabled` 会返回 400 错误

            - `MiniMax-M3`：省略时为 `adaptive`（思考）；传入 `disabled` 会跳过思考、直接回答

            - `MiniMax-M2.5`：始终思考，不能关闭，请勿传入该字段
          properties:
            type:
              type: string
              enum:
                - adaptive
                - disabled
              default: adaptive
        reasoning_split:
          type: boolean
          description: >-
            思考内容的返回位置，不影响是否思考


            - `MiniMax-M4`、`MiniMax-M3.1-Flash`：只支持 `true`，可省略；思考内容固定通过
            `reasoning_content` 返回，传入 `false` 会返回 400 错误

            - `MiniMax-M3`：省略时思考内容以 `<think>...</think>` 放在 `content` 开头；设为
            `true` 后改为通过 `reasoning_content` 返回

            - `MiniMax-M2.5`：无需传入，思考内容固定通过 `reasoning_content` 返回
          example: true
        temperature:
          type: number
          description: |-
            采样温度

            - `MiniMax-M4`、`MiniMax-M3.1-Flash`、`MiniMax-M3`：固定为 1，传入的值不会生效
            - `MiniMax-M2.5`：默认 1，可以调整；数值越低输出越稳定，越高越多样

            **建议**：不要同时调整 temperature 和 top_p
          default: 1
          example: 1
        top_p:
          type: number
          description: >-
            核采样（Nucleus Sampling）参数


            - `MiniMax-M4`、`MiniMax-M3.1-Flash`、`MiniMax-M3`：固定为
            0.95，传入的值不会生效；如需传入，请使用 (0, 1] 之间的值

            - `MiniMax-M2.5`：默认 0.95，取值范围 (0, 1]


            **建议**：不要同时调整 temperature 和 top_p
          exclusiveMinimum: 0
          maximum: 1
          default: 0.95
          example: 0.95
        max_completion_tokens:
          type: integer
          description: >-
            生成内容长度上限（Token 数），**包含思考和回答**


            | 模型 | 推荐值 | 最大值 |

            |---|---|---|

            | `MiniMax-M4` | 131,072 | **262,144** |

            | `MiniMax-M3.1-Flash` | 131,072 | **524,288** |

            | `MiniMax-M3` | 131,072 | **524,288** |

            | `MiniMax-M2.5` | 按需设置 | **32,768** |


            请勿超过所选模型的最大值。取值过小时可能在思考阶段就达到上限，返回 `finish_reason=length` 且 `content`
            为空。
          minimum: 1
          maximum: 524288
          example: 131072
        stream:
          type: boolean
          description: |-
            是否以流式方式返回响应

            - `true`：流式返回，通过 SSE（Server-Sent Events）逐块实时返回内容
            - `false`：等待完整响应后一次性返回（默认）
          default: false
          example: false
        stream_options:
          type: object
          description: |-
            流式响应选项

            仅在 `stream=true` 时有效
          properties:
            include_usage:
              type: boolean
              description: 是否在流式结束前额外返回一个仅含 `usage` 统计的数据块
        tools:
          type: array
          description: |-
            工具定义列表，用于 Function Calling

            每个工具需要定义名称、描述和参数 schema
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: string
          description: 工具选择策略，仅支持 `auto`（由模型决定是否调用工具）
          enum:
            - auto
          default: auto
        max_tokens:
          type: integer
          description: |-
            旧版生成长度限制参数

            **说明**：已弃用，请改用 `max_completion_tokens`
          deprecated: true
          minimum: 1
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 对话完成的唯一标识符
          example: chatcmpl-example
        model:
          type: string
          description: 实际使用的模型名称
          example: MiniMax-M4
        object:
          type: string
          enum:
            - chat.completion
          description: 响应类型
          example: chat.completion
        created:
          type: integer
          description: 创建时间戳（Unix 秒）
          example: 1777026807
        choices:
          type: array
          description: 对话生成的选择列表
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type:
                - integer
                - string
                - 'null'
              description: HTTP 状态错误代码
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数名称
    SystemMessage:
      title: System Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
          description: 角色标识，固定为 `system`
        content:
          type: string
          description: 系统提示词内容，用于设定 AI 的角色和行为
        name:
          type: string
          description: 参与者名称，用于区分不同的系统提示来源
    UserMessage:
      title: User Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
          description: 角色标识，固定为 `user`
        content:
          description: |-
            用户消息内容

            **说明**：
            - 纯文本时直接传字符串
            - 多模态时传 content part 数组，支持 `text` / `image_url`（图片）/ `video_url`（视频）
            - `MiniMax-M2.5` 只接受文本
            - 一次请求（含历史消息）最多 200 张图片、20 个视频
            - 请求体最大 64 MB
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentPart'
        name:
          type: string
          description: 参与者名称，用于区分不同的用户
    AssistantRequestMessage:
      title: Assistant Message
      type: object
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - assistant
          description: 角色标识，固定为 `assistant`
        content:
          type:
            - string
            - 'null'
          description: |-
            助手消息内容

            **说明**：
            - 用于多轮对话中传递历史助手回复
            - 当存在 `tool_calls` 时可为 `null`
        reasoning_content:
          type: string
          description: 上一轮返回的思考内容，多轮对话时原样回传
        name:
          type: string
          description: 参与者名称
        tool_calls:
          type: array
          description: |-
            工具调用列表

            用于在多轮对话中传递历史的工具调用信息
          items:
            type: object
            properties:
              id:
                type: string
                description: 工具调用的唯一标识符
              type:
                type: string
                enum:
                  - function
              function:
                type: object
                properties:
                  name:
                    type: string
                    description: 调用的函数名称
                  arguments:
                    type: string
                    description: 函数参数（JSON 字符串）
    ToolMessage:
      title: Tool Message
      type: object
      required:
        - role
        - content
        - tool_call_id
      properties:
        role:
          type: string
          enum:
            - tool
          description: 角色标识，固定为 `tool`
        content:
          type: string
          description: 工具调用的返回结果内容
        tool_call_id:
          type: string
          description: |-
            工具调用 ID

            对应 assistant 消息中 `tool_calls` 返回的 `id` 字段
    Tool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          enum:
            - function
          description: 工具类型，目前仅支持 `function`
        function:
          type: object
          required:
            - name
            - parameters
          properties:
            name:
              type: string
              description: |-
                要调用的函数名称

                **说明**：
                - 必须由 a-z、A-Z、0-9 字符组成，或包含下划线和连字符
                - 最大长度为 64 个字符
            description:
              type: string
              description: 函数功能描述，供模型理解何时以及如何调用该函数
            parameters:
              type: object
              description: 函数的输入参数，以 JSON Schema 对象描述
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 选择的索引
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: |-
            完成原因

            - `stop`：自然结束或触发停止序列
            - `length`：达到最大 token 限制
            - `content_filter`：内容被安全策略过滤
            - `tool_calls`：模型调用了工具
          enum:
            - stop
            - length
            - content_filter
            - tool_calls
          example: stop
    Usage:
      type: object
      description: Token 使用统计信息
      properties:
        total_tokens:
          type: integer
          description: 消耗的总 token 数
          example: 1604
        total_characters:
          type: integer
          description: 消耗的总字符数
          example: 0
        prompt_tokens:
          type: integer
          description: 输入 token 总数（含缓存命中部分）
          example: 1365
        completion_tokens:
          type: integer
          description: 输出 token 数量（含思考部分）
          example: 239
        completion_tokens_details:
          type: object
          description: 输出 token 详细分项
          properties:
            reasoning_tokens:
              type: integer
              description: 思考产生的 token 数
              example: 49
        prompt_tokens_details:
          type: object
          description: 输入 token 详细分项
          properties:
            cached_tokens:
              type: integer
              description: |-
                命中缓存的输入 token 数

                命中部分按缓存命中价计费；未命中部分 = `prompt_tokens - cached_tokens`，按标准输入价计费
              example: 114
    ContentPart:
      type: object
      description: 多模态内容片段，通过 `type` 声明类型，仅填写与该类型匹配的字段
      properties:
        type:
          type: string
          enum:
            - text
            - image_url
            - video_url
          description: |-
            内容类型

            - `text`：文本块
            - `image_url`：图片输入
            - `video_url`：视频输入
        text:
          type: string
          description: 当 `type=text` 时的文本内容
        image_url:
          type: object
          description: 图片输入（当 `type=image_url` 时），单张图片最大 10 MB，支持 JPEG / PNG / GIF / WEBP
          required:
            - url
          properties:
            url:
              type: string
              description: 图片 URL，或 `data:` 开头的 base64 data URL
            detail:
              type: string
              description: |-
                控制图片解析分辨率

                - `low`：低精度，消耗 token 更少
                - `default`：默认精度
                - `high`：高精度，识别更细节但消耗 token 更多
              enum:
                - low
                - default
                - high
              default: default
            max_long_side_pixel:
              type: integer
              description: 图片最长边像素限制
              minimum: 1
        video_url:
          type: object
          description: >-
            视频输入（当 `type=video_url` 时），单个视频最大 50 MB，时长不超过 30 分钟，支持 MP4 / AVI /
            MOV / MKV
          required:
            - url
          properties:
            url:
              type: string
              description: 视频 URL，或 `data:` 开头的 base64 data URL
            detail:
              type: string
              description: 控制视频抽帧分辨率
              enum:
                - low
                - default
                - high
              default: default
            fps:
              type: number
              description: 视频抽帧频率，默认 2，范围 [0.2, 5]。取值越高越能捕捉画面变化，token 消耗也越多。
              minimum: 0.2
              maximum: 5
              default: 2
            max_long_side_pixel:
              type: integer
              description: 视频单帧最长边像素限制
              minimum: 1
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 消息发送者的角色
          enum:
            - assistant
          example: assistant
        content:
          type:
            - string
            - 'null'
          description: >-
            最终回答内容（触发工具调用时可为 `null`）。`MiniMax-M3` 未设置 `reasoning_split: true`
            时，开头带 `<think>...</think>` 包裹的思考内容
          example: '0.05'
        reasoning_content:
          type: string
          description: >-
            思考内容。`MiniMax-M3` 需设置 `reasoning_split: true`
            才会通过该字段返回；简单问题可能不产生思考内容，此时不返回该字段
          example: Let the ball cost x. Then 2x + 1 = 1.10, so x = 0.05.
        name:
          type: string
          description: 发送者名称
        tool_calls:
          type: array
          description: 工具调用列表（当模型决定调用工具时返回）
          items:
            type: object
            properties:
              id:
                type: string
                description: 工具调用的唯一标识符
              type:
                type: string
                enum:
                  - function
              function:
                type: object
                properties:
                  name:
                    type: string
                    description: 调用的函数名称
                  arguments:
                    type: string
                    description: 函数参数（JSON 字符串）
              index:
                type: integer
                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.