# MiniMax M3.1 Flash

> An open-weights, low-priced model from MiniMax with a 1M-token context window and image and video input. It has no benchmark results in the registry, so its profile rests on specifications and price.

Use it with Pydantic AI as `together:MiniMaxAI/MiniMax-M3.1-Flash`.

## Spec sheet

- **Family:** MiniMax
- **Released:** 19 Oct 2026
- **Weights:** open
- **Context window:** 1,048,576 tokens
- **Largest response:** 524,288 tokens
- **Accepts:** text, image, video
- **Tool calling:** yes
- **Knowledge cutoff:** unknown
- **Intelligence index:** not enough benchmark results yet
- **Price:** $0.15 input, $0.6 output, $0.26 blended per 1M tokens
- **Index points per $:** – (rank –)
- **Speed:** 124.5 tokens/sec (rank 24)
- **Popularity:** rank 6 of 194 by usage
- **Pydantic AI Gateway:** not built in; [bring your own key](https://ai.pydantic.dev/gateway/#bring-your-own-key)

## Benchmarks

No results yet on the benchmarks we track.

## Providers and prices

US dollars per million tokens.

| Provider | Gateway | Pydantic AI string | Input | Cached input | Output |
| --- | --- | --- | --- | --- | --- |
| MiniMax | BYOK | – | $0.15 | $0.015 | $0.6 |
| Novita | BYOK | – | $0.15 | $0.015 | $0.6 |
| Together AI | BYOK | `together:MiniMaxAI/MiniMax-M3.1-Flash` | $0.15 | $0.015 | $0.6 |

## Example code

### hello.py

Ask MiniMax M3.1 Flash a question with a Pydantic AI agent and print the answer. Run it with uv run hello.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic_ai import Agent

os.environ['TOGETHER_API_KEY'] = '...'

agent = Agent('together:MiniMaxAI/MiniMax-M3.1-Flash', instructions='Be concise, reply with one sentence.')

result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
```

### structured_output.py

Get validated, typed output from MiniMax M3.1 Flash by giving the agent a Pydantic model. Run it with uv run structured_output.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic import BaseModel
from pydantic_ai import Agent

os.environ['TOGETHER_API_KEY'] = '...'


class CityLocation(BaseModel):
    city: str
    country: str


agent = Agent('together:MiniMaxAI/MiniMax-M3.1-Flash', output_type=CityLocation)

result = agent.run_sync('Where were the olympics held in 2012?')
print(result.output)
#> city='London' country='United Kingdom'
```

### tools.py

Give MiniMax M3.1 Flash two tools to call, one of which reads the agent's dependencies. Run it with uv run tools.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os
import random

from pydantic_ai import Agent, RunContext

os.environ['TOGETHER_API_KEY'] = '...'

agent = Agent(
    'together:MiniMaxAI/MiniMax-M3.1-Flash',
    deps_type=str,
    instructions="You're a dice game, roll the die and see if it matches the user's guess.",
)


@agent.tool_plain
def roll_dice() -> str:
    """Roll a six-sided die and return the result."""
    return str(random.randint(1, 6))


@agent.tool
def get_player_name(ctx: RunContext[str]) -> str:
    """Get the player's name."""
    return ctx.deps


result = agent.run_sync('My guess is 4', deps='Anne')
print(result.output)
```

### streaming.py

Stream MiniMax M3.1 Flash's reply to the terminal as it is generated. Run it with uv run streaming.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import asyncio
import os

from pydantic_ai import Agent

os.environ['TOGETHER_API_KEY'] = '...'

agent = Agent('together:MiniMaxAI/MiniMax-M3.1-Flash')


async def main():
    async with agent.run_stream('Explain prompt caching in three bullet points.') as response:
        async for text in response.stream_text(delta=True):
            print(text, end='', flush=True)


asyncio.run(main())
```

### pax.sh

Chat with MiniMax M3.1 Flash in your terminal using pax, the TUI for pydantic-ai-harness. Coming soon.

```sh
export TOGETHER_API_KEY='...'

uvx pax --model 'together:MiniMaxAI/MiniMax-M3.1-Flash'
```

### pi.sh

Use MiniMax M3.1 Flash as the model behind the pi coding agent, with your own MiniMax key.

```sh
# npm install -g @earendil-works/pi-coding-agent
export TOGETHER_API_KEY='...'

pi --model 'together/MiniMaxAI/MiniMax-M3.1-Flash'
```

### codex.sh

Run OpenAI's Codex CLI on MiniMax M3.1 Flash, which MiniMax serves over an OpenAI-compatible API.

```sh
# npm install -g @openai/codex
export TOGETHER_API_KEY='...'

codex --model 'MiniMaxAI/MiniMax-M3.1-Flash' \
  -c model_provider='together' \
  -c model_providers.together.name='MiniMax' \
  -c model_providers.together.base_url='https://api.together.example/v1' \
  -c model_providers.together.env_key='TOGETHER_API_KEY'
```

### ai_sdk.ts

Call MiniMax M3.1 Flash from TypeScript with the Vercel AI SDK.

```ts
// npm install ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
import { generateText } from 'ai'

process.env.TOGETHER_API_KEY = '...'

const together = createOpenAICompatible({
  name: 'together',
  baseURL: 'https://api.together.example/v1',
  apiKey: process.env.TOGETHER_API_KEY,
})

const { text } = await generateText({
  model: together('MiniMaxAI/MiniMax-M3.1-Flash'),
  system: 'Be concise, reply with one sentence.',
  prompt: 'Where does "hello world" come from?',
})
console.log(text)
```

## About MiniMax M3.1 Flash

MiniMax M3.1 Flash is an open-weights model released in October 2026. It is priced at the low end of the registry, at $0.15 per million input tokens and $0.60 per million output tokens, giving a blended price of about $0.26 per million tokens against a registry median of about $1.01. It ranks 38th of 194 on price, where 1 is the cheapest.

The model has a context window of 1M tokens and can return responses of up to 524k tokens. It accepts text, image and video input and supports tool calling, reasoning mode and structured output. It is served by MiniMax, Novita and Together AI. Its popularity rank of 6th of 194 is high relative to the rest of the registry.

The registry holds no benchmark results for this model, and no intelligence index score, so its quality relative to other models cannot be judged from the data given. Its knowledge cutoff is not recorded.

**Strengths**

- Input costs $0.15 per million tokens, well below the registry median blended price
- Context window of 1M tokens with responses up to 524k tokens
- Accepts text, image and video input, with tool calling and structured output
- Ranks 6th of 194 for popularity among models in the registry

**Weaknesses**

- No benchmark results, so output quality cannot be compared with other models
- Available from three providers, with no built-in Pydantic AI Gateway support
- No intelligence index or value rank is available

**Best for:** Cost-sensitive agents that process long documents or mixed text, image and video input, where benchmark evidence is not required.

Prices come from [genai-prices](https://github.com/pydantic/genai-prices), in US dollars per million tokens. Benchmark scores come from Epoch AI and LMArena (CC BY 4.0); the index and its sources are described at https://models.pydantic.dev/methodology.md. Data built 2026-11-25. Compare with other models: https://models.pydantic.dev/models.md
