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(default for API compatibility),MiniMax-M2.1,MiniMax-M2.5,MiniMax-M2.7→ See model comparison to choose the right one for your workflow
💡 Model Selection: Examples below use MiniMax-M2.1 for enhanced multi-language and native mobile capabilities. If model is omitted, the API defaults to MiniMax-M2 for backward compatibility.
To use MiniMax-M2 for faster Python/JavaScript agent workflows, change the model field:
All models share the same API parameters. Pricing may differ by model (especially deployment-specific models such as MiniMax-M2.7); use GET /api/v1/models for the effective rates in your environment.
For M2.7 alias, pricing, and fallback behavior, see MiniMax-M2.7 Guide.
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.