Skip to main content
To meet developers’ needs for the Anthropic API ecosystem, our API now supports the Anthropic API format. With simple configuration, you can integrate MiniMax capabilities into the Anthropic API ecosystem.
MiniMax-M3.1-Flash-Preview is available only through M Plan and MiniMax Code for now.

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.content list to the message history (includes all content blocks: thinking/text/tool_use)

Supported Models

When using the Anthropic SDK, the MiniMax-M3.1-Flash-Preview 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 is supported:
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.1-Flash-Preview 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:

Thinking Control

The thinking parameter controls whether the model can emit thinking content blocks. Behavior differs per model:
The error returned for thinking: {"type": "disabled"}:
When a response includes thinking blocks, preserve them unchanged in later turns, especially in tool-use conversations.

Thinking Depth Control (MiniMax-M3.1-Flash-Preview only)

MiniMax-M3.1-Flash-Preview supports tuning thinking depth through output_config.effort, from low through medium, high, xhigh, to max. Higher levels make the model think more thoroughly, producing more thinking tokens at higher latency. When omitted, output_config.effort defaults to max. none is not supported and returns 400.
curl

Messages Field Support

For MiniMax-M3.1-Flash-Preview and 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: The Anthropic-compatible API also supports POST /anthropic/v1/messages/count_tokens for MiniMax-M3.1-Flash-Preview and MiniMax-M3 token estimation. This endpoint returns input token usage without generating model output.

Examples

Streaming Response

Python

Important Notes

  1. The Anthropic API compatibility interface currently only supports the MiniMax-M3.1-Flash-Preview 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
  2. The temperature parameter range is [0, 2], values outside this range will return an error
  3. Some Anthropic parameters (such as top_k, stop_sequences, mcp_servers, context_management, container) will be ignored
  4. MiniMax-M3.1-Flash-Preview and MiniMax-M3 support image and video input through Anthropic-compatible content blocks. The M2.7, M2.5, M2.1, and M2 series support text and tool-call content blocks only