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

> Anthropic Messages。必須フィールドは `model`, `max_tokens`, `messages` です。`max_tokens` には推論と回答本文の両方が含まれます。`MiniMax-M4` と `MiniMax-M3.1-Flash` は常に推論し、`content` 内の `thinking` ブロックに推論を返します。`MiniMax-M3` は既定では推論しません。`thinking` に `{"type": "adaptive"}` を指定すると、推論が有効になり `thinking` ブロックが返ります。`MiniMax-M2.5` は推論しますが `thinking` ブロックは返しません。推論トークンは `output_tokens` に含まれます。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API リファレンス](/ja/api-manual/language-series/minimax/messages/messages-reference) を参照してください。

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

> [!NOTE]
>
> `max_tokens` には推論と回答本文の両方が含まれます。`MiniMax-M4` と `MiniMax-M3.1-Flash` は常に推論し、`content` 内の `thinking` ブロックに推論を返します。`MiniMax-M3` は既定では推論しません。`thinking` に `{"type": "adaptive"}` を指定すると、推論が有効になり `thinking` ブロックが返ります。`MiniMax-M2.5` は推論しますが `thinking` ブロックは返しません。推論トークンは `output_tokens` に含まれます。出力トークンはまず 1,024 以上を目安にしてください。推論で使い切ると本文が返らないことがあります。


## OpenAPI

