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

# minimax-m3

> 根据对话内容生成模型响应。MiniMax-M3 支持文本、图片、视频、工具调用、思考和流式输出。



## OpenAPI

````yaml zh/api-reference/model-api/minimax/openapi/minimax-m3/openapi.yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: MiniMax-M3
  description: >-
    通过 AnyFast 的 OpenAI 兼容聊天补全接口调用 MiniMax M3，支持 100 万 token
    上下文、多模态输入、思考、工具调用和流式输出。
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: 对话补全
      description: 根据对话内容生成模型响应。MiniMax-M3 支持文本、图片、视频、工具调用、思考和流式输出。
      operationId: createChatCompletionMinimaxM3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - MiniMax-M3
                  description: 模型 ID。
                  example: MiniMax-M3
                messages:
                  type: array
                  minItems: 1
                  description: 对话历史。消息内容支持文本、图片、视频或工具调用内容。
                  items:
                    $ref: '#/components/schemas/Message'
                  example:
                    - role: user
                      content: 你好！
                service_tier:
                  type: string
                  enum:
                    - standard
                    - priority
                  default: standard
                  description: 请求服务层级。使用 priority 需要账号已开通优先服务。
                thinking:
                  $ref: '#/components/schemas/Thinking'
                reasoning_split:
                  type: boolean
                  description: 将推理内容拆分到 reasoning_content 和 reasoning_details 字段，不会开启或关闭思考。
                stream:
                  type: boolean
                  default: false
                  description: 设置为 true 时，通过 Server-Sent Events 返回增量消息。
                stream_options:
                  type: object
                  description: 流式响应选项。
                  properties:
                    include_usage:
                      type: boolean
                      default: false
                      description: 是否在最后一个流式事件中返回 usage。
                max_completion_tokens:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 524288
                  description: 最大生成 token 数。MiniMax-M3 推荐 131072，最大 524288。
                  example: 2048
                max_tokens:
                  type: integer
                  format: int64
                  minimum: 1
                  deprecated: true
                  description: 已弃用的旧版生成长度参数，请改用 max_completion_tokens。
                temperature:
                  type: number
                  format: double
                  minimum: 0
                  maximum: 2
                  default: 1
                  description: 采样温度。
                top_p:
                  type: number
                  format: double
                  minimum: 0
                  maximum: 1
                  default: 0.95
                  description: 核采样参数。MiniMax-M3 默认值为 0.95。
                tools:
                  type: array
                  description: 用于智能体工作流的函数工具定义。
                  items:
                    $ref: '#/components/schemas/Tool'
      responses:
        '200':
          description: 对话补全生成成功。
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ChatCompletion'
                  - $ref: '#/components/schemas/ChatCompletionChunk'
        '400':
          description: 请求参数无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 未授权。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 请求频率超限。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
        content:
          oneOf:
            - type: string
            - type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/TextPart'
                  - $ref: '#/components/schemas/ImagePart'
                  - $ref: '#/components/schemas/VideoPart'
          description: 文本内容或多模态内容片段数组。工具调用通过消息级别的 tool_calls 字段表示。
        name:
          type: string
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCall'
        tool_call_id:
          type: string
    Thinking:
      type: object
      description: 控制 MiniMax-M3 思考。省略时默认使用自适应思考。
      properties:
        type:
          type: string
          enum:
            - adaptive
            - disabled
          default: adaptive
          description: >-
            思考控制类型。MiniMax-M3 可使用 adaptive 启用自适应思考，或使用 disabled 跳过思考。M2.x
            模型会保持启用思考。
    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: 函数名称。
            parameters:
              type: object
              description: 函数参数的 JSON Schema 对象。
            description:
              type: string
              description: 函数描述。
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
          example: 066a33a7d290378f8a9e57a055812afa
        choices:
          type: array
          items:
            type: object
            required:
              - finish_reason
              - index
              - message
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/AssistantMessage'
              finish_reason:
                type: string
                nullable: true
                enum:
                  - stop
                  - length
                  - content_filter
                  - tool_calls
                  - null
        created:
          type: integer
          format: int64
          description: Unix 秒级时间戳。
        model:
          type: string
          example: MiniMax-M3
        object:
          type: string
          enum:
            - chat.completion
        usage:
          $ref: '#/components/schemas/Usage'
        input_sensitive:
          type: boolean
          description: 输入是否触发敏感内容检测。
        input_sensitive_type:
          type: integer
          description: 当 input_sensitive 为 true 时返回的敏感内容类型。
        output_sensitive:
          type: boolean
          description: 输出是否触发敏感内容检测。
        output_sensitive_type:
          type: integer
          description: 输出触发敏感内容检测时返回的类型。
        base_resp:
          $ref: '#/components/schemas/BaseResponse'
    ChatCompletionChunk:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
        choices:
          type: array
          items:
            type: object
            required:
              - index
              - delta
            properties:
              index:
                type: integer
              delta:
                $ref: '#/components/schemas/Delta'
              finish_reason:
                type: string
                nullable: true
                enum:
                  - stop
                  - length
                  - content_filter
                  - tool_calls
                  - null
        created:
          type: integer
          format: int64
        model:
          type: string
        object:
          type: string
          enum:
            - chat.completion.chunk
        usage:
          $ref: '#/components/schemas/Usage'
        base_resp:
          $ref: '#/components/schemas/BaseResponse'
    Error:
      type: object
      properties:
        base_resp:
          $ref: '#/components/schemas/BaseResponse'
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    TextPart:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
        text:
          type: string
    ImagePart:
      type: object
      required:
        - type
        - image_url
      properties:
        type:
          type: string
          enum:
            - image_url
        image_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
    VideoPart:
      type: object
      required:
        - type
        - video_url
      properties:
        type:
          type: string
          enum:
            - video_url
        video_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
    ToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
          description: 模型生成的工具调用 ID。
        type:
          type: string
          enum:
            - function
          description: 工具调用类型，目前仅支持 function。
        function:
          type: object
          required:
            - name
            - arguments
          properties:
            name:
              type: string
              description: 要调用的函数名称。
            arguments:
              type: string
              description: JSON 字符串格式的函数参数。
    AssistantMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - assistant
          description: 消息角色。
        content:
          type: string
          description: 文本回复内容。
        reasoning_content:
          type: string
          description: 启用思考时返回的思考内容。
        reasoning_details:
          type: array
          description: reasoning_split 为 true 时返回的结构化推理详情。
          items:
            $ref: '#/components/schemas/ReasoningDetail'
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCall'
    Usage:
      type: object
      properties:
        total_tokens:
          type: integer
        total_characters:
          type: integer
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
    BaseResponse:
      type: object
      properties:
        status_code:
          type: integer
          format: int64
          description: >-
            MiniMax 状态码：1000 未知错误；1001 请求超时；1002 触发限流；1004 认证失败；1008 余额不足； 1013
            内部服务器错误；1027 输出内容错误；1039 超出 token 限制；2013 参数错误。
        status_msg:
          type: string
          description: 错误详情。
    Delta:
      type: object
      properties:
        role:
          type: string
          enum:
            - assistant
        content:
          type: string
        reasoning_content:
          type: string
        reasoning_details:
          type: array
          items:
            $ref: '#/components/schemas/ReasoningDetail'
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCall'
    ReasoningDetail:
      type: object
      properties:
        type:
          type: string
          description: 推理详情类型，例如 reasoning.text。
        id:
          type: string
          description: 推理片段 ID。
        format:
          type: string
          description: 推理格式标识，例如 MiniMax-response-v1。
        index:
          type: integer
          description: 推理片段顺序索引。
        text:
          type: string
          description: 该推理片段的文本。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````