> ## 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 quickstart

> Anthropic Messages. Required fields: `model`, `max_tokens`, `messages`. `max_tokens` covers both reasoning and the answer. `MiniMax-M4` and `MiniMax-M3.1-Flash` always reason and return reasoning as `thinking` blocks in `content`. `MiniMax-M3` skips reasoning by default. Set `thinking` to `{"type": "adaptive"}` to enable it and receive a `thinking` block. `MiniMax-M2.5` reasons without returning a `thinking` block. Its reasoning tokens count towards `output_tokens`. See the [API reference](/en/api-manual/language-series/minimax/messages/messages-reference) for tool calls, image and video input, streaming and multi-turn conversations.

> [!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]
>
> `max_tokens` covers both reasoning and the answer. `MiniMax-M4` and `MiniMax-M3.1-Flash` always reason and return reasoning as `thinking` blocks in `content`. `MiniMax-M3` skips reasoning by default. Set `thinking` to `{"type": "adaptive"}` to enable it and receive a `thinking` block. `MiniMax-M2.5` reasons without returning a `thinking` block. Its reasoning tokens count towards `output_tokens`. Start with an output budget of at least 1,024 tokens. If reasoning uses the entire budget, the response may contain no answer text.


## OpenAPI

````yaml en/api-manual/language-series/minimax/messages/messages-quickstart.json POST /v1/messages
openapi: 3.1.0
info:
  title: MiniMax Messages quickstart
  description: >-
    MiniMax Messages quickstart (Anthropic-compatible). Required fields:
    `model`, `max_tokens`, `messages`. See the [API
    reference](/en/api-manual/language-series/minimax/messages/messages-reference)
    for tool calls, image and video input, streaming and multi-turn
    conversations.
  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 Messages quickstart (Anthropic-compatible)
      description: >-
        Anthropic Messages. Required fields: `model`, `max_tokens`, `messages`.
        `max_tokens` covers both reasoning and the answer. `MiniMax-M4` and
        `MiniMax-M3.1-Flash` always reason and return reasoning as `thinking`
        blocks in `content`. `MiniMax-M3` skips reasoning by default. Set
        `thinking` to `{"type": "adaptive"}` to enable it and receive a
        `thinking` block. `MiniMax-M2.5` reasons without returning a `thinking`
        block. Its reasoning tokens count towards `output_tokens`. See the [API
        reference](/en/api-manual/language-series/minimax/messages/messages-reference)
        for tool calls, image and video input, streaming and multi-turn
        conversations.
      operationId: createMessageMiniMaxQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageQuickRequest'
            examples:
              simple:
                summary: Minimal call
                value:
                  model: MiniMax-M4
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Please introduce yourself in one sentence.
              flash:
                summary: Call MiniMax-M3.1-Flash
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m3:
                summary: Call MiniMax-M3
                value:
                  model: MiniMax-M3
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m25:
                summary: Call MiniMax-M2.5
                value:
                  model: MiniMax-M2.5
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
      responses:
        '200':
          description: Message object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
              examples:
                with_thinking:
                  summary: Response with reasoning (thinking block)
                  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: Response from `MiniMax-M2.5` (without a `thinking` block)
                  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: 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:
    CreateMessageQuickRequest:
      type: object
      required:
        - model
        - max_tokens
        - messages
      properties:
        model:
          type: string
          description: >-
            | Model | Context (tokens) | Maximum output (tokens) |

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

            | `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` and `MiniMax-M3` accept images
            and video. `MiniMax-M2.5` accepts text only.
          enum:
            - MiniMax-M4
            - MiniMax-M3.1-Flash
            - MiniMax-M3
            - MiniMax-M2.5
          example: MiniMax-M4
        max_tokens:
          type: integer
          minimum: 1
          example: 4096
          description: >-
            Required by the Anthropic protocol. **Maximum output (including
            reasoning tokens)** — `MiniMax-M4` 262,144, `MiniMax-M3.1-Flash`
            524,288, `MiniMax-M3` 524,288, `MiniMax-M2.5` 32,768. Start with an
            output budget of at least 1,024 tokens. If reasoning uses the entire
            budget, the response may contain no answer text.
        messages:
          type: array
          description: >-
            The list of conversation messages, in chronological order. At least
            one message is required.
          minItems: 1
          items:
            type: object
            required:
              - role
              - content
            properties:
              role:
                type: string
                enum:
                  - user
                  - assistant
                description: Message role
              content:
                type: string
                description: Message text
    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-M4
        content:
          type: array
          description: >-
            Response blocks: `thinking` for reasoning (may be absent for simple
            questions and is omitted for `MiniMax-M2.5`), `text` for the answer,
            `tool_use` for a tool call.
          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
    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. The example uses a placeholder for
            `signature`. When sending the next request, use the complete value
            from your previous response.
        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: Uncached input tokens, excluding `cache_read_input_tokens`.
          example: 55
        output_tokens:
          type: integer
          description: Output token count (including thinking)
          example: 66
        cache_creation_input_tokens:
          type: integer
          description: >-
            Number of input tokens used to create the cache. This is 0 with
            automatic caching.
          example: 0
        cache_read_input_tokens:
          type: integer
          description: >-
            Cached input tokens, billed at the cache-hit rate. Total input
            tokens = `input_tokens + cache_read_input_tokens`.
          example: 174
        output_tokens_details:
          type: object
          description: Detailed breakdown of output tokens
          properties:
            thinking_tokens:
              type: integer
              description: Reasoning tokens, already included in `output_tokens`.
              example: 63
  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`.

````

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