> ## 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 - Anthropic 互換 API

> - Anthropic Messages プロトコルを使用して MiniMax-M3 モデルを呼び出します
- リクエスト / レスポンス構造は Anthropic API と整合します
- **マルチモーダル対話**：`content` はテキストと画像の content block に対応
- **システムプロンプト**：トップレベルの `system` フィールドで渡します
- **思考モード**：`thinking` オブジェクトで制御。思考内容は `content[type=thinking]` block で返却
- **ストリーミング出力**：SSE イベントストリーム
- **ツール呼び出し**：Anthropic `tool_use` / `tool_result` フローに対応

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


## OpenAPI

````yaml ja/api-manual/language-series/minimax-m3/minimax-m3-messages.json POST /v1/messages
openapi: 3.1.0
info:
  title: MiniMax-M3 Anthropic 互換インターフェース
  description: >-
    MiniMax-M3 を Anthropic Messages プロトコルで呼び出すための完全な API リファレンス。


    **互換性に関する説明**：

    - パス：`/v1/messages`（Anthropic 標準パス）

    - リクエスト / レスポンス構造は Anthropic Messages API と一致

    - 対応フィールド：`model` `messages`（必須）`system` `max_tokens` `temperature` `top_p`
    `stream` `thinking` `tools` `tool_choice` `metadata`


    **モデル能力**：

    - 最大出力：**524,288 tokens**（512K）、推奨 **131,072 tokens**（128K）

    - 思考モード：`thinking` のデフォルトは `adaptive`、思考内容は `content[type=thinking]` block
    で返却

    - マルチモーダル入力：テキストと画像の content block に対応
  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-M3 Messages インターフェース（Anthropic 互換）
      description: >-
        - Anthropic Messages プロトコルを使用して MiniMax-M3 モデルを呼び出します

        - リクエスト / レスポンス構造は Anthropic API と整合します

        - **マルチモーダル対話**：`content` はテキストと画像の content block に対応

        - **システムプロンプト**：トップレベルの `system` フィールドで渡します

        - **思考モード**：`thinking` オブジェクトで制御。思考内容は `content[type=thinking]` block
        で返却

        - **ストリーミング出力**：SSE イベントストリーム

        - **ツール呼び出し**：Anthropic `tool_use` / `tool_result` フローに対応
      operationId: createMessageMiniMaxM3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageRequest'
            examples:
              simple:
                summary: 最小限の実行可能なリクエスト
                value:
                  model: MiniMax-M3
                  max_tokens: 1024
                  messages:
                    - role: user
                      content: こんにちは、世界
              system_prompt:
                summary: system プロンプト + マルチターンあり
                value:
                  model: MiniMax-M3
                  max_tokens: 2048
                  system: あなたは経験豊富な技術エディターです。
                  messages:
                    - role: user
                      content: MiniMax-M3 を三文で説明してください。
              image_understanding:
                summary: 画像理解（マルチモーダル content block）
                value:
                  model: MiniMax-M3
                  max_tokens: 500
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: この画像には何が写っていますか？
                        - type: image
                          source:
                            type: url
                            url: https://example.com/image.jpeg
              disable_thinking:
                summary: 思考モードを無効化
                value:
                  model: MiniMax-M3
                  max_tokens: 512
                  thinking:
                    type: disabled
                  messages:
                    - role: user
                      content: 一文で：日本の首都は？
              tool_use:
                summary: ツール呼び出し（Anthropic tool_use スタイル）
                value:
                  model: MiniMax-M3
                  max_tokens: 2048
                  messages:
                    - role: user
                      content: サンフランシスコの天気を調べて教えて
                  tools:
                    - name: get_weather
                      description: 指定した地点の現在の天気を照会します
                      input_schema:
                        type: object
                        properties:
                          location:
                            type: string
                            description: 都市と州 / 国、例：San Francisco, US
                        required:
                          - location
                  tool_choice:
                    type: auto
              streaming:
                summary: ストリーミング出力（SSE）
                value:
                  model: MiniMax-M3
                  max_tokens: 1024
                  stream: true
                  messages:
                    - role: user
                      content: 春についての短い詩を書いて
      responses:
        '200':
          description: メッセージオブジェクト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
              examples:
                thinking_adaptive:
                  summary: thinking 自適応（thinking content block を含む）
                  value:
                    id: 066a381bdc3c0ded310e27c9a46d16e7
                    type: message
                    role: assistant
                    model: MiniMax-M3
                    content:
                      - type: thinking
                        thinking: >-
                          ユーザーが尋ねているのは日本の首都で、これは基礎的な地理の知識の質問です。答えは東京で、そのまま提示すればよいです。
                        signature: 066a381bdc3c0ded310e27c9a46d16e7
                      - type: text
                        text: 日本の首都は**東京**です。
                    stop_reason: end_turn
                    usage:
                      input_tokens: 7
                      output_tokens: 77
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 0
                tool_use:
                  summary: ツール呼び出しがトリガー（stop_reason=tool_use）
                  value:
                    id: 066a381bdc3c0ded310e27c9a46d16e8
                    type: message
                    role: assistant
                    model: MiniMax-M3
                    content:
                      - type: text
                        text: わかりました、サンフランシスコの天気を調べますね。
                      - type: tool_use
                        id: toolu_01abc123xyz
                        name: get_weather
                        input:
                          location: San Francisco, US
                    stop_reason: tool_use
                    usage:
                      input_tokens: 35
                      output_tokens: 68
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 0
        '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:
    CreateMessageRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: 呼び出すモデル
          enum:
            - MiniMax-M3
          example: MiniMax-M3
        max_tokens:
          type: integer
          description: |-
            生成内容の長さの上限（Token 数）

            **説明**：
            - MiniMax-M3 は **131,072**（128K）を推奨、上限は **524,288**（512K）
            - thinking によって生成されるトークンもこの上限に含まれます
            - 上限を超えた内容は切り捨てられます。生成が `length` の理由で中断された場合は、この値を引き上げてみてください
          minimum: 1
          maximum: 524288
          example: 1024
        messages:
          type: array
          description: |-
            対話メッセージのリスト。user / assistant をターンごとに交互に並べます

            **説明**：
            - 少なくとも 1 件のメッセージを含む必要があります
            - 最後のメッセージは通常 `role=user` です
          items:
            $ref: '#/components/schemas/InputMessage'
          minItems: 1
        system:
          description: |-
            システムプロンプト。AI の役割と振る舞いを設定するために使用します

            **説明**：
            - 文字列または文字列の配列に対応
            - トップレベルの `system` フィールドで渡します
          oneOf:
            - type: string
              example: You are a helpful assistant.
            - type: array
              description: content block 配列形式のシステムプロンプト。text ブロックには cache_control を付与できます
              items:
                type: object
                required:
                  - type
                  - text
                properties:
                  type:
                    type: string
                    enum:
                      - text
                  text:
                    type: string
                  cache_control:
                    $ref: '#/components/schemas/CacheControl'
        temperature:
          type: number
          description: |-
            サンプリング温度

            **説明**：
            - 範囲 `[0, 2]`
            - デフォルト 1；値が高いほど発散的に、低いほど確定的になります
          minimum: 0
          maximum: 2
          default: 1
          example: 1
        top_p:
          type: number
          description: |-
            核サンプリングのしきい値

            **説明**：
            - 範囲 `[0, 1]`、MiniMax-M3 のデフォルトは 0.95
            - temperature と top_p を同時に調整しないことを推奨します
          minimum: 0
          maximum: 1
          default: 0.95
          example: 0.95
        stream:
          type: boolean
          description: |-
            SSE ストリーミングで返すかどうか

            - `true`：Server-Sent Events のストリーミング返却
            - `false`：完全なレスポンスを待ってから一括で返します（デフォルト）
          default: false
          example: false
        thinking:
          type: object
          description: >-
            深い思考を制御します。thinking を有効にした場合、マルチターン対話では thinking
            ブロックを原文のまま返送する必要があります


            **説明**：

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

            - 有効時にはレスポンスの `content` 配列に `type="thinking"` の推論過程 block が含まれます（出力
            token として課金されます）
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - disabled
                - adaptive
              description: |-
                - `adaptive`：モデルが思考の要否を自律的に判断します（推奨デフォルト値）
                - `disabled`：思考を無効化し、直接回答します
              default: adaptive
        tools:
          type: array
          description: |-
            ツール定義リスト

            **説明**：
            - Anthropic の tool 定義仕様に従います
            - `input_schema` は JSON Schema オブジェクトを使用します
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: object
          description: ツール選択戦略。auto と none のみ対応します
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - auto
                - none
              description: |-
                - `auto`：モデルがツールを呼び出すかを自動的に決定します（tools を指定した場合のデフォルト）
                - `none`：ツール呼び出しを禁止します
        metadata:
          type: object
          description: リクエストメタデータ
          properties:
            user_id:
              type: string
              description: エンドユーザーを表す一意の識別子。ユーザー単位での監視や不正使用の検出に利用できます（ハッシュ化した ID の使用を推奨）
    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-M3
        content:
          type: array
          description: |-
            レスポンス content block リスト

            **含まれる可能性のある block type**：
            - `thinking`：推論過程（thinking が有効な場合のみ）
            - `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
    InputMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - user_system
            - group
            - sample_message_user
            - sample_message_ai
          description: >-
            メッセージ送信側の役割。MiniMax-M3 は user / assistant を交互に並べたメッセージを使用します


            - `user`：ユーザーメッセージ（`tool_result` block の返送にも使用）

            - `assistant`：アシスタントの過去の返信（`text` / `thinking` / `tool_use` blocks
            を含むことがあります）


            注意：**ここでは `system` を受け付けません**：システムプロンプトはトップレベルの `system`
            フィールドで渡してください。
        content:
          description: >-
            メッセージ内容


            **説明**：

            - プレーンテキストの場合は文字列を直接渡します

            - 構造化された内容の場合は content block 配列（`text` / `image` / `video` /
            `tool_use` / `tool_result` / `thinking`）を渡します
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentBlock'
    CacheControl:
      type: object
      description: プロンプトキャッシュマーカー
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - ephemeral
          description: キャッシュマーカーの種類
    Tool:
      type: object
      required:
        - name
        - input_schema
      properties:
        name:
          type: string
          description: |-
            ツール名

            **説明**：
            - `a-zA-Z0-9_-` のみ許可されます
            - 最大 64 文字
        description:
          type: string
          description: ツールの機能説明。モデルがいつ呼び出すべきかを判断するのに役立ちます
        input_schema:
          type: object
          description: |-
            ツール入力パラメータの JSON Schema オブジェクト

            **説明**：
            - `type` は `object` である必要があります
            - `properties` と `required` を宣言すべきです
        cache_control:
          $ref: '#/components/schemas/CacheControl'
    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` の場合の完全性署名。マルチターン文脈の検証に使用します
        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: 入力 token 数（キャッシュ未命中部分）
          example: 7
        output_tokens:
          type: integer
          description: 出力 token 数（thinking を含む）
          example: 77
        cache_creation_input_tokens:
          type: integer
          description: キャッシュ作成に使用された入力 token 数
          example: 0
        cache_read_input_tokens:
          type: integer
          description: キャッシュから読み取られた入力 token 数
          example: 0
    ContentBlock:
      type: object
      description: |-
        メッセージ content block

        **対応する type**：
        - `text`：テキスト内容
        - `image`：画像入力（MiniMax-M3 のみ）
        - `video`：動画入力（MiniMax-M3 のみ）
        - `tool_use`：前のターンの assistant ツール呼び出しを返送
        - `tool_result`：ツール実行結果
        - `thinking`：前のターンの assistant 思考内容を返送
        - `mid_conv_system`：対話の途中に挿入するシステム指示
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - text
            - image
            - video
            - tool_use
            - tool_result
            - thinking
            - mid_conv_system
        text:
          type: string
          description: type=`text` の場合のテキスト内容
        source:
          $ref: '#/components/schemas/MediaSource'
          description: 画像または動画のソース。type=`image` または type=`video` の場合に使用します（MiniMax-M3 のみ）
        id:
          type: string
          description: ツール呼び出し ID（tool_use の場合は必須）
        name:
          type: string
          description: ツール名（tool_use の場合は必須）
        input:
          type: object
          description: ツールの入力パラメータ（tool_use の場合、JSON オブジェクト）
        tool_use_id:
          type: string
          description: 対応するツール呼び出し ID（tool_result の場合は必須、tool_use.id に対応）
        content:
          description: ツール実行結果（tool_result）。文字列または content block 配列
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        thinking:
          type: string
          description: 返送する assistant の思考過程の内容（type=`thinking` の場合に使用）
        signature:
          type: string
          description: 返送する thinking 内容の署名。マルチターン継続時には原文のまま返送する必要があります
        cache_control:
          $ref: '#/components/schemas/CacheControl'
    MediaSource:
      type: object
      description: |-
        画像または動画 content block のメディアソース

        - 画像は JPEG / PNG / GIF / WEBP に対応、1 枚あたり最大 10 MB
        - 動画は MP4 / AVI / MOV / MKV に対応、URL / Base64 は最大 50 MB
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - base64
            - url
          description: メディアソースの種類
        media_type:
          type: string
          description: base64 入力の場合は必須。例：`image/png` または `video/mp4`
        data:
          type: string
          description: base64 エンコードされたメディアのバイト列
        url:
          type: string
          description: 公開 URL；動画は `mm_file://{file_id}` 形式のファイル参照も使用できます
        detail:
          type: string
          enum:
            - low
            - default
            - high
          default: default
          description: 理解の精細度。デフォルトは default。解像度が高いほど消費トークンが多くなります
        fps:
          type: number
          minimum: 0.2
          maximum: 5
          default: 1
          description: 動画のフレーム抽出レート。デフォルト 1、範囲 [0.2, 5]。値が高いほど画面の変化に敏感になり、消費トークンが多くなります
        max_long_side_pixel:
          type: integer
          minimum: 1
          description: 画像または動画フレームの最長辺のピクセル上限
  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 認証を採用しています。

````