# MiniMax M3.1 Flash

Use the exact model ID `MiniMax-M3.1-Flash`. The [model page](https://seedrouter.ai/models/minimax-m3-1-flash) has the Playground and live prices. The [OpenAPI specification](https://seedrouter.ai/docs/minimax-m3-1-flash.openapi.json) defines nested request and response fields.

## Quick start

```bash
curl https://api.seedrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"MiniMax-M3.1-Flash",
    "messages":[{"role":"user","content":"What is 17 multiplied by 23?"}],
    "max_completion_tokens":2048,
    "reasoning_effort":"low"
  }'
```

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://api.seedrouter.ai/v1/chat/completions",
    headers={
        "Authorization": f"Bearer {os.environ['SEEDROUTER_API_KEY']}",
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "model": "MiniMax-M3.1-Flash",
        "messages": [{"role": "user", "content": "What is 17 multiplied by 23?"}],
        "max_completion_tokens": 2048,
        "reasoning_effort": "low",
    }).encode(),
    method="POST",
)
with urllib.request.urlopen(request, timeout=120) as response:
    result = json.load(response)
print(result["choices"][0]["message"]["content"])
```

```javascript
const response = await fetch('https://api.seedrouter.ai/v1/chat/completions', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SEEDROUTER_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'MiniMax-M3.1-Flash',
    messages: [{ role: 'user', content: 'What is 17 multiplied by 23?' }],
    max_completion_tokens: 2048,
    reasoning_effort: 'low',
  }),
  signal: AbortSignal.timeout(120000),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const result = await response.json();
console.log(result.choices[0].message.content);
```

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "os"
    "strings"
    "time"
)

func main() {
    body := strings.NewReader(`{
      "model": "MiniMax-M3.1-Flash",
      "messages": [{"role": "user", "content": "What is 17 multiplied by 23?"}],
      "max_completion_tokens": 2048,
      "reasoning_effort": "low"
    }`)
    req, err := http.NewRequest("POST", "https://api.seedrouter.ai/v1/chat/completions", body)
    if err != nil { panic(err) }
    req.Header.Set("Authorization", "Bearer " + os.Getenv("SEEDROUTER_API_KEY"))
    req.Header.Set("Content-Type", "application/json")
    client := &http.Client{Timeout: 120 * time.Second}
    res, err := client.Do(req)
    if err != nil { panic(err) }
    defer res.Body.Close()
    if res.StatusCode != http.StatusOK { panic(res.Status) }
    data, err := io.ReadAll(res.Body)
    if err != nil { panic(err) }
    fmt.Println(string(data))
}
```

This example chooses an output limit; it is not the model's default. Keep keys on your server. Playground uses your signed-in account and does not require pasting an API key.

## Formats and authentication

| Format           | Endpoint                    | Required fields     | Total top-level fields |
| ---------------- | --------------------------- | ------------------- | ---------------------- |
| Chat Completions | `POST /v1/chat/completions` | `model`, `messages` | 13                     |
| Messages         | `POST /v1/messages`         | `model`, `messages` | 12                     |
| Responses        | `POST /v1/responses`        | `model`, `input`    | 13                     |

Send `Content-Type: application/json` and `Authorization: Bearer $SEEDROUTER_API_KEY`. Messages also accepts `x-api-key`; SDK clients may include `anthropic-version: 2023-06-01`. These formats keep their native bodies and response structures.

## Parameters

All fields except the required ones above are optional. Omission differs from explicit `null`: a field accepts null only where the OpenAPI declares it. Unsupported top-level fields are discarded; invalid values of supported fields return an error.

### Chat Completions

