> ## 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-M2.5 - 完整参数文档

> - 使用 OpenAI SDK 格式调用 MiniMax-M2.5 模型
- 同步处理模式，实时返回对话内容
- **纯文本对话**：单轮或多轮上下文对话
- **系统提示词**：自定义 AI 的角色和行为

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


## OpenAPI

````yaml cn/api-manual/language-series/minimax-m2.5/minimax-m2.5-api.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: MiniMax-M2.5 完整参数文档
  description: MiniMax-M2.5 对话接口的完整 API 参考
  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-M2.5 对话接口
      description: |-
        - 使用 OpenAI SDK 格式调用 MiniMax-M2.5 模型
        - 同步处理模式，实时返回对话内容
        - **纯文本对话**：单轮或多轮上下文对话
        - **系统提示词**：自定义 AI 的角色和行为
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: 单轮文本对话
                value:
                  model: MiniMax-M2.5
                  messages:
                    - role: user
                      content: 请介绍一下你自己
              multi_turn:
                summary: 多轮对话（上下文理解）
                value:
                  model: MiniMax-M2.5
                  messages:
                    - role: user
                      content: 什么是Python？
                    - role: assistant
                      content: Python是一种高级编程语言...
                    - role: user
                      content: 它有什么优点？
              system_prompt:
                summary: 使用系统提示词
                value:
                  model: MiniMax-M2.5
                  messages:
                    - role: system
                      content: 你是一个专业的Python编程助手，用简洁的语言回答问题。
                    - role: user
                      content: 如何读取文件？
      responses:
        '200':
          description: 对话生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  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 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
                  fallback_suggestion: https://evolink.ai/dashboard/billing
        '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
                  fallback_suggestion: MiniMax-M2.5
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 上游服务错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
                  fallback_suggestion: try different model
        '503':
          description: 服务暂时不可用
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: 对话模型名称
          enum:
            - MiniMax-M2.5
          example: MiniMax-M2.5
        messages:
          type: array
          description: 对话消息列表，支持多轮对话
          items:
            $ref: '#/components/schemas/Message'
          minItems: 1
        max_tokens:
          type: integer
          description: |-
            指定生成内容长度的上限（Token 数），上限为 2048

            **说明**:
            - 超过上限的内容会被截断
            - 如果生成因 `length` 原因中断，请尝试调高此值
          minimum: 1
          maximum: 2048
          example: 2048
        stream:
          type: boolean
          description: |-
            是否以流式方式返回响应

            - `true`: 流式返回，逐块实时返回内容
            - `false`: 等待完整响应后一次性返回
          example: false
        temperature:
          type: number
          description: |-
            采样温度，控制输出的随机性

            **说明**:
            - 较低值(如 0.1): 更确定、更聚焦的输出
            - 较高值(如 0.9): 更随机、更有创意的输出
            - 取值范围: (0, 1]，不包含 0
          exclusiveMinimum: 0
          maximum: 1
          example: 0.7
        top_p:
          type: number
          description: |-
            核采样(Nucleus Sampling)参数

            **说明**:
            - 控制从累积概率前多少的token中采样
            - 例如 0.9 表示从累积概率达到90%的token中选择
            - 取值范围: (0, 1]，不包含 0

            **建议**: 不要同时调整 temperature 和 top_p
          exclusiveMinimum: 0
          maximum: 1
          example: 0.9
        enable_search:
          type: boolean
          description: |-
            是否启用联网搜索

            - `true`: 启用联网搜索，模型会根据需要搜索互联网获取最新信息
            - `false`: 不启用联网搜索
          example: true
        search_options:
          type: object
          description: '联网搜索选项，需配合 `enable_search: true` 使用'
          properties:
            search_strategy:
              type: string
              description: |-
                搜索策略

                - `turbo`: 快速搜索，速度更快
                - `max`: 深度搜索，结果更全面
              enum:
                - turbo
                - max
              example: max
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 对话完成的唯一标识符
          example: cmpl-04ea926191a14749b7f2c7a48a68abc6
        model:
          type: string
          description: 实际使用的模型名称
          example: MiniMax-M2.5
        object:
          type: string
          enum:
            - chat.completion
          description: 响应类型
          example: chat.completion
        created:
          type: integer
          description: 创建时间戳
          example: 1698999496
        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
              description: HTTP状态错误代码
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数名称
            fallback_suggestion:
              type: string
              description: 错误时的建议
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: |-
            消息角色

            - `user`: 用户消息
            - `assistant`: AI助手消息（用于多轮对话）
            - `system`: 系统提示词（设定AI的角色和行为）
          enum:
            - user
            - assistant
            - system
          example: user
        content:
          type: string
          description: 消息内容
          example: 请介绍一下你自己
    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`: 内容被过滤
          enum:
            - stop
            - length
            - content_filter
          example: stop
    Usage:
      type: object
      description: Token 使用统计信息
      properties:
        prompt_tokens:
          type: integer
          description: 输入内容的 token 数量
          example: 8
        completion_tokens:
          type: integer
          description: 输出内容的 token 数量
          example: 292
        total_tokens:
          type: integer
          description: 总 token 数量
          example: 300
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 消息发送者的角色
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI 回复的消息内容
          example: Hi there! How can I help you?
  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
        ```

````