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

> OpenAI Chat Completions. Required fields: `model`, `messages`. All models reason by default on this endpoint. Reasoning tokens count towards the output limit and are billed at the output rate. See the [API reference](/en/api-manual/language-series/minimax/chat-completions/chat-completions-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]
>
> All models reason by default on this endpoint. Reasoning tokens count towards the output limit and are billed at the output rate. `MiniMax-M3` starts `content` with `<think>...</think>` by default. Set `reasoning_split: true` to receive reasoning in `reasoning_content` separately. See the [API reference](https://evolink.ai/docs/en/api-manual/language-series/minimax/chat-completions/chat-completions-reference.md) for tool calls, image and video input, streaming and multi-turn conversations.


## OpenAPI

````yaml en/api-manual/language-series/minimax/chat-completions/chat-completions-quickstart.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: MiniMax Chat Completions quickstart
  description: >-
    MiniMax Chat Completions quickstart (OpenAI-compatible). Required fields:
    `model`, `messages`. See the [API
    reference](/en/api-manual/language-series/minimax/chat-completions/chat-completions-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: Chat Completion
    description: AI chat completion related endpoints
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat Completion
      summary: MiniMax Chat Completions quickstart
      description: >-
        OpenAI Chat Completions. Required fields: `model`, `messages`. All
        models reason by default on this endpoint. Reasoning tokens count
        towards the output limit and are billed at the output rate. See the [API
        reference](/en/api-manual/language-series/minimax/chat-completions/chat-completions-reference)
        for tool calls, image and video input, streaming and multi-turn
        conversations.
      operationId: createChatCompletionMiniMaxQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionQuickRequest'
            examples:
              simple:
                summary: Minimal call
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content: Please introduce yourself in one sentence.
              flash:
                summary: Call MiniMax-M3.1-Flash
                value:
                  model: MiniMax-M3.1-Flash
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m3:
                summary: Call MiniMax-M3
                value:
                  model: MiniMax-M3
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              m25:
                summary: Call MiniMax-M2.5
                value:
                  model: MiniMax-M2.5
                  messages:
                    - role: user
                      content: Explain HTTP in one sentence.
              multi_turn:
                summary: Multi-turn conversation
                value:
                  model: MiniMax-M4
                  messages:
                    - role: user
                      content: Recommend a programming language for beginners.
                    - role: assistant
                      content: >-
                        Python is a good choice: simple syntax and a large
                        ecosystem.
                    - role: user
                      content: How long does it take to learn?
      responses:
        '200':
          description: Conversation generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
              examples:
                with_thinking:
                  summary: Response with reasoning
                  value:
                    id: example_c425f5
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: '0.05'
                          role: assistant
                          name: MiniMax AI
                          reasoning_content: >-
                            Let the ball cost x. Then 2x + 1 = 1.10, so x =
                            0.05.
                    created: 1792401901
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 281
                      total_characters: 0
                      prompt_tokens: 229
                      completion_tokens: 52
                      completion_tokens_details:
                        reasoning_tokens: 49
                      prompt_tokens_details:
                        cached_tokens: 187
                direct_answer:
                  summary: Direct answer without reasoning content
                  value:
                    id: example_c7cb0e
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: >-
                            Recursion is a technique in which a function calls
                            itself to solve smaller instances of a problem.
                          role: assistant
                          name: MiniMax AI
                    created: 1792401868
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 219
                      total_characters: 0
                      prompt_tokens: 208
                      completion_tokens: 11
                      prompt_tokens_details:
                        cached_tokens: 58
                tool_calls:
                  summary: Tool call triggered (finish_reason=tool_calls)
                  value:
                    id: example_2d249e
                    choices:
                      - finish_reason: tool_calls
                        index: 0
                        message:
                          content: I'll check the stock for product demo-item-001.
                          role: assistant
                          name: MiniMax AI
                          tool_calls:
                            - id: call_example_1
                              type: function
                              function:
                                name: get_product_stock
                                arguments: '{"product_id": "demo-item-001"}'
                              index: 0
                    created: 1792401870
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 483
                      total_characters: 0
                      prompt_tokens: 446
                      completion_tokens: 37
                      prompt_tokens_details:
                        cached_tokens: 227
                length:
                  summary: Output limit reached (finish_reason=length)
                  value:
                    id: example_a5ad57
                    choices:
                      - finish_reason: length
                        index: 0
                        message:
                          content: ''
                          role: assistant
                          name: MiniMax AI
                          reasoning_content: I need to explain the process step by step.
                    created: 1792401615
                    model: MiniMax-M3.1-Flash
                    object: chat.completion
                    usage:
                      total_tokens: 219
                      total_characters: 0
                      prompt_tokens: 211
                      completion_tokens: 8
                      completion_tokens_details:
                        reasoning_tokens: 8
                      prompt_tokens_details:
                        cached_tokens: 184
                m3_inline_thinking:
                  summary: >-
                    Default `MiniMax-M3` response with reasoning at the start of
                    `content`
                  value:
                    id: example_818ad0
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: >-
                            <think>Let the ball cost x. Then 2x + 1 = 1.10, so x
                            = 0.05.</think>


                            0.05
                          role: assistant
                    created: 1796307610
                    model: MiniMax-M3
                    object: chat.completion
                    usage:
                      total_tokens: 308
                      total_characters: 0
                      prompt_tokens: 224
                      completion_tokens: 84
                      completion_tokens_details:
                        reasoning_tokens: 78
                      prompt_tokens_details:
                        cached_tokens: 193
                m25_answer:
                  summary: Response from `MiniMax-M2.5`
                  value:
                    id: chatcmpl-example
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          content: >-
                            Recursion is a technique in which a function calls
                            itself to solve smaller instances of a problem.
                          reasoning_content: >-
                            The user wants a one-sentence definition of
                            recursion.
                          role: assistant
                    created: 1796307389
                    model: MiniMax-M2.5
                    object: chat.completion
                    usage:
                      prompt_tokens: 44
                      completion_tokens: 90
                      total_tokens: 134
                      completion_tokens_details:
                        reasoning_tokens: 84
                      prompt_tokens_details:
                        cached_tokens: 0
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: Invalid request parameters
                  type: invalid_request_error
                  param: ''
                  code: null
        '401':
          description: Unauthenticated, invalid or expired token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: Insufficient quota, recharge required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota_error
        '403':
          description: Access denied for this model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
        '413':
          description: Request body too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Request body too large
                  type: request_too_large_error
                  param: messages
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: internal_server_error
        '502':
          description: Bad gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Bad gateway
                  type: bad_gateway_error
        '503':
          description: Service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
components:
  schemas:
    ChatCompletionQuickRequest:
      type: object
      required:
        - model
        - 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
        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:
                  - system
                  - user
                  - assistant
                description: Message role
              content:
                type: string
                description: Message text
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the chat completion
          example: chatcmpl-example
        model:
          type: string
          description: Model name actually used
          example: MiniMax-M4
        object:
          type: string
          enum:
            - chat.completion
          description: Response type
          example: chat.completion
        created:
          type: integer
          description: Creation timestamp (Unix seconds)
          example: 1777026807
        choices:
          type: array
          description: List of chat completion choices
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type:
                - integer
                - string
                - 'null'
              description: HTTP status error code
            message:
              type: string
              description: Error description
            type:
              type: string
              description: Error type
            param:
              type: string
              description: Name of the related parameter
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: Choice index
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: |-
            Finish reason

            - `stop`: Natural completion or stop sequence triggered
            - `length`: Reached maximum token limit
            - `content_filter`: Content filtered by safety policy
            - `tool_calls`: Model invoked a tool
          enum:
            - stop
            - length
            - content_filter
            - tool_calls
          example: stop
    Usage:
      type: object
      description: Token usage statistics
      properties:
        total_tokens:
          type: integer
          description: Total number of tokens consumed
          example: 1604
        total_characters:
          type: integer
          description: Total number of characters consumed
          example: 0
        prompt_tokens:
          type: integer
          description: Total input tokens, including cached tokens.
          example: 1365
        completion_tokens:
          type: integer
          description: Number of output tokens (including the thinking portion)
          example: 239
        completion_tokens_details:
          type: object
          description: Detailed breakdown of output tokens
          properties:
            reasoning_tokens:
              type: integer
              description: Number of reasoning tokens.
              example: 49
        prompt_tokens_details:
          type: object
          description: Detailed breakdown of input tokens
          properties:
            cached_tokens:
              type: integer
              description: >-
                Number of cached input tokens.


                Cached tokens are billed at the cache-hit rate. Uncached tokens
                (`prompt_tokens - cached_tokens`) are billed at the standard
                input rate.
              example: 114
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: Role of the message sender
          enum:
            - assistant
          example: assistant
        content:
          type:
            - string
            - 'null'
          description: >-
            Final answer text. May be `null` for a tool call. `MiniMax-M3`
            starts `content` with `<think>...</think>` by default. Set
            `reasoning_split: true` to receive reasoning in `reasoning_content`
            separately.
          example: '0.05'
        reasoning_content:
          type: string
          description: >-
            `MiniMax-M3` starts `content` with `<think>...</think>` by default.
            Set `reasoning_split: true` to receive reasoning in
            `reasoning_content` separately. Simple questions may produce no
            reasoning, in which case this field is omitted.
          example: Let the ball cost x. Then 2x + 1 = 1.10, so x = 0.05.
        name:
          type: string
          description: Sender name
        tool_calls:
          type: array
          description: Tool call list (returned when the model decides to invoke a tool)
          items:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier for the tool call
              type:
                type: string
                enum:
                  - function
              function:
                type: object
                properties:
                  name:
                    type: string
                    description: Name of the called function
                  arguments:
                    type: string
                    description: Function arguments (JSON string)
              index:
                type: integer
                description: Tool call index
  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

        ```

````

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