Quick Start
1. Install OpenAI SDK
2. Configure Environment Variables
3. Call API
Python
4. Important Note
In multi-turn function call conversations, the complete model response (i.e., the assistant message) must be append to the conversation history to maintain the continuity of the reasoning chain.- Append the full
response_messageobject (including thetool_callsfield) to the message history- For native OpenAI API with
MiniMax-M2.7MiniMax-M2.7-highspeedMiniMax-M2.5MiniMax-M2.5-highspeedMiniMax-M2.1MiniMax-M2.1-highspeedMiniMax-M2models, thecontentfield will contain<think>tag content, which must be preserved completely - In the Interleaved Thinking compatible format, by enabling the additional parameter (
reasoning_split=True), the model’s thinking content is provided separately via thereasoning_detailsfield, which must also be preserved completely
- For native OpenAI API with
Supported Models
When using the OpenAI SDK, the following MiniMax models are 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.
For more model information, please refer to the standard MiniMax API
documentation.
Examples
Streaming Response
Python
Tool Use & Interleaved Thinking
Learn how to use M2.1 Tool Use and Interleaved Thinking capabilities with OpenAI SDK, please refer to the following documentation.M2.1 Tool Use & Interleaved Thinking
Learn how to leverage MiniMax-M2.1 tool calling and interleaved thinking capabilities to enhance performance in complex tasks.





