> ## 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-Compatible API

> - Use the Anthropic Messages protocol to call the MiniMax-M3 model
- Request / response structure aligns with the Anthropic API
- **Multimodal conversation**: `content` supports text and image content blocks
- **System prompts**: Passed via the top-level `system` field
- **Thinking mode**: Controlled via the `thinking` object; thinking content is returned via `content[type=thinking]` block
- **Streaming output**: SSE event stream
- **Tool calling**: Compatible with Anthropic `tool_use` / `tool_result` flow

<Note>
  **BaseURL**: The default BaseURL is `https://direct.evolink.ai`, which has better support for text models and long-lived connections. `https://api.evolink.ai` is the primary endpoint for multimodal services and serves as a fallback address for text models.
</Note>


## OpenAPI

````yaml /en/api-manual/language-series/minimax-m3/minimax-m3-messages.json POST /v1/messages
openapi: 3.1.0
info:
  title: MiniMax-M3 Anthropic-Compatible Interface
  description: >-
    Complete API reference for calling MiniMax-M3 via the Anthropic Messages
    protocol.


    **Compatibility Notes**:

    - Path: `/v1/messages` (Anthropic standard path)

    - Request / response structure aligns with the Anthropic Messages API

    - Supported fields: `model` `messages` (required) `system` `max_tokens`
    `temperature` `top_p` `stream` `thinking` `tools` `tool_choice` `metadata`


    **Model Capabilities**:

    - Maximum output: **524,288 tokens** (512K), recommended **131,072 tokens**
    (128K)

    - Thinking mode: `thinking` defaults to `adaptive`, thinking content is
    returned via `content[type=thinking]` block

    - Multimodal input: Supports text and image content blocks
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: Production (Recommended)
  - url: https://api.evolink.ai
    description: Alternative URL
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Anthropic Messages protocol endpoints
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: MiniMax-M3 Messages Interface (Anthropic-Compatible)
      description: >-
        - Use the Anthropic Messages protocol to call the MiniMax-M3 model

        - Request / response structure aligns with the Anthropic API

        - **Multimodal conversation**: `content` supports text and image content
        blocks

        - **System prompts**: Passed via the top-level `system` field

        - **Thinking mode**: Controlled via the `thinking` object; thinking
        content is returned via `content[type=thinking]` block

        - **Streaming output**: SSE event stream

        - **Tool calling**: Compatible with Anthropic `tool_use` / `tool_result`
        flow
      operationId: createMessageMiniMaxM3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageRequest'
            examples:
              simple:
                summary: Minimal runnable request
                value:
                  model: MiniMax-M3
                  max_tokens: 1024
                  messages:
                    - role: user
                      content: Hello, world
              system_prompt:
                summary: With system prompt + multi-turn
                value:
                  model: MiniMax-M3
                  max_tokens: 2048
                  system: You are an experienced technical editor.
                  messages:
                    - role: user
                      content: Describe MiniMax-M3 in three sentences.
              image_understanding:
                summary: Image understanding (multimodal content blocks)
                value:
                  model: MiniMax-M3
                  max_tokens: 500
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: What is in this image?
                        - type: image
                          source:
                            type: url
                            url: https://example.com/image.jpeg
              disable_thinking:
                summary: Disable thinking mode
                value:
                  model: MiniMax-M3
                  max_tokens: 512
                  thinking:
                    type: disabled
                  messages:
                    - role: user
                      content: 'In one sentence: what is the capital of Japan?'
              tool_use:
                summary: Tool calling (Anthropic tool_use style)
                value:
                  model: MiniMax-M3
                  max_tokens: 2048
                  messages:
                    - role: user
                      content: Check the weather in San Francisco and tell me
                  tools:
                    - name: get_weather
                      description: Query current weather for a specified location
                      input_schema:
                        type: object
                        properties:
                          location:
                            type: string
                            description: 'City and state/country, e.g.: San Francisco, US'
                        required:
                          - location
                  tool_choice:
                    type: auto
              streaming:
                summary: Streaming output (SSE)
                value:
                  model: MiniMax-M3
                  max_tokens: 1024
                  stream: true
                  messages:
                    - role: user
                      content: Write a short poem about spring
      responses:
        '200':
          description: Message object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
              examples:
                thinking_adaptive:
                  summary: Thinking adaptive (with thinking content block)
                  value:
                    id: 066a381bdc3c0ded310e27c9a46d16e7
                    type: message
                    role: assistant
                    model: MiniMax-M3
                    content:
                      - type: thinking
                        thinking: >-
                          The user is asking about the capital of Japan, which
                          is a basic geography question. The answer is Tokyo, I
                          can give it directly.
                        signature: 066a381bdc3c0ded310e27c9a46d16e7
                      - type: text
                        text: The capital of Japan is **Tokyo**.
                    stop_reason: end_turn
                    usage:
                      input_tokens: 7
                      output_tokens: 77
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 0
                tool_use:
                  summary: Tool call triggered (stop_reason=tool_use)
                  value:
                    id: 066a381bdc3c0ded310e27c9a46d16e8
                    type: message
                    role: assistant
                    model: MiniMax-M3
                    content:
                      - type: text
                        text: >-
                          Sure, let me look up the weather in San Francisco for
                          you.
                      - 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: Invalid request parameters
          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: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: authentication_error
                  message: Authentication error
        '402':
          description: Insufficient quota
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: billing_error
                  message: Insufficient quota
        '403':
          description: Permission error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: permission_error
                  message: Permission denied
        '404':
          description: Model or resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: not_found_error
                  message: Model not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: rate_limit_error
                  message: Rate limited
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Bad gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateMessageRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: Model to call
          enum:
            - MiniMax-M3
          example: MiniMax-M3
        max_tokens:
          type: integer
          description: >-
            Upper limit for generated content length (in tokens)


            **Notes**:

            - MiniMax-M3 recommended **131,072** (128K), maximum **524,288**
            (512K)

            - Tokens generated by thinking also count toward this limit

            - Content exceeding the limit will be truncated; if generation is
            interrupted due to `length`, try increasing this value
          minimum: 1
          maximum: 524288
          example: 1024
        messages:
          type: array
          description: |-
            List of conversation messages, alternating user / assistant turns

            **Notes**:
            - Must contain at least 1 message
            - The last message is typically `role=user`
          items:
            $ref: '#/components/schemas/InputMessage'
          minItems: 1
        system:
          description: |-
            System prompt, used to set the AI's role and behavior

            **Notes**:
            - Supports a string or an array of strings
            - Passed via the top-level `system` field
          oneOf:
            - type: string
              example: You are a helpful assistant.
            - type: array
              description: >-
                System prompt in content block array format. Text blocks may
                include 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: >-
            Sampling temperature


            **Notes**:

            - Range: `[0, 2]`

            - Default 1; higher values produce more divergent output, lower
            values produce more deterministic output
          minimum: 0
          maximum: 2
          default: 1
          example: 1
        top_p:
          type: number
          description: >-
            Nucleus sampling threshold


            **Notes**:

            - Range: `[0, 1]`, MiniMax-M3 default 0.95

            - It is recommended not to adjust temperature and top_p
            simultaneously
          minimum: 0
          maximum: 1
          default: 0.95
          example: 0.95
        stream:
          type: boolean
          description: |-
            Whether to return via SSE streaming

            - `true`: Server-Sent Events streaming response
            - `false`: Wait for complete response before returning (default)
          default: false
          example: false
        thinking:
          type: object
          description: >-
            Controls deep thinking. When thinking is enabled, thinking blocks
            must be passed back as-is in multi-turn conversations


            **Notes**:

            - **Defaults to `adaptive`**: The model adaptively decides whether
            to engage in deep thinking based on problem difficulty

            - When enabled, the response `content` array will include a
            `type="thinking"` reasoning block (billed as output tokens)
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - disabled
                - adaptive
              description: >-
                - `adaptive`: Model autonomously decides whether thinking is
                needed (recommended default)

                - `disabled`: Disable thinking, answer directly
              default: adaptive
        tools:
          type: array
          description: |-
            Tool definition list

            **Notes**:
            - Follows the Anthropic tool definition specification
            - `input_schema` uses a JSON Schema object
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: object
          description: Tool selection strategy. Only auto and none are supported
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - auto
                - none
              description: >-
                - `auto`: Model automatically decides whether to call a tool
                (default when tools are provided)

                - `none`: Prohibit tool calls
        metadata:
          type: object
          description: Request metadata
          properties:
            user_id:
              type: string
              description: >-
                Unique identifier representing the end user, can be used for
                per-user monitoring and abuse detection (using a hashed ID is
                recommended)
    MessageResponse:
      type: object
      description: Anthropic-style message response
      properties:
        id:
          type: string
          description: Unique message ID
        type:
          type: string
          enum:
            - message
          description: Response object type
        role:
          type: string
          enum:
            - assistant
        model:
          type: string
          description: Model actually used
          example: MiniMax-M3
        content:
          type: array
          description: |-
            Response content block list

            **Possible block types**:
            - `thinking`: Reasoning process (only when thinking is active)
            - `text`: Final answer text
            - `tool_use`: Tool call initiated by the model
          items:
            $ref: '#/components/schemas/OutputContentBlock'
        stop_reason:
          type: string
          description: |-
            Stop reason

            - `end_turn`: Natural completion
            - `max_tokens`: Reached max_tokens limit
            - `tool_use`: Model triggered a tool call
          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: >-
                Error type (e.g. invalid_request_error / authentication_error /
                billing_error, etc.)
            message:
              type: string
              description: Error description
        request_id:
          type: string
          description: Request tracking ID
    InputMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - user_system
            - group
            - sample_message_user
            - sample_message_ai
          description: >-
            Message sender role. MiniMax-M3 uses alternating user / assistant
            messages


            - `user`: User message (also used to pass back `tool_result` blocks)

            - `assistant`: Assistant historical reply (may contain `text` /
            `thinking` / `tool_use` blocks)


            Note: **`system` is not accepted here**: system prompts should be
            passed via the top-level `system` field.
        content:
          description: >-
            Message content


            **Notes**:

            - For plain text, pass a string directly

            - For structured content, pass a content block array (`text` /
            `image` / `video` / `tool_use` / `tool_result` / `thinking`)
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentBlock'
    CacheControl:
      type: object
      description: Prompt caching marker
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - ephemeral
          description: Cache marker type
    Tool:
      type: object
      required:
        - name
        - input_schema
      properties:
        name:
          type: string
          description: |-
            Tool name

            **Notes**:
            - Only `a-zA-Z0-9_-` allowed
            - Maximum 64 characters
        description:
          type: string
          description: Tool description, helps the model determine when to call it
        input_schema:
          type: object
          description: |-
            JSON Schema object for tool input parameters

            **Notes**:
            - `type` must be `object`
            - Should declare `properties` and `required`
        cache_control:
          $ref: '#/components/schemas/CacheControl'
    OutputContentBlock:
      type: object
      description: Content block in the response
      properties:
        type:
          type: string
          enum:
            - text
            - thinking
            - tool_use
        text:
          type: string
          description: Text when type=`text`
        thinking:
          type: string
          description: Reasoning process text when type=`thinking`
        signature:
          type: string
          description: >-
            Integrity signature when type=`thinking`, used for multi-turn
            context verification
        id:
          type: string
          description: Tool call ID when type=`tool_use`
        name:
          type: string
          description: Tool name when type=`tool_use`
        input:
          type: object
          description: JSON input parameters generated by the model when type=`tool_use`
    AnthropicUsage:
      type: object
      description: Token usage statistics (Anthropic specification)
      properties:
        input_tokens:
          type: integer
          description: Input token count (non-cached portion)
          example: 7
        output_tokens:
          type: integer
          description: Output token count (including thinking)
          example: 77
        cache_creation_input_tokens:
          type: integer
          description: Input tokens used for cache creation
          example: 0
        cache_read_input_tokens:
          type: integer
          description: Input tokens read from cache
          example: 0
    ContentBlock:
      type: object
      description: |-
        Message content block

        **Supported types**:
        - `text`: Text content
        - `image`: Image input (MiniMax-M3 only)
        - `video`: Video input (MiniMax-M3 only)
        - `tool_use`: Pass back previous assistant tool call
        - `tool_result`: Tool execution result
        - `thinking`: Pass back previous assistant thinking content
        - `mid_conv_system`: Mid-conversation system instruction
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - text
            - image
            - video
            - tool_use
            - tool_result
            - thinking
            - mid_conv_system
        text:
          type: string
          description: Text content when type=`text`
        source:
          $ref: '#/components/schemas/MediaSource'
          description: >-
            Image or video source, used when type=`image` or type=`video`
            (MiniMax-M3 only)
        id:
          type: string
          description: Tool call ID (required for tool_use)
        name:
          type: string
          description: Tool name (required for tool_use)
        input:
          type: object
          description: Tool input parameters (JSON object for tool_use)
        tool_use_id:
          type: string
          description: >-
            Corresponding tool call ID (required for tool_result, maps to
            tool_use.id)
        content:
          description: Tool execution result (tool_result), string or content block array
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        thinking:
          type: string
          description: >-
            Assistant thinking process content to pass back (used when
            type=`thinking`)
        signature:
          type: string
          description: >-
            Signature for the thinking content being passed back; must be
            returned as-is for multi-turn continuation
        cache_control:
          $ref: '#/components/schemas/CacheControl'
    MediaSource:
      type: object
      description: |-
        Media source for image or video content blocks

        - Images support JPEG / PNG / GIF / WEBP, maximum 10 MB per image
        - Videos support MP4 / AVI / MOV / MKV, maximum 50 MB for URL / Base64
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - base64
            - url
          description: Media source type
        media_type:
          type: string
          description: Required for base64 input, e.g. `image/png` or `video/mp4`
        data:
          type: string
          description: Base64-encoded media bytes
        url:
          type: string
          description: >-
            Public URL; videos may also use file references in the format
            `mm_file://{file_id}`
        detail:
          type: string
          enum:
            - low
            - default
            - high
          default: default
          description: >-
            Understanding precision, defaults to default. Higher resolution
            consumes more tokens
        fps:
          type: number
          minimum: 0.2
          maximum: 5
          default: 1
          description: >-
            Video frame extraction rate, default 1, range [0.2, 5]. Higher
            values are more sensitive to visual changes and consume more tokens
        max_long_side_pixel:
          type: integer
          minimum: 1
          description: >-
            Maximum pixel constraint for the longest side of images or video
            frames
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##All APIs require Bearer Token authentication##


        **Get API Key:**


        Visit [API Key Management Page](https://evolink.ai/dashboard/keys) to
        get your API Key


        **Add to request header:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        **Note**: EvoLink uses Bearer Token authentication uniformly for
        `/v1/messages`.

````