Quick Start
1. Install AI SDK and MiniMax Provider
2. Configure Environment Variables
3. Call API
TypeScript
4. Important Note
In multi-turn function call conversations, the complete model response (i.e., the assistant message) must be appended to the conversation history to maintain the continuity of the reasoning chain.- Append the full
result.response.messagesto the message history (includes all assistant and tool messages)
Supported Models
When using the AI SDK, theMiniMax-M2.7 MiniMax-M2.7-highspeed MiniMax-M2.5 MiniMax-M2.5-highspeed MiniMax-M2.1 MiniMax-M2.1-highspeed MiniMax-M2 model is supported:
| Model Name | Context Window | Description |
|---|---|---|
| MiniMax-M2.7 | 204,800 | Beginning the journey of recursive self-improvement (output speed approximately 60 tps) |
| MiniMax-M2.7-highspeed | 204,800 | M2.7 Highspeed: Same performance, faster and more agile (output speed approximately 100 tps) |
| MiniMax-M2.5 | 204,800 | Peak Performance. Ultimate Value. Master the Complex (output speed approximately 60 tps) |
| MiniMax-M2.5-highspeed | 204,800 | M2.5 highspeed: Same performance, faster and more agile (output speed approximately 100 tps) |
| MiniMax-M2.1 | 204,800 | Powerful Multi-Language Programming Capabilities with Comprehensively Enhanced Programming Experience (output speed approximately 60 tps) |
| MiniMax-M2.1-highspeed | 204,800 | Faster and More Agile (output speed approximately 100 tps) |
| MiniMax-M2 | 204,800 | Agentic capabilities, Advanced reasoning |
For details on how tps (Tokens Per Second) is calculated, please refer to FAQ > About APIs.
The AI SDK compatibility interface currently only supports the
MiniMax-M2.7 MiniMax-M2.7-highspeed MiniMax-M2.5 MiniMax-M2.5-highspeed MiniMax-M2.1 MiniMax-M2.1-highspeed MiniMax-M2 model. For other models, please use the standard MiniMax API
interface.Compatibility
Supported Parameters
When using the AI SDK, we support the following input parameters:| Parameter | Support Status | Description |
|---|---|---|
model | Fully supported | supports MiniMax-M2.7 MiniMax-M2.7-highspeed MiniMax-M2.5 MiniMax-M2.5-highspeed MiniMax-M2.1 MiniMax-M2.1-highspeed MiniMax-M2 model |
messages | Partial support | Supports text and tool calls, no image/document input |
maxTokens | Fully supported | Maximum number of tokens to generate |
system | Fully supported | System prompt |
temperature | Fully supported | Range (0.0, 1.0], controls output randomness, recommended value: 1 |
toolChoice | Fully supported | Tool selection strategy |
tools | Fully supported | Tool definitions |
topP | Fully supported | Nucleus sampling parameter |
Messages Field Support
| Field Type | Support Status | Description |
|---|---|---|
role="user" | Fully supported | User text messages |
role="assistant" | Fully supported | Assistant responses |
role="tool" | Fully supported | Tool call results |
type="text" | Fully supported | Text content |
type="tool-call" | Fully supported | Tool calls |
type="tool-result" | Fully supported | Tool call results |
type="image" | Not supported | Image input not supported yet |
type="file" | Not supported | File input not supported yet |
Examples
Streaming Response
TypeScript





