This document explains how to call the model inference service provided by MiniMax through Alibaba Cloud Model Studio.
Service activation
- Go to the Model Studio console, search for MiniMax, find the MiniMax model card, and click Activate Now.
- In the pop-up dialog box, confirm the activation and authorization.
Quick start
Before you begin, ensure you have obtained an API key and configured it as an environment variable. If you call the API using an SDK, you must also install the SDK.
- OpenAI compatible
- Python
- Node.js
- HTTP
Sample code
Response
Differences between MiniMax-M3.1-Flash and MiniMax-M3
| Capability | MiniMax/MiniMax-M3.1-Flash | MiniMax/MiniMax-M3 |
|---|---|---|
| Thinking mode | Always enabled and cannot be disabled | Adaptive thinking by default; can be disabled |
| Thinking effort | Supports low, medium, high, xhigh, and max; defaults to max | Does not support reasoning_effort |
| Thinking output | Always returned separately in reasoning_content; does not support setting reasoning_split to false | Returned separately in reasoning_content when reasoning_split is true, or inside content with <think> tags when it is false |
| Context window | 1M tokens | 1M tokens |
| Image and video input | Supported | Supported |
| Prompt caching | Supported | Supported |
| Default rate limits | 200 RPM and 10,000,000 TPM | 500 RPM and 20,000,000 TPM |
reasoning_effort:
Migrate from MiniMax-M3
If you only change the model ID to MiniMax/MiniMax-M3.1-Flash, also account for the following differences:
- Remove
thinking: {"type":"disabled"}orreasoning_effort: "none". MiniMax-M3.1-Flash cannot disable thinking and returns an HTTP 400 error for these settings. - Do not set
reasoning_splittofalse. When sharing calling code between MiniMax-M3 and MiniMax-M3.1-Flash, set it totrueand consistently read thinking content fromreasoning_content. With the OpenAI Python SDK, passextra_body={"reasoning_split": True}. For HTTP requests, place it at the top level of the request body. Thethinkingparameter uses the same placement. - Read thinking content from
reasoning_content, notreasoning_details. To remain compatible with MiniMax-M3, first check whetherreasoning_contentexists. MiniMax-M3.1-Flash does not require parsing<think>tags fromcontent. - Reserve enough output length. Thinking tokens count toward
max_tokensormax_completion_tokens. If the limit is too small,finish_reasoncan belengthwhile the answer is empty. - In multi-turn function calling, append the complete assistant message, including
reasoning_contentandtool_calls, to the conversation history to preserve thinking continuity.
Multimodal examples
MiniMax/MiniMax-M3.1-Flash and MiniMax/MiniMax-M3 support text, image, and video input and produce text output.
Image understanding
MiniMax/MiniMax-M3.1-Flash and MiniMax/MiniMax-M3 can recognize and analyze one or more images. The following example uses MiniMax/MiniMax-M3. To use MiniMax/MiniMax-M3.1-Flash, change the model ID and optionally set reasoning_effort.
- OpenAI compatible
thinking is not a standard OpenAI parameter. In the OpenAI Python SDK, pass it through extra_body. In the Node.js SDK, pass it as a top-level parameter.- Python
- Node.js
- HTTP
Video understanding
- OpenAI compatible
- Python
- Node.js
- HTTP
File limits
- Image files
- Video files
- Input methods: Public URLs and Base64 encoding are supported.
- Supported image formats: PNG, JPEG, WEBP, GIF
- Image size: Each image must not exceed 10 MB.
Other features
MiniMax/MiniMax-M3.1-Flash supports multi-turn conversations, deep thinking, function calling, and context caching.
| Model | Multi-round conversation | Deep thinking | Function calling | Structured output | Web search | Prefix-based completion | Context caching |
|---|---|---|---|---|---|---|---|
| MiniMax/MiniMax-M3.1-Flash | Supported | Supported | Supported | Not supported | Not supported | Not supported | Supported |
| MiniMax/MiniMax-M3 | Supported | Supported | Supported | Not supported | Not supported | Not supported | Supported |
| MiniMax/MiniMax-M2.7 | Supported | Supported | Supported | Not supported | Not supported | Not supported | Supported |
| MiniMax/MiniMax-M2.5 | Supported | Supported | Supported | Not supported | Not supported | Not supported | Supported |
- The cached input token price is 10% of the regular input price for MiniMax/MiniMax-M3.1-Flash and MiniMax/MiniMax-M2.5, and 20% for MiniMax/MiniMax-M3 and MiniMax/MiniMax-M2.7. For MiniMax/MiniMax-M3, MiniMax/MiniMax-M2.7, and MiniMax/MiniMax-M2.5, the minimum cacheable input is 512 tokens, compared with 1,024 tokens for Model Studio models.
- For MiniMax/MiniMax-M3.1-Flash and MiniMax/MiniMax-M3,
nsupports only1, so each request can generate only one completion. - MiniMax/MiniMax-M3.1-Flash does not support
stop. Passing this parameter does not truncate the output at the specified stop sequence. The request may still succeed and returnfinish_reason: "stop", but this does not mean that the specified stop sequence took effect. - MiniMax/MiniMax-M3.1-Flash does not support using
parallel_tool_callsto control whether tool calls are parallel. Setting it tofalsedoes not guarantee sequential tool calls, and the model may still return multipletool_callsin one turn. - For MiniMax/MiniMax-M3.1-Flash,
tool_choicesupports onlyauto. Other values may return an error or have no effect. For example, specifying a named function does not guarantee that the model calls that function. For MiniMax/MiniMax-M3,tool_choicesupports onlynoneandauto.
Default parameter values
The following parameters cannot be modified.
| Model | temperature | top_p |
|---|---|---|
| MiniMax/MiniMax-M3.1-Flash | 1.0 | 0.95 |
| MiniMax/MiniMax-M3 | 1.0 | 0.95 |
| MiniMax/MiniMax-M2.7 | 1.0 | 0.9 |
| MiniMax/MiniMax-M2.5 | 1.0 | 0.9 |