| Field                   | Type    | Rule                                                                                       |
| ----------------------- | ------- | ------------------------------------------------------------------------------------------ |
| `model`                 | string  | Exactly `MiniMax-M3.1-Flash`                                                               |
| `messages`              | array   | Native conversation messages; preserve reasoning and tool history                          |
| `thinking`              | object  | `type` can only be `adaptive`                                                              |
| `reasoning_effort`      | string  | `low`, `medium`, `high`, `xhigh`, `max`; default `max`                                     |
| `reasoning_split`       | boolean | Only `true`                                                                                |
| `stream`                | boolean | Default `false`                                                                            |
| `stream_options`        | object  | `include_usage` controls streaming usage visibility                                        |
| `max_completion_tokens` | integer | 1–524288; includes reasoning and answer tokens                                             |
| `max_tokens`            | integer | Legacy output limit, 1–524288; prefer `max_completion_tokens`                              |
| `temperature`           | number  | Accepted but ignored; model uses 1                                                         |
| `top_p`                 | number  | Greater than 0 and at most 1; ignored, model uses 0.95                                     |
| `tools`                 | array   | Function definitions: `type`, `function.name`, `function.parameters`, optional description |
| `n`                     | integer | Only 1                                                                                     |

### Messages

| Field           | Type            | Rule                                                              |
| --------------- | --------------- | ----------------------------------------------------------------- |
| `model`         | string          | Exactly `MiniMax-M3.1-Flash`                                      |
| `messages`      | array           | Native user/assistant messages and content blocks                 |
| `system`        | string or array | System instructions or text blocks                                |
| `stream`        | boolean         | Default `false`                                                   |
| `max_tokens`    | integer         | 1–524288, including reasoning; optional in the model's API schema |
| `temperature`   | number          | Accepted but ignored; model uses 1                                |
| `top_p`         | number          | Greater than 0 and at most 1; model uses 0.95                     |
| `tools`         | array           | Native function definitions with `input_schema`                   |
| `tool_choice`   | object          | Only `{"type":"auto"}`                                            |
| `thinking`      | object          | Only `{"type":"adaptive"}`                                        |
| `output_config` | object          | `effort`: `low`, `medium`, `high`, `xhigh`, `max`; default `max`  |
| `metadata`      | object          | Optional native metadata                                          |

### Responses

| Field               | Type            | Rule                                                                       |
| ------------------- | --------------- | -------------------------------------------------------------------------- |
| `model`             | string          | Exactly `MiniMax-M3.1-Flash`                                               |
| `input`             | string or array | Text or native message, function-call, function-result and reasoning items |
| `instructions`      | string          | System instructions                                                        |
| `max_output_tokens` | integer         | 1–524288, including reasoning                                              |
| `temperature`       | number          | Accepted but ignored; model uses 1                                         |
| `top_p`             | number          | Greater than 0 and at most 1; model uses 0.95                              |
| `stream`            | boolean         | Default `false`                                                            |
| `tools`             | array           | Native function definitions                                                |
| `tool_choice`       | string          | Only `auto`                                                                |
| `metadata`          | object          | Values must be strings                                                     |
| `prompt_cache_key`  | string          | Optional cache grouping key                                                |
| `text`              | object          | Only `{"format":{"type":"text"}}`                                          |
| `reasoning`         | object          | `effort`: the five levels above; default `max`                             |

The Playground fixes `model` and exposes every remaining field: 12 Chat, 11 Messages and 12 Responses controls. Nested objects and full conversation histories use JSON fields. Invalid supported values block submission in the browser.

## Reasoning and limits

The documented context window is 1,000,000 tokens. The output limit is 524,288 tokens, including reasoning. MiniMax recommends 131,072 output tokens for demanding tasks, but does not specify that value as a default.

Thinking is always enabled. `disabled`, `none` and `minimal` are not supported thinking settings for this model. A short output budget can be exhausted before answer text appears. `service_tier`, audio input and structured JSON output are not supported features of this contract.

The total request body must not exceed 64 MB. The model service validates exact context usage and remote media contents.

## Images and video

| Input               | Supported formats    | Limit           |
| ------------------- | -------------------- | --------------- |
| Image               | JPEG, PNG, GIF, WebP | 10 MB per image |
| URL or inline video | MP4, AVI, MOV, MKV   | 50 MB per video |
| Entire request      | JSON body            | 64 MB           |

