Skip to main content
Third-party models

MiniMax

Call MiniMax-M2.5 through the OpenAI-compatible API or DashScope SDK on QwenCloud.

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.
  • OpenAI compatible
  • DashScope
  • Python
  • Node.js
  • curl
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

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

FeatureSupport
Text input and outputSupported
Thinking modeSupported (always on)
Multi-turn conversationSupported
Function callingSupported
Context cachingSupported (implicit cache only)
Structured outputNot supported
Web searchNot supported
Prefix completionNot supported
Batch inferenceNot supported
Fine-tuningNot supported

Parameter defaults

ParameterDefault
temperature1.0
top_p0.95
presence_penalty0.0

Models and billing

ModelContext windowMax inputMax outputInputOutputImplicit cache inputRPMTPM
MiniMax-M2.5204,800196,60832,768$0.304$1.213$0.0615001,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.