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

# MiniMax-M3 - OpenAI 互換 API

> - OpenAI Chat Completions プロトコルを使用して MiniMax-M3 モデルを呼び出します
- **マルチターン対話**：シングルターンまたはマルチターンの文脈対話に対応
- **システムプロンプト**：`role=system` メッセージで AI の役割と振る舞いをカスタマイズ
- **マルチモーダル入力**：`content` はテキスト + 画像 / 動画の混在に対応
- **思考モード**：`thinking.type` で制御し、思考内容は `reasoning_content` で返却
- **ストリーミング出力**：SSE ストリーミングレスポンスに対応
- **ツール呼び出し**：Function Calling に対応

<Note>
  **BaseURL**：デフォルトの BaseURL は `https://direct.evolink.ai` で、テキストモデルへの対応が優れており、長時間接続をサポートします。`https://api.evolink.ai` はマルチモーダルサービスの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。
</Note>


## OpenAPI

````yaml ja/api-manual/language-series/minimax-m3/minimax-m3-chat.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: MiniMax-M3 完全パラメータドキュメント (OpenAI 互換)
  description: |-
    MiniMax-M3 対話インターフェースの完全な API リファレンス。

    **モデル能力**：
    - 最大出力：**524,288 tokens**（512K）、推奨 **131,072 tokens**（128K）
    - 思考モード：`thinking` フィールドで制御し、デフォルトは `adaptive`（モデルが深く思考するかを適応的に判断）
    - マルチモーダル入力：テキスト、画像、動画に対応
    - ツール呼び出し：Function Calling に対応
    - ストリーミング出力：SSE ストリーミングレスポンスに対応
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 本番環境（推奨）
  - url: https://api.evolink.ai
    description: 代替 URL
security:
  - bearerAuth: []
tags:
  - name: 対話生成
    description: AI 対話生成に関連するエンドポイント
