Quick start
Supported regions: China North 2 (Beijing) only. Use an API key created in that region and the https://cn-beijing.maas.qwencloudapi.com endpoint. See Regions and endpoints.
MiniMax-M2.5 is MiniMax's flagship open-source model. It is trained on large-scale reinforcement learning over complex real-world scenarios and reaches or exceeds the industry state of the art on productivity tasks such as coding, tool calling, search, and office work. It always reasons, and the chain of thought is returned in reasoning_content.
MiniMax-M2.5 supports text input and text output only. It supports function calling and implicit context caching. Structured output, web search, prefix completion, batch inference, and fine-tuning are not supported.
Before you begin, get an API key and set it as an environment variable. If you call the model through an SDK, install the OpenAI or DashScope SDK.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("DASHSCOPE_API_KEY"),
# China North 2 (Beijing). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
base_url="https://cn-beijing.maas.qwencloudapi.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
model="MiniMax-M2.5",
messages=[{"role": "user", "content": "Who are you?"}],
stream=True,
)
reasoning_content = ""
answer_content = ""
is_answering = False
print("\n" + "=" * 20 + "Thinking Process" + "=" * 20 + "\n")
for chunk in completion:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
if hasattr(delta, "reasoning_content") and delta.reasoning_content is not None:
if not is_answering:
print(delta.reasoning_content, end="", flush=True)
reasoning_content += delta.reasoning_content
if hasattr(delta, "content") and delta.content:
if not is_answering:
print("\n" + "=" * 20 + "Full Response" + "=" * 20 + "\n")
is_answering = True
print(delta.content, end="", flush=True)
answer_content += delta.content
import OpenAI from "openai";
import process from "process";
const openai = new OpenAI({
apiKey: process.env.DASHSCOPE_API_KEY,
// China North 2 (Beijing). This model is available only in this region.
// API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
baseURL: "https://cn-beijing.maas.qwencloudapi.com/compatible-mode/v1",
});
let reasoningContent = "";
let answerContent = "";
let isAnswering = false;
async function main() {
const stream = await openai.chat.completions.create({
model: "MiniMax-M2.5",
messages: [{ role: "user", content: "Who are you?" }],
stream: true,
});
console.log("\n" + "=".repeat(20) + "Thinking Process" + "=".repeat(20) + "\n");
for await (const chunk of stream) {
if (!chunk.choices?.length) continue;
const delta = chunk.choices[0].delta;
if (delta.reasoning_content !== undefined && delta.reasoning_content !== null) {
if (!isAnswering) {
process.stdout.write(delta.reasoning_content);
}
reasoningContent += delta.reasoning_content;
}
if (delta.content !== undefined && delta.content) {
if (!isAnswering) {
console.log("\n" + "=".repeat(20) + "Full Response" + "=".repeat(20) + "\n");
isAnswering = true;
}
process.stdout.write(delta.content);
answerContent += delta.content;
}
}
}
main();
# China North 2 (Beijing). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --location 'https://cn-beijing.maas.qwencloudapi.com/compatible-mode/v1/chat/completions' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMax-M2.5",
"messages": [
{"role": "user", "content": "Who are you?"}
],
"stream": true
}'
import os
import dashscope
# China North 2 (Beijing) is the only region that provides this model.
client = dashscope.Client(
api_key=os.getenv("DASHSCOPE_API_KEY"),
base_url="https://cn-beijing.maas.qwencloudapi.com/api/v1",
)
completion = client.chat.completions.create(
model="MiniMax-M2.5",
messages=[{"role": "user", "content": "Who are you?"}],
stream=True,
)
reasoning_content = ""
answer_content = ""
is_answering = False
print("\n" + "=" * 20 + "Thinking Process" + "=" * 20 + "\n")
for chunk in completion:
message = chunk.choices[0].delta
if message.reasoning_content:
if not is_answering:
print(message.reasoning_content, end="", flush=True)
reasoning_content += message.reasoning_content
if message.content:
if not is_answering:
print("\n" + "=" * 20 + "Full Response" + "=" * 20 + "\n")
is_answering = True
print(message.content, end="", flush=True)
answer_content += message.content
The base_url points the SDK at China North 2 (Beijing), which is the only region that provides this model. See Regions and endpoints.
Function calling
MiniMax-M2.5 supports function calling through the OpenAI-compatible API. Define tools in the tools parameter and read the model's tool_calls from the response.
import json
import os
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("DASHSCOPE_API_KEY"),
# China North 2 (Beijing). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
base_url="https://cn-beijing.maas.qwencloudapi.com/compatible-mode/v1",
)
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
},
"required": ["city"],
},
},
}
]
completion = client.chat.completions.create(
model="MiniMax-M2.5",
messages=[{"role": "user", "content": "What is the weather in Singapore?"}],
tools=tools,
)
message = completion.choices[0].message
if message.tool_calls:
for tool_call in message.tool_calls:
print(tool_call.function.name, json.loads(tool_call.function.arguments))
Supported features
| Feature | Support |
|---|
| Text input and output | Supported |
| Thinking mode | Supported (always on) |
| Multi-turn conversation | Supported |
| Function calling | Supported |
| Context caching | Supported (implicit cache only) |
| Structured output | Not supported |
| Web search | Not supported |
| Prefix completion | Not supported |
| Batch inference | Not supported |
| Fine-tuning | Not supported |
Parameter defaults
| Parameter | Default |
|---|
temperature | 1.0 |
top_p | 0.95 |
presence_penalty | 0.0 |
Models and billing
| Model | Context window | Max input | Max output | Input | Output | Implicit cache input | RPM | TPM |
|---|
MiniMax-M2.5 | 204,800 | 196,608 | 32,768 | $0.304 | $1.213 | $0.061 | 500 | 1,000,000 |
Prices are per 1 million tokens in USD. For the current price in your region, see Model prices.
Billing is based on the number of input and output tokens. In thinking mode, the chain of thought counts as output tokens.
Error codes
If a model call fails and returns an error message, see Error codes.