````yaml ja/api-manual/language-series/minimax/messages/messages-quickstart.json POST /v1/messages
openapi: 3.1.0
info:
  title: MiniMax Messages クイックスタート
  description: >-
    MiniMax Messages クイックスタート (Anthropic 互換)。必須フィールドは `model`, `max_tokens`,
    `messages` です。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API
    リファレンス](/ja/api-manual/language-series/minimax/messages/messages-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: Messages
    description: Anthropic Messages プロトコルのエンドポイント
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: MiniMax Messages クイックスタート (Anthropic 互換)
      description: >-
        Anthropic Messages。必須フィールドは `model`, `max_tokens`, `messages`
        です。`max_tokens` には推論と回答本文の両方が含まれます。`MiniMax-M4` と `MiniMax-M3.1-Flash`
        は常に推論し、`content` 内の `thinking` ブロックに推論を返します。`MiniMax-M3`
        は既定では推論しません。`thinking` に `{"type": "adaptive"}` を指定すると、推論が有効になり
        `thinking` ブロックが返ります。`MiniMax-M2.5` は推論しますが `thinking`
        ブロックは返しません。推論トークンは `output_tokens`
        に含まれます。ツール呼び出し、画像・動画入力、ストリーミング、複数ターンの会話については [API
        リファレンス](/ja/api-manual/language-series/minimax/messages/messages-reference)
        を参照してください。
      operationId: createMessageMiniMaxQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageQuickRequest'
            examples:
              simple:
                summary: 最小構成の呼び出し
                value:
                  model: MiniMax-M4
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Please introduce yourself in one sentence.
              flash:
                summary: MiniMax-M3.1-Flash を呼び出す
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m3:
                summary: MiniMax-M3 を呼び出す
                value:
                  model: MiniMax-M3
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m25:
                summary: MiniMax-M2.5 を呼び出す
                value:
                  model: MiniMax-M2.5
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
      responses:
        '200':
          description: メッセージオブジェクト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
              examples:
                with_thinking:
                  summary: 思考内容を含むレスポンス（thinking ブロック）
                  value:
                    id: example_a9e449
                    type: message
                    role: assistant
                    model: MiniMax-M3.1-Flash
                    content:
                      - thinking: Let the ball cost x. Then 2x + 1 = 1.10, so x = 0.05.
                        signature: EXAMPLE_THINKING_SIGNATURE
                        type: thinking
                      - text: '0.05'
                        type: text
                    usage:
                      input_tokens: 55
                      output_tokens: 66
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 174
                      output_tokens_details:
                        thinking_tokens: 63
                    stop_reason: end_turn
                m25_answer:
                  summary: '`MiniMax-M2.5` のレスポンス (`thinking` ブロックなし)'
                  value:
                    id: chatcmpl-example
                    type: message
                    role: assistant
                    content:
                      - type: text
                        text: >-
                          Recursion is a technique in which a function calls
                          itself to solve smaller instances of a problem.
                    stop_reason: end_turn
                    model: MiniMax-M2.5
                    usage:
                      input_tokens: 44
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 0
                      output_tokens: 101
        '400':
          description: リクエストパラメータが不正です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                request_id: req_xxx
                error:
                  type: invalid_request_error
                  message: Invalid request
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: authentication_error
                  message: Authentication error
        '402':
          description: クォータ不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: billing_error
                  message: Insufficient quota
        '403':
          description: 権限エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: permission_error
                  message: Permission denied
        '404':
          description: モデルまたはリソースが存在しません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: not_found_error
                  message: Model not found
        '429':
          description: レート制限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: rate_limit_error
                  message: Rate limited
        '500':
          description: サーバー内部エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: ゲートウェイエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: サービスが一時的に利用できません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateMessageQuickRequest:
      type: object
      required:
        - model
        - max_tokens
        - 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
        max_tokens:
          type: integer
          minimum: 1
          example: 4096
          description: >-
            Anthropic のプロトコルでは必須です。**最大出力（推論トークンを含む）** — `MiniMax-M4` 262,144,
            `MiniMax-M3.1-Flash` 524,288, `MiniMax-M3` 524,288, `MiniMax-M2.5`
            32,768。出力トークンはまず 1,024 以上を目安にしてください。推論で使い切ると本文が返らないことがあります。
        messages:
          type: array
          description: 対話メッセージのリスト。時系列順に並べます。最低 1 件のメッセージが必要です。
          minItems: 1
          items:
            type: object
            required:
              - role
              - content
            properties:
              role:
                type: string
                enum:
                  - user
                  - assistant
                description: メッセージのロール
              content:
                type: string
                description: メッセージ本文
    MessageResponse:
      type: object
      description: Anthropic スタイルのメッセージレスポンス
      properties:
        id:
          type: string
          description: メッセージの一意の ID
        type:
          type: string
          enum:
            - message
          description: レスポンスオブジェクトの種類
        role:
          type: string
          enum:
            - assistant
        model:
          type: string
          description: 実際に使用されたモデル
          example: MiniMax-M4
        content:
          type: array
          description: >-
            応答ブロックは `thinking`（推論。簡単な質問では省略される場合があり、`MiniMax-M2.5`
            では常に省略）、`text`（回答本文）、`tool_use`（ツール呼び出し）です。
          items:
            $ref: '#/components/schemas/OutputContentBlock'
        stop_reason:
          type: string
          description: |-
            停止理由

            - `end_turn`：自然終了
            - `max_tokens`：max_tokens の上限に到達
            - `tool_use`：モデルがツール呼び出しをトリガー
          enum:
            - end_turn
            - max_tokens
            - tool_use
        usage:
          $ref: '#/components/schemas/AnthropicUsage'
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          properties:
            type:
              type: string
              description: >-
                エラーの種類（例：invalid_request_error / authentication_error /
                billing_error など）
            message:
              type: string
              description: エラー説明
        request_id:
          type: string
          description: リクエスト追跡 ID
    OutputContentBlock:
      type: object
      description: レスポンス内の content block
      properties:
        type:
          type: string
          enum:
            - text
            - thinking
            - tool_use
        text:
          type: string
          description: type=`text` の場合のテキスト
        thinking:
          type: string
          description: type=`thinking` の場合の推論過程テキスト
        signature:
          type: string
          description: >-
            type=`thinking` の場合の完全性署名。マルチターン文脈の検証に使用します。例の `signature`
            はプレースホルダーです。次のリクエストでは、直前のレスポンスに含まれる値をそのまま送信してください。
        id:
          type: string
          description: type=`tool_use` の場合のツール呼び出し ID
        name:
          type: string
          description: type=`tool_use` の場合のツール名
        input:
          type: object
          description: type=`tool_use` の場合にモデルが生成した JSON 入力パラメータ
    AnthropicUsage:
      type: object
      description: Token 使用統計（Anthropic 規格）
      properties:
        input_tokens:
          type: integer
          description: キャッシュにヒットしなかった入力トークン数（`cache_read_input_tokens` を含みません）
          example: 55
        output_tokens:
          type: integer
          description: 出力 token 数（thinking を含む）
          example: 66
        cache_creation_input_tokens:
          type: integer
          description: キャッシュ作成に使用された入力トークン数。自動キャッシュでは 0 です
          example: 0
        cache_read_input_tokens:
          type: integer
          description: >-
            キャッシュにヒットした入力トークン数。キャッシュヒット料金が適用されます。入力全体のトークン数は `input_tokens +
            cache_read_input_tokens` です
          example: 174
        output_tokens_details:
          type: object
          description: 出力 token の詳細内訳
          properties:
            thinking_tokens:
              type: integer
              description: 思考で生成されたトークン数（`output_tokens` に含まれます）
              example: 63
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        すべての API は Bearer Token 認証が必要です

        **API キーの取得：**

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

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

        **備考**：EvoLink は `/v1/messages` に対して一律で Bearer Token 認証を採用しています。

````

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