paths:
  /v1/chat/completions:
    post:
      tags:
        - 対話生成
      summary: MiniMax-M3 対話インターフェース（OpenAI 互換）
      description: |-
        - OpenAI Chat Completions プロトコルを使用して MiniMax-M3 モデルを呼び出します
        - **マルチターン対話**：シングルターンまたはマルチターンの文脈対話に対応
        - **システムプロンプト**：`role=system` メッセージで AI の役割と振る舞いをカスタマイズ
        - **マルチモーダル入力**：`content` はテキスト + 画像 / 動画の混在に対応
        - **思考モード**：`thinking.type` で制御し、思考内容は `reasoning_content` で返却
        - **ストリーミング出力**：SSE ストリーミングレスポンスに対応
        - **ツール呼び出し**：Function Calling に対応
      operationId: createChatCompletionMiniMaxM3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: シングルターンのテキスト対話
                value:
                  model: MiniMax-M3
                  messages:
                    - role: user
                      content: 自己紹介してください
              multi_turn:
                summary: マルチターン対話（文脈理解）
                value:
                  model: MiniMax-M3
                  messages:
                    - role: user
                      content: Python とは何ですか？
                    - role: assistant
                      content: Python は高水準プログラミング言語です...
                    - role: user
                      content: どんな利点がありますか？
              system_prompt:
                summary: システムプロンプトの使用
                value:
                  model: MiniMax-M3
                  messages:
                    - role: system
                      content: あなたはプロの Python プログラミングアシスタントです。簡潔な言葉で質問に答えてください。
                    - role: user
                      content: ファイルを読み込むにはどうすればよいですか？
              image_understanding:
                summary: 画像理解（マルチモーダル入力）
                value:
                  model: MiniMax-M3
                  thinking:
                    type: adaptive
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: この画像には何が写っていますか？
                        - type: image_url
                          image_url:
                            url: https://example.com/image.jpeg
                  max_completion_tokens: 500
              disable_thinking:
                summary: 思考モードを無効化（直接回答）
                value:
                  model: MiniMax-M3
                  thinking:
                    type: disabled
                  messages:
                    - role: user
                      content: フランスの首都はどこですか？
              tool_calling:
                summary: Function Calling ツール呼び出し
                value:
                  model: MiniMax-M3
                  messages:
                    - role: user
                      content: 北京の今日の天気を調べて
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: 指定した都市の天気状況を照会します
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                              description: 都市名、例：北京
                          required:
                            - location
              streaming:
                summary: ストリーミング出力
                value:
                  model: MiniMax-M3
                  stream: true
                  stream_options:
                    include_usage: true
                  messages:
                    - role: user
                      content: 春についての短い詩を書いて
      responses:
        '200':
          description: 対話生成に成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
              examples:
                default_thinking:
                  summary: デフォルト（思考が content の <think> 内にインライン）
                  value:
                    id: 066b36619b147e326d17053cccdef70f
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: >-
                            <think>

                            ユーザーが尋ねているのはフランスの首都で、これは一般常識の質問です。答えはパリで、そのまま提示すればよいです。

                            </think>

                            フランスの首都は**パリ**です。
                          role: assistant
                          name: MiniMax AI
                          audio_content: ''
                    created: 1777026807
                    model: MiniMax-M3
                    object: chat.completion
                    usage:
                      total_tokens: 60
                      total_characters: 0
                      prompt_tokens: 7
                      completion_tokens: 53
                      prompt_tokens_details:
                        cached_tokens: 0
                    input_sensitive: false
                    output_sensitive: false
                    input_sensitive_type: 0
                    output_sensitive_type: 0
                    base_resp:
                      status_code: 0
                      status_msg: ''
                tool_calls:
                  summary: ツール呼び出しがトリガー（finish_reason=tool_calls）
                  value:
                    id: 066b13db03518f86c2e3c9b073c04272
                    choices:
                      - finish_reason: tool_calls
                        index: 0
                        message:
                          content: |-
                            <think>
                            ユーザーは北京の天気を調べたいので、get_weather ツールを呼び出します。
                            </think>
                            北京の現在の天気を調べますね。
                          role: assistant
                          name: MiniMax AI
                          tool_calls:
                            - id: call_function_p4iiqtpnh5bj_1
                              type: function
                              function:
                                name: get_weather
                                arguments: '{"location": "北京"}'
                              index: 0
                          audio_content: ''
                    created: 1777026900
                    model: MiniMax-M3
                    object: chat.completion
                    usage:
                      total_tokens: 110
                      total_characters: 0
                      prompt_tokens: 86
                      completion_tokens: 24
                      prompt_tokens_details:
                        cached_tokens: 0
                    input_sensitive: false
                    output_sensitive: false
                    input_sensitive_type: 0
                    output_sensitive_type: 0
                    base_resp:
                      status_code: 0
                      status_msg: ''
        '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
        '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: 対話モデル名
          enum:
            - MiniMax-M3
          example: MiniMax-M3
        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:
                  $ref: '#/components/schemas/SystemMessage'
                user:
                  $ref: '#/components/schemas/UserMessage'
                assistant:
                  $ref: '#/components/schemas/AssistantRequestMessage'
                tool:
                  $ref: '#/components/schemas/ToolMessage'
          minItems: 1
        thinking:
          type: object
          description: >-
            深い思考を制御します


            **説明**：

            - **デフォルトは `adaptive`**：モデルが問題の難易度に応じて深く思考するかを適応的に判断します

            - デフォルトでは思考内容はレスポンスの `content` 内にインラインされます（`<think>...</think>`
            で囲まれます）。独立したフィールドに分離したい場合は `reasoning_split` を併用してください
          properties:
            type:
              type: string
              description: |-
                深い思考モード

                - `adaptive`：モデルが思考の要否を自律的に判断します（推奨デフォルト値）
                - `disabled`：思考を無効化し、直接回答します
              enum:
                - disabled
                - adaptive
              default: adaptive
        reasoning_split:
          type: boolean
          description: >-
            思考内容を独立したフィールドに分離するかどうか


            - `false`（デフォルト）：思考内容は `content` 内にインラインされ、`<think>...</think>`
            で囲まれます

            - `true`：思考内容は `choices[].message.reasoning_content` と
            `reasoning_details` に分離されます
        temperature:
          type: number
          description: |-
            サンプリング温度。出力のランダム性を制御します

            **説明**：
            - 低い値（例：0.2）：より確定的で焦点の絞られた出力
            - 高い値（例：1.5）：よりランダムで創造的な出力
            - 範囲 `[0, 2]`、デフォルト 1
          minimum: 0
          maximum: 2
          default: 1
          example: 1
        top_p:
          type: number
          description: |-
            核サンプリング（Nucleus Sampling）パラメータ

            **説明**：
            - 累積確率が上位のトークンからのサンプリングを制御します
            - 例えば 0.95 は累積確率が 95% に達するトークンから選択することを意味します
            - 範囲 `[0, 1]`、MiniMax-M3 のデフォルトは 0.95

            **推奨**：temperature と top_p を同時に調整しないでください
          minimum: 0
          maximum: 1
          default: 0.95
          example: 0.95
        max_completion_tokens:
          type: integer
          description: |-
            生成内容の長さの上限（Token 数）

            **説明**：
            - MiniMax-M3 は **131,072**（128K）を推奨、上限は **524,288**（512K）
            - 思考によって生成されるトークンもこの上限に含まれます
            - 生成が `length` の理由で中断された場合は、この値を引き上げてみてください
          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'
        max_tokens:
          type: integer
          description: |-
            旧版の生成長さ制限パラメータ

            **説明**：非推奨です。代わりに `max_completion_tokens` を使用してください
          deprecated: true
          minimum: 1
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 対話完了の一意の識別子
          example: 0668a381bdc3c0ded310e27c9a46d16e7
        model:
          type: string
          description: 実際に使用されたモデル名
          example: MiniMax-M3
        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'
        input_sensitive:
          type: boolean
          description: >-
            入力内容がセンシティブワードフィルターに該当したかどうか。入力が重大な違反の場合、API
            はコンテンツ違反エラーを返し、レスポンス内容は空になります
        input_sensitive_type:
          type: integer
          description: >-
            入力が該当したセンシティブワードの種類（`input_sensitive` が true の場合に返却）：1 重大な違反；2 ポルノ；3
            広告；4 禁止コンテンツ；5 暴言；6 暴力 / テロ；7 その他
        output_sensitive:
          type: boolean
          description: 出力内容がセンシティブワードフィルターに該当したかどうか
        output_sensitive_type:
          type: integer
          description: 出力が該当したセンシティブワードの種類
        base_resp:
          type: object
          description: ステータスコードとエラー詳細
          properties:
            status_code:
              type: integer
              description: >-
                ステータスコード。`0` は成功を示します。その他には `1002` レート制限、`1008` 残高不足、`1039`
                Token 超過、`2013` パラメータエラーなどがあります
            status_msg:
              type: string
              description: エラー詳細
    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: 関連するパラメータ名
    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`（画像、動画）に対応します
          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` にできます
        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
        prompt_tokens_details:
          type: object
          description: 入力 token の詳細内訳
          properties:
            cached_tokens:
              type: integer
              description: キャッシュに該当した入力 token 数
              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` の場合）。1 枚あたり最大 10 MB、JPEG / PNG / GIF / WEBP
            に対応
          required:
            - url
          properties:
            url:
              type: string
              description: 画像 URL、または `data:` で始まる base64 data URL
            detail:
              type: string
              description: |-
                画像の解析解像度を制御します

                - `low`：低精度、消費トークンが少ない
                - `default`：デフォルト精度
                - `high`：高精度、より細部を認識できるが消費トークンが多い
              enum:
                - low
                - default
                - high
              default: default
            max_long_side_pixel:
              type: integer
              description: 画像の最長辺のピクセル上限
              minimum: 1
        video_url:
          type: object
          description: >-
            動画入力（`type=video_url` の場合）。URL / Base64 動画は最大 50 MB、MP4 / AVI / MOV
            / MKV に対応
          required:
            - url
          properties:
            url:
              type: string
              description: >-
                動画 URL、`data:` で始まる base64 data URL、または `mm_file://{file_id}`
                形式のファイル参照
            detail:
              type: string
              description: 動画のフレーム抽出解像度を制御します
              enum:
                - low
                - default
                - high
              default: default
            fps:
              type: number
              description: |-
                動画のフレーム抽出レート。デフォルト 1、範囲 [0.2, 5]

                - 値が高いほど：画面の変化により敏感になり、トークンコストが高く速度が遅くなります
                - 値が低いほど：トークンコストが低く速度が速くなりますが、画面の変化に鈍くなります
              minimum: 0.2
              maximum: 5
              default: 1
            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: AI の返信メッセージの内容（ツール呼び出しがトリガーされた場合は `null` になることがあります）
          example: こんにちは！私は MiniMax-M3 です。対話、執筆、推論、コーディングなど、さまざまなタスクをお手伝いできます。
        reasoning_content:
          type: string
          description: >-
            思考内容。リクエストで `reasoning_split=true` を設定した場合のみ返却されます。デフォルトでは思考内容は
            `content` の `<think>...</think>` 内にインラインされます
          example: この問題を分析してみましょう...
        reasoning_details:
          type: array
          description: 構造化された思考内容。リクエストで `reasoning_split=true` を設定した場合のみ返却されます
          items:
            type: object
            properties:
              type:
                type: string
                description: 思考内容の種類。例：`reasoning.text`
              id:
                type: string
                description: 思考セグメントの識別子
              format:
                type: string
                description: 思考内容のフォーマット識別子。例：`MiniMax-response-v1`
              index:
                type: integer
                description: 思考セグメントの順序インデックス
              text:
                type: string
                description: このセグメントの思考テキスト
        name:
          type: string
          description: 送信者名
        audio_content:
          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: |-
        ##すべての API は Bearer Token 認証が必要です##

        **API キーの取得：**

        [API キー管理ページ](https://evolink.ai/dashboard/keys)にアクセスして API キーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````