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-M3MiniMax-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: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.
Multimodal Input
OpenAI-compatible Chat Completions support text, image, and video input forMiniMax-M3.
Use image_url content parts for images and video_url content parts for videos. The detail field accepts low, default, or high and defaults to default; max_long_side_pixel can be used to control the longest side. Images support JPEG, PNG, GIF, and WEBP. Videos support MP4, AVI, MOV, and MKV; fps defaults to 1 and accepts values from 0.2 to 5. URL or base64 videos can be up to 50 MB, images can be up to 10 MB, and the request body can be up to 64 MB. For larger videos, upload through the Files API and pass mm_file://{file_id}; Files API videos can be up to 512 MB.
Image token usage depends on image size and content. Use this as a rough single-image heuristic; check response usage or token counting where available for exact usage:
Python
MiniMax-M3 Request Parameters
MiniMax-M3 supports these additional Chat Completions parameters through the OpenAI-compatible API:
Thinking Control
ForMiniMax-M3, the thinking parameter controls whether the model can emit thinking content.
- If
thinkingis omitted, thinking is on by default and the response includes thinking content. - Set
thinking: {"type": "adaptive"}to explicitly keep thinking on. For MiniMax-M3,adaptiveis equivalent to thinking on. - Set
thinking: {"type": "disabled"}to skip thinking and answer directly. - For M2.x models, thinking cannot be disabled;
thinking: {"type": "disabled"}is accepted but thinking remains on.
reasoning_split does not enable or disable thinking. It only controls how thinking content is returned: when true, thinking is exposed through reasoning_content and reasoning_details; when false, native Chat Completions responses keep thinking inside the content field with <think>...</think> tags.
Python
Examples
Streaming Response
Python
Tool Use & Interleaved Thinking
Learn how to use M3 Tool Use and Interleaved Thinking capabilities with OpenAI SDK, please refer to the following documentation.Tool Use & Interleaved Thinking
Learn how to leverage MiniMax-M3 tool calling and interleaved thinking capabilities to enhance performance in complex tasks.