Quick Start
1. Install Anthropic 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.contentlist to the message history (includes all content blocks: thinking/text/tool_use)
Supported Models
When using the Anthropic SDK, theMiniMax-M3 MiniMax-M2.7 MiniMax-M2.7-highspeed MiniMax-M2.5 MiniMax-M2.5-highspeed MiniMax-M2.1 MiniMax-M2.1-highspeed MiniMax-M2 model is supported:
| Model Name | Context Window | Description |
|---|---|---|
| MiniMax-M3 | 1,000,000 | Latest M-series language model for agentic reasoning, tool use, coding, and long-context tasks |
| 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.
The Anthropic API compatibility interface currently only supports the
MiniMax-M3 MiniMax-M2.7 MiniMax-M2.7-highspeed MiniMax-M2.5 MiniMax-M2.5-highspeed MiniMax-M2.1 MiniMax-M2.1-highspeed MiniMax-M2 model. For other models, please use the standard MiniMax API
interface.Compatibility
Supported Parameters
When using the Anthropic SDK, we support the following input parameters:| Parameter | Support Status | Description |
|---|---|---|
model | Fully supported | supports MiniMax-M3 MiniMax-M2.7 MiniMax-M2.7-highspeed MiniMax-M2.5 MiniMax-M2.5-highspeed MiniMax-M2.1 MiniMax-M2.1-highspeed MiniMax-M2 model |
messages | Partial support | MiniMax-M3 supports text, image, video, tool use, tool result, and thinking blocks. The M2.7, M2.5, M2.1, and M2 series support text and tool-call content blocks only; they do not support image or video input |
max_tokens | Fully supported | Maximum number of tokens to generate |
stream | Fully supported | Streaming response |
system | Fully supported | System prompt |
temperature | Fully supported | Range [0, 2], controls output randomness, recommended value: 1 |
tool_choice | Fully supported | Tool selection strategy |
tools | Fully supported | Tool definitions |
top_p | Fully supported | Nucleus sampling parameter, range [0, 1]. Default 0.95 for MiniMax-M3 and 0.9 for M2.x models |
metadata | Fully Supported | Metadata |
thinking | Fully Supported | Thinking is off by default for MiniMax-M3 and can be enabled with adaptive. Thinking cannot be disabled for M2.x models. |
top_k | Ignored | This parameter will be ignored |
stop_sequences | Ignored | This parameter will be ignored |
mcp_servers | Ignored | This parameter will be ignored |
context_management | Ignored | This parameter will be ignored |
container | Ignored | This parameter will be ignored |
Thinking Control
ForMiniMax-M3, the thinking parameter controls whether the model can emit thinking content blocks.
- If
thinkingis omitted, thinking is off by default and the response does not includethinkingblocks. - Set
thinking: {"type": "adaptive"}to explicitly enable thinking. For MiniMax-M3,adaptiveis equivalent to thinking on. - Set
thinking: {"type": "disabled"}to explicitly keep MiniMax-M3 thinking output off. - For M2.x models, thinking cannot be disabled;
thinking: {"type": "disabled"}is accepted but thinking remains on.
thinking blocks, preserve them unchanged in later turns, especially in tool-use conversations.
Messages Field Support
| Field Type | Support Status | Description |
|---|---|---|
type="text" | Fully supported | Text messages |
type="image" | M3 only | Image input via URL or base64. Supports JPEG, PNG, GIF, WEBP |
type="video" | M3 only | Video input via URL, base64, or mm_file://{file_id}. Supports MP4, AVI, MOV, MKV |
type="tool_use" | Fully supported | Tool calls |
type="tool_result" | Fully supported | Tool call results |
type="thinking" | Fully supported | Reasoning content. Return the block unchanged in multi-turn thinking conversations |
MiniMax-M3, 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 POST /anthropic/v1/messages/count_tokens or response usage for exact usage:
detail | Rough single-image token usage |
|---|---|
low | Usually a few hundred tokens, up to ~600 |
default | Often ~1k-3k tokens, up to ~5k |
high | Often several thousand tokens, up to ~15k+ |
POST /anthropic/v1/messages/count_tokens for MiniMax-M3 token estimation. This endpoint returns input token usage without generating model output.
Examples
Streaming Response
Python