Chat Completions API
OpenAI-compatible interface for MiniMax-M2 chat.
Chat Completions API
The chat completions endpoint mirrors OpenAI’s v1/chat/completions contract. Use it to stream or fetch MiniMax-M2 responses with minimal code changes.
- Endpoint:
POST https://minimax-m2.com/api/v1/chat/completions - Auth:
Authorization: Bearer <api-key> - Models:
MiniMax-M2.1(default, multi-language & native apps),MiniMax-M2(general coding & agents) → See model comparison to choose the right one for your workflow
💡 Model Selection: Examples below use MiniMax-M2.1 as the default for enhanced multi-language and native mobile capabilities. To use MiniMax-M2 for faster Python/JavaScript agent workflows, change the model field:
Both models share the same API parameters and pricing. See available models for detailed comparison.
Request Example (JSON)
cURL
Node.js (TypeScript)
Python
Python (OpenAI SDK)
Python with MiniMax-M2 (Fast Agent Workflows)
Why M2 here? Optimized for Python agent workflows with fast inference speed (~100 tokens/s).
Streaming Responses
Set stream: true to receive Server-Sent Events (SSE). The data format matches OpenAI’s, enabling drop-in use of existing clients.
Usage Metrics
Responses include token usage in the OpenAI schema (usage.prompt_tokens, usage.completion_tokens). These values feed billing and are visible in the dashboard usage explorer.