> ## 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。必須フィールドは `model`, `messages` です。このエンドポイントではすべてのモデルで推論が既定で有効です。推論トークンも出力上限に含まれ、出力料金が適用されます。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API リファレンス](/ja/api-manual/language-series/minimax/chat-completions/chat-completions-reference) を参照してください。

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

> [!NOTE]
>
> このエンドポイントではすべてのモデルで推論が既定で有効です。推論トークンも出力上限に含まれ、出力料金が適用されます。`MiniMax-M3` は既定で `content` の先頭に `<think>...</think>` を含めます。`reasoning_split: true` にすると推論は `reasoning_content` に分かれます。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API リファレンス](https://evolink.ai/docs/ja/api-manual/language-series/minimax/chat-completions/chat-completions-reference.md) を参照してください。


## OpenAPI

````yaml ja/api-manual/language-series/minimax/chat-completions/chat-completions-quickstart.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: MiniMax Chat Completions クイックスタート
  description: >-
    MiniMax Chat Completions クイックスタート (OpenAI 互換)。必須フィールドは `model`, `messages`
    です。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API
    リファレンス](/ja/api-manual/language-series/minimax/chat-completions/chat-completions-reference)
    を参照してください。
  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 Chat Completions クイックスタート
      description: >-
        OpenAI Chat Completions。必須フィールドは `model`, `messages`
        です。このエンドポイントではすべてのモデルで推論が既定で有効です。推論トークンも出力上限に含まれ、出力料金が適用されます。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については
        [API
        リファレンス](/ja/api-manual/language-series/minimax/chat-completions/chat-completions-reference)
        を参照してください。
      operationId: createChatCompletionMiniMaxQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionQuickRequest'
            examples:
              simple:
                summary: 最小構成の呼び出し
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content: Please introduce yourself in one sentence.
              flash:
                summary: MiniMax-M3.1-Flash を呼び出す
                value:
                  model: MiniMax-M3.1-Flash
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m3:
                summary: MiniMax-M3 を呼び出す
                value:
                  model: MiniMax-M3
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m25:
                summary: MiniMax-M2.5 を呼び出す
                value:
                  model: MiniMax-M2.5
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              multi_turn:
                summary: マルチターン対話
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content: Recommend a programming language for beginners.
                    - role: assistant
                      content: >-
                        Python is a good choice: simple syntax and a large
                        ecosystem.
                    - role: user
                      content: How long does it take to learn?
      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: 未認証、トークンが無効または期限切れです
          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:
    ChatCompletionQuickRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: >-
            | モデル | コンテキスト（トークン） | 最大出力（トークン） |

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

            | `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 |


            `MiniMax-M4`、`MiniMax-M3.1-Flash`、`MiniMax-M3`
            は画像と動画に対応しています。`MiniMax-M2.5` はテキストのみです。
          enum:
            - MiniMax-M4
            - MiniMax-M3.1-Flash
            - MiniMax-M3
            - MiniMax-M2.5
          example: MiniMax-M4
        messages:
          type: array
          description: 対話メッセージのリスト。時系列順に並べます。最低 1 件のメッセージが必要です。
          minItems: 1
          items:
            type: object
            required:
              - role
              - content
            properties:
              role:
                type: string
                enum:
                  - system
                  - user
                  - assistant
                description: メッセージのロール
              content:
                type: string
                description: メッセージ本文
    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: 関連するパラメータ名
    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: 入力トークンの総数（キャッシュヒット分を含む）
          example: 1365
        completion_tokens:
          type: integer
          description: 出力トークン数（思考部分を含む）
          example: 239
        completion_tokens_details:
          type: object
          description: 出力 token の詳細内訳
          properties:
            reasoning_tokens:
              type: integer
              description: 思考で生成されたトークン数
              example: 49
        prompt_tokens_details:
          type: object
          description: 入力 token の詳細内訳
          properties:
            cached_tokens:
              type: integer
              description: >-
                キャッシュにヒットした入力トークン数


                キャッシュヒット分にはキャッシュヒット料金が適用されます。キャッシュにヒットしなかった部分は `prompt_tokens -
                cached_tokens` で、標準入力料金が適用されます
              example: 114
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: メッセージ送信者の役割
          enum:
            - assistant
          example: assistant
        content:
          type:
            - string
            - 'null'
          description: >-
            最終回答の本文。ツール呼び出し時は `null` の場合があります。`MiniMax-M3` は既定で `content` の先頭に
            `<think>...</think>` を含めます。`reasoning_split: true` にすると推論は
            `reasoning_content` に分かれます。
          example: '0.05'
        reasoning_content:
          type: string
          description: >-
            `MiniMax-M3` は既定で `content` の先頭に `<think>...</think>`
            を含めます。`reasoning_split: true` にすると推論は `reasoning_content`
            に分かれます。簡単な質問で推論が生成されなかった場合、このフィールドは省略されます。
          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: |-
        すべての API で Bearer Token 認証が必要です

        **API キーの取得：**

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

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

````

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