Messages API (Claude Format)
Anthropic-compatible request structure for MiniMax-M2.
Messages API (Claude Format)
Use this endpoint when integrating MiniMax-M2 with SDKs or workflows that expect Anthropic Claude semantics.
- Endpoint:
POST https://minimax-m2.com/api/v1/messages - Models:
MiniMax-M2.1(default),MiniMax-M2— compare capabilities - Headers:
x-api-key: <api-key>anthropic-version: 2023-06-01
- Streaming: not yet supported (returns full response)
💡 Model Selection: Examples use MiniMax-M2.1 as default for enhanced Rust, Java, Golang, C++, Kotlin, Objective-C, and native mobile development. To use MiniMax-M2 for faster Python/JavaScript agent workflows, change the model field:
See model comparison for selection guidance.
Request Schema
The messages array supports role values user and assistant. Each content entry may be a string or an array of { "type": "text", "text": "..." } blocks.
Example: cURL
Node.js (TypeScript)
Python
Python (Anthropic SDK)
Python (Anthropic SDK) with MiniMax-M2 for Fast Agent Tasks
Why M2 here? Optimized for Python automation tasks with ~100 tokens/s throughput.
Response Shape
Use stop_reason to determine why generation ended (end_turn, max_tokens, etc.).
Client Integration Tips
- Anthropic SDKs: Configure the base URL to
https://minimax-m2.com/api/v1and supply the headers above. Most clients allow overriding the endpoint. - Retries: Handle
429(rate limit) and500responses with exponential backoff. - Token accounting: The response usage block feeds your internal cost monitoring.