Chat uses `image_url: {"url":"..."}` and `video_url: {"url":"..."}` content blocks. Messages uses image/video blocks with a `source` object: `{"type":"url","url":"..."}` or `{"type":"base64","media_type":"...","data":"..."}`. Responses uses `input_image` or `input_video`, whose URL value can be a string or a supported options object.

`detail` accepts `low`, `default`, `high`, with `default` as the default. Video `fps` ranges from 0.2 to 5, default 1. The optional `max_long_side_pixel` is a positive integer where offered in the nested schema.

```json
{
  "model": "MiniMax-M3.1-Flash",
  "messages": [{
    "role": "user",
    "content": [
      {"type": "text", "text": "Describe the main change in this clip."},
      {"type": "video_url", "video_url": {
        "url": "https://example.com/clip.mp4",
        "fps": 1,
        "detail": "default"
      }}
    ]
  }],
  "max_completion_tokens": 2048
}
```

Replace the example URL with your own accessible file. Inline inputs use the appropriate base64 MIME type; MOV uses `video/mov`. Existing `mm_file://` video references are passed through, but this service does not provide a Files upload API. A reference still needs to be accessible to the account processing the request.

## Tools and conversation history

Function tools describe actions your application can perform. A tool call is not proof that an external action has run: inspect the name and arguments, execute the action in your application, then return its result with the matching call ID.

Chat continuation retains the complete assistant message, including `reasoning_content` and `tool_calls`; tool messages require `tool_call_id`. Messages continuation preserves thinking blocks, signatures, `tool_use` and `tool_result` blocks. Responses continuation appends all returned output items before the next user input.

Do not flatten these histories into answer text. Arbitrary function parameter schemas and echoed reasoning fields are preserved. Chat's official reference does not define a `tool_choice` parameter for this model.

## Streaming and response fields

Set `stream: true` for server-sent events. Chat emits `choices[].delta` and finishes with `[DONE]`; request `stream_options: {"include_usage":true}` to receive usage. Messages emits named events such as `message_start`, content-block updates and `message_stop`. Responses emits events such as `response.output_text.delta` and `response.completed`.

Non-streaming Chat returns `choices[].message`, `finish_reason` and `usage`. Messages returns content blocks, `stop_reason` and usage. Responses returns `output` items, status and usage. Preserve the complete response when your application needs more than the displayed answer.

## Usage and current pricing

The [live pricing table](https://seedrouter.ai/models/minimax-m3-1-flash#pricing) shows both input bands. Total input up to 512,000 tokens uses the first band; above 512,000 uses the second. The selected band prices the whole request, including output and cache.

| Format    | Full input                                                                      | Output                                 |
| --------- | ------------------------------------------------------------------------------- | -------------------------------------- |
| Chat      | `prompt_tokens` includes cached input                                           | `completion_tokens` includes reasoning |
| Messages  | Add `input_tokens`, `cache_read_input_tokens` and `cache_creation_input_tokens` | `output_tokens` includes reasoning     |
| Responses | `input_tokens` includes cached input                                            | `output_tokens` includes reasoning     |

Cache-read and cache-write tokens are not charged a second time as ordinary input. Automatic caching checks eligible repeated prefixes of at least 512 tokens; hits are not guaranteed. No explicit cache marker is needed.

Responses expose token counts, not monetary costs. Account usage records show final charges. Failed requests are not charged.

## Errors

For errors, check the invalid field and the [public error reference](https://seedrouter.ai/docs/api/errors). The same model ID supports the three text endpoints above; it is not an embeddings or Gemini endpoint.

## Official references

* [MiniMax model invocation](https://platform.minimax.io/docs/guides/text-generation)
* [Chat Completions reference](https://platform.minimax.io/docs/api-reference/text-chat-openai)
* [Messages reference](https://platform.minimax.io/docs/api-reference/text-chat-anthropic)
* [Responses reference](https://platform.minimax.io/docs/api-reference/responses-create)
* [Function-call continuation](https://platform.minimax.io/docs/guides/text-m3-function-call)
* [Automatic prompt caching](https://platform.minimax.io/docs/api-reference/text-prompt-caching)
