> ## 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 Responses クイックスタート

> 対応モデル: `MiniMax-M4`、`MiniMax-M3.1-Flash`。必須フィールドは `model`, `input` です。`max_output_tokens` — 出力トークンはまず 1,024 以上を目安にしてください。推論で使い切ると本文が返らないことがあります。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API リファレンス](/ja/api-manual/language-series/minimax/responses/responses-reference) を参照してください。

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

`POST /v1/responses` — 対応モデル: `MiniMax-M4`、`MiniMax-M3.1-Flash`。必須フィールドは `model`, `input` です。最小の例では出力上限も指定しています。

> [!WARNING]
>
> Responses は `MiniMax-M4` と `MiniMax-M3.1-Flash` に対応します。`MiniMax-M3` と `MiniMax-M2.5` には [Chat Completions](https://evolink.ai/docs/ja/api-manual/language-series/minimax/chat-completions/chat-completions-quickstart.md) または [Messages](https://evolink.ai/docs/ja/api-manual/language-series/minimax/messages/messages-quickstart.md) を使用してください。
>
> 入力に `input`、出力上限に `max_output_tokens`、推論の深さに `reasoning.effort` を使います。`MiniMax-M4` と `MiniMax-M3.1-Flash` では推論が常に有効です。推論の深さは `low`、`medium`、`high`、`xhigh`、`max`（既定値）です。`none` は HTTP 400 になります。深くするほど通常は推論トークンと応答時間が増えます。

## 回答本文の読み取り

`output` には推論、本文、ツール呼び出しが含まれます。`type="message"` の項目から `output_text` ブロックを取り出してください。先頭が推論のこともあります。

レスポンス JSON を `response` にパース済みの場合、次のようにテキストを抽出できます。

```python theme={null}
text = "".join(
    part["text"]
    for item in response.get("output", [])
    if item.get("type") == "message"
    for part in item.get("content", [])
    if part.get("type") == "output_text"
)
print(text)
```

> [!NOTE]
>
> **最大出力（推論トークンを含む）** — `MiniMax-M4` 262,144, `MiniMax-M3.1-Flash` 524,288。出力トークンはまず 1,024 以上を目安にしてください。推論で使い切ると本文が返らないことがあります。`status="incomplete"` かつ `incomplete_details.reason="max_output_tokens"` なら出力上限を増やしてください。

ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API リファレンス](https://evolink.ai/docs/ja/api-manual/language-series/minimax/responses/responses-reference.md) を参照してください。


## OpenAPI

````yaml ja/api-manual/language-series/minimax/responses/responses-quickstart.json POST /v1/responses
openapi: 3.1.0
info:
  title: MiniMax Responses クイックスタート
  description: >-
    MiniMax Responses クイックスタート (OpenAI Responses) — `MiniMax-M4`,
    `MiniMax-M3.1-Flash`.
  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/responses:
    post:
      tags:
        - 対話生成
      summary: MiniMax Responses クイックスタート
      description: >-
        対応モデル: `MiniMax-M4`、`MiniMax-M3.1-Flash`。必須フィールドは `model`, `input`
        です。`max_output_tokens` — 出力トークンはまず 1,024
        以上を目安にしてください。推論で使い切ると本文が返らないことがあります。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については
        [API
        リファレンス](/ja/api-manual/language-series/minimax/responses/responses-reference)
        を参照してください。
      operationId: createResponseMiniMaxQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesQuickRequest'
            examples:
              simple:
                summary: 最小構成の呼び出し
                value:
                  model: MiniMax-M4
                  input: Please introduce yourself in one sentence.
                  max_output_tokens: 4096
              flash:
                summary: MiniMax-M3.1-Flash を呼び出す
                value:
                  model: MiniMax-M3.1-Flash
                  input: Explain HTTP in one sentence.
                  max_output_tokens: 4096
      responses:
        '200':
          description: 生成に成功しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
              examples:
                with_reasoning:
                  summary: 思考内容を含むレスポンス
                  value:
                    id: example_ae5b7d
                    object: response
                    created_at: 1792405562
                    model: MiniMax-M3.1-Flash
                    status: completed
                    output:
                      - id: example_ae5b7d_rs
                        type: reasoning
                        status: completed
                        summary: []
                        content:
                          - type: reasoning_text
                            text: >-
                              We need solve CRT. Need only n. Compute. n=3 mod7,
                              5 mod11,7 mod13. Product 1001. Let's solve.


                              Use n=3+7a. mod11: 3+7a=5 =>7a=2 mod11. inverse7=8
                              (56=1), a=16=5 mod11. a=5+11b. n=38+77b. mod13:
                              38+77b = 12+12b mod13 (77=12,38=12) equals7
                              =>12b=-5=8 mod13. inverse12=12, b=96 mod13 =5? 91
                              remainder5. n=38+385=423. Check 423 mod7 3 (420),
                              mod11 5 (418), mod13 7 (416). Smallest positive
                              423. Only n.
                        encrypted_content: EXAMPLE_ENCRYPTED_CONTENT
                      - id: example_ae5b7d_msg
                        type: message
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: '423'
                            annotations: []
                    output_text: '423'
                    usage:
                      input_tokens: 239
                      output_tokens: 190
                      total_tokens: 429
                      input_tokens_details:
                        cached_tokens: 174
                      output_tokens_details:
                        reasoning_tokens: 189
                    error: null
                    incomplete_details: null
                function_call:
                  summary: ツール呼び出し
                  value:
                    id: example_2ab00b
                    object: response
                    created_at: 1792405566
                    model: MiniMax-M3.1-Flash
                    status: completed
                    output:
                      - id: example_2ab00b_msg
                        type: message
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: I'll check the stock level for that product now.
                            annotations: []
                      - id: example_2ab00b_fc_0
                        type: function_call
                        status: completed
                        call_id: call_example_1
                        name: get_product_stock
                        arguments: '{"product_id": "demo-item-001"}'
                    output_text: I'll check the stock level for that product now.
                    usage:
                      input_tokens: 479
                      output_tokens: 43
                      total_tokens: 522
                      input_tokens_details:
                        cached_tokens: 174
                    error: null
                    incomplete_details: null
                incomplete:
                  summary: 出力上限に到達（status=incomplete）
                  value:
                    id: example_de610c
                    object: response
                    created_at: 1792401719
                    model: MiniMax-M3.1-Flash
                    status: incomplete
                    output:
                      - id: example_de610c_rs
                        type: reasoning
                        status: completed
                        summary: []
                        content:
                          - type: reasoning_text
                            text: I need to explain the process step by step.
                        encrypted_content: EXAMPLE_ENCRYPTED_CONTENT
                    output_text: null
                    usage:
                      input_tokens: 211
                      output_tokens: 8
                      total_tokens: 219
                      input_tokens_details:
                        cached_tokens: 195
                      output_tokens_details:
                        reasoning_tokens: 8
                    error: null
                    incomplete_details:
                      reason: max_output_tokens
        '400':
          description: リクエストパラメータが不正です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_prompt
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、トークンが無効または期限切れです
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid authentication credentials
                  type: authentication_error
        '402':
          description: クォータ不足、チャージが必要
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota
        '403':
          description: このモデルへのアクセス権限がありません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Model access denied
                  type: permission_error
        '404':
          description: リソースが存在しません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Model not found
                  type: not_found_error
        '413':
          description: リクエストボディが大きすぎます
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Request entity too large
                  type: invalid_request_error
        '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: server_error
        '502':
          description: ゲートウェイエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Bad gateway
                  type: server_error
        '503':
          description: サービスが一時的に利用できません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: server_error
components:
  schemas:
    ResponsesQuickRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - MiniMax-M4
            - MiniMax-M3.1-Flash
          example: MiniMax-M4
          description: >-
            | モデル | コンテキスト（トークン） | 最大出力（トークン） |

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

            | `MiniMax-M4` | 1,000,000 | 262,144 |

            | `MiniMax-M3.1-Flash` | 1,000,000 | 524,288 |


            Responses は `MiniMax-M4` と `MiniMax-M3.1-Flash` に対応します。`MiniMax-M3`
            と `MiniMax-M2.5` には [Chat
            Completions](/ja/api-manual/language-series/minimax/chat-completions/chat-completions-quickstart)
            または
            [Messages](/ja/api-manual/language-series/minimax/messages/messages-quickstart)
            を使用してください。
        input:
          type: string
          example: Explain recursion in one sentence.
          description: >-
            必須フィールドは `model`, `input` です。文字列はユーザーメッセージ 1
            件として扱われます。複数ターン、画像、動画、ツール呼び出しには入力項目の配列を指定します。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については
            [API
            リファレンス](/ja/api-manual/language-series/minimax/responses/responses-reference)
            を参照してください。
        max_output_tokens:
          type: integer
          minimum: 1
          example: 4096
          description: >-
            出力トークンはまず 1,024
            以上を目安にしてください。推論で使い切ると本文が返らないことがあります。**最大出力（推論トークンを含む）** —
            `MiniMax-M4` 262,144, `MiniMax-M3.1-Flash` 524,288.
    ResponsesResponse:
      type: object
      description: >-
        Responses API
        のレスポンスオブジェクト。以下のフィールドに加え、今回のリクエストの設定（`tools`、`tool_choice`、`temperature`、`top_p`、`text`、`reasoning`、`max_output_tokens`
        など）も返されます。
      properties:
        id:
          type: string
          description: このレスポンスの一意識別子
          example: resp_example
        object:
          type: string
          description: オブジェクト種別。常に `response`
          example: response
        created_at:
          type: integer
          description: 作成時刻（Unix タイムスタンプ、秒）
          example: 1792401878
        status:
          type: string
          description: |-
            レスポンスの状態

            - `completed`：正常に完了
            - `incomplete`：途中で打ち切り。理由は `incomplete_details` を参照してください
            - `failed`：生成に失敗。理由は `error` を参照してください
          enum:
            - completed
            - incomplete
            - failed
          example: completed
        model:
          type: string
          description: 実際に本レスポンスを生成したモデル ID
          example: MiniMax-M4
        output:
          type: array
          description: >-
            生成順に並んだ出力アイテムのリスト：


            - `reasoning`：思考過程。id は `<id>_rs` 形式で、`content`（`reasoning_text`
            ブロックのリスト）、`summary`（空の配列）、`encrypted_content` を含みます

            - `message`：最終回答。id は `<id>_msg` 形式で、`content`（`output_text`
            ブロックのリスト）を含みます

            - `function_call`：モデルによる関数呼び出し。id は `<id>_fc_<連番>`
            形式で、`call_id`、`name`、`arguments` を含みます。クライアント側で実行し、結果を
            `function_call_output` として返す必要があります
          items:
            type: object
        output_text:
          type:
            - string
            - 'null'
          description: すべての `output_text` のテキストを連結した結果。テキスト出力がない場合は `null` です
        error:
          type:
            - object
            - 'null'
          description: 失敗の理由。成功時は `null`
        incomplete_details:
          type:
            - object
            - 'null'
          description: >-
            打ち切り理由。打ち切られていない場合は `null` です。`reason` は
            `max_output_tokens`（出力上限に到達）または `content_filter`（コンテンツ安全性）です
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      description: エラーレスポンス
      properties:
        error:
          type: object
          properties:
            code:
              type:
                - integer
                - string
                - 'null'
              description: エラーコード
              example: invalid_prompt
            message:
              type: string
              description: エラー説明
              example: Invalid request parameters
            type:
              type: string
              description: エラータイプ
              example: invalid_request_error
    Usage:
      type: object
      description: トークン使用統計（キャッシュと思考の内訳を含む）
      properties:
        input_tokens:
          type: integer
          description: 入力トークンの総数（キャッシュヒット分を含む）
          example: 207
        input_tokens_details:
          type: object
          description: 入力 token の詳細内訳
          properties:
            cached_tokens:
              type: integer
              description: >-
                キャッシュにヒットした入力トークン数


                キャッシュヒット分にはキャッシュヒット料金が適用されます。キャッシュにヒットしなかった部分は `input_tokens -
                cached_tokens` で、標準入力料金が適用されます
              example: 174
        output_tokens:
          type: integer
          description: 出力トークン数（思考部分を含む）
          example: 32
        output_tokens_details:
          type: object
          description: 出力 token の詳細内訳
          properties:
            reasoning_tokens:
              type: integer
              description: 思考で生成されたトークン数（`output_tokens` に含まれます）
              example: 9
        total_tokens:
          type: integer
          description: 総トークン数 = input_tokens + output_tokens
          example: 239
  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.