API Documentation
OpenAI-compatible API for MiniMax-M2.5
Quick Start
The MiniMax-M2.5 API is fully compatible with the OpenAI API format. You can use any OpenAI SDK or tool that supports custom base URLs.
Base URL
https://api.minimax.villamarket.ai/v1cURL
curl https://api.minimax.villamarket.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-m2.5",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://api.minimax.villamarket.ai/v1",
api_key="YOUR_API_KEY",
)
response = client.chat.completions.create(
model="minimax-m2.5",
messages=[{"role": "user", "content": "Write a quicksort in Python"}],
)
print(response.choices[0].message.content)JavaScript/TypeScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.minimax.villamarket.ai/v1",
apiKey: "YOUR_API_KEY",
});
const response = await client.chat.completions.create({
model: "minimax-m2.5",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);Authentication
All API requests require a Bearer token in the Authorization header. Get your API key from the Dashboard.
Authorization: Bearer sk-...Chat Completions
Creates a model response for the given chat conversation.
Endpoint
POST /v1/chat/completionsParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | "minimax-m2.5" |
| messages | array | Yes | Array of message objects |
| temperature | number | No | 0-2, default 0.7 |
| max_tokens | integer | No | Max output tokens, default 4096 |
| stream | boolean | No | Enable streaming, default false |
| tools | array | No | Tool definitions for function calling |
| top_p | number | No | Nucleus sampling, default 1 |
| stop | string/array | No | Stop sequences |
Streaming
Set stream: true to receive Server-Sent Events (SSE). Each event contains a delta with the new content.
stream = client.chat.completions.create(
model="minimax-m2.5",
messages=[{"role": "user", "content": "Explain MoE"}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta
if delta.content:
print(delta.content, end="", flush=True)
# Think blocks appear in delta.reasoning_content (custom field)
Tool Calling
MiniMax-M2.5 supports native function calling via the tools parameter.
response = client.chat.completions.create(
model="minimax-m2.5",
messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"]
}
}
}],
)
tool_call = response.choices[0].message.tool_calls[0]
print(tool_call.function.name) # "get_weather"
print(tool_call.function.arguments) # '{"city": "Tokyo"}'Think Blocks
MiniMax-M2.5 includes internal reasoning in think blocks. When streaming, reasoning content appears in delta.reasoning_content before the main response in delta.content.
# The model automatically uses <think>...</think> blocks
# vLLM separates these into reasoning_content and content
for chunk in stream:
delta = chunk.choices[0].delta
# Internal reasoning (optional, may be empty)
if hasattr(delta, 'reasoning_content') and delta.reasoning_content:
print(f"[thinking] {delta.reasoning_content}", end="")
# Final response
if delta.content:
print(delta.content, end="")Models
| Model ID | Context | Precision | Input Price | Output Price |
|---|---|---|---|---|
| minimax-m2.5 | 128K | FP8 | $0.30/M | $1.20/M |
| MiniMaxAI/MiniMax-M2.5 | 128K | FP8 | $0.30/M | $1.20/M |
Rate Limits
| Tier | RPM | Budget | Keys |
|---|---|---|---|
| Free | 5 | $1/mo | 1 |
| Pro | 16 | $20/mo | 5 |
| Enterprise | Unlimited | $100/mo | Unlimited |
CLI (mm)
mm is the official MiniMax terminal agent. Chat, code, run skills, and use the Ralph Loop — all from your terminal.
Install
| Method | Command |
|---|---|
| curl | curl -fsSL minimax.villamarket.ai/install | sh |
| brew | brew install gastown-publish/mm/mm |
| pip | pip install minimax-agent |
| uv | uv tool install minimax-agent |
| pipx | pipx install minimax-agent |
| apt | sudo apt install minimax-agent |
Quick Start
# Authenticate
mm auth login --key YOUR_API_KEY
# Interactive chat
mm run
# Launch Nori TUI (multi-provider AI agent)
mm term
# Launch coding tools pre-configured for MiniMax
mm launch claude
mm launch aider
mm launch nori
# Run a skill
mm skills run code-review "Review my code for bugs"
# Ralph Loop — iterative development
mm loop "Fix all failing tests" -n 50 -p "ALL_TESTS_PASS"Commands
| Command | Description |
|---|---|
| mm run | Interactive chat REPL |
| mm term | Launch Nori TUI |
| mm launch <tool> | Launch AI tools (claude, aider, codex, nori, opencode, openclaw) |
| mm acp | Start ACP server (for IDEs) |
| mm loop | Ralph Loop (iterative dev) |
| mm skills list | List bundled skills |
| mm skills run <name> | Run a skill |
| mm auth login | Store API key |
| mm setup <tool> | Configure IDE integration |
Bundled Skills
| Skill | Description |
|---|---|
| deep-research | Systematic web research with sources |
| code-review | Review for bugs, security, performance |
| git-commit | Conventional commit messages |
| explain-code | Step-by-step code explanation |
| fix-tests | Diagnose and fix failing tests |
| refactor | Safe refactoring with verification |
| write-tests | Generate tests for existing code |
| ralph-loop | Iterative development (100 loops) |
Integrations
MiniMax-M2.5 works with any tool that supports custom OpenAI-compatible endpoints.
Claude Code
Use mm launch claude for one-step setup, or configure manually:
# Option 1: Use mm launch (recommended)
mm launch claude
# Option 2: Manual setup
export ANTHROPIC_BASE_URL=https://api.minimax.villamarket.ai
export ANTHROPIC_API_KEY=YOUR_API_KEY
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY
claude --model minimax-m2.5Nori
Multi-provider AI TUI that wraps Claude, Gemini, and Codex.
# Option 1: Use mm (recommended)
mm term
# Option 2: Use mm launch
mm launch nori
# Option 3: Manual
npm install -g nori-ai-cli
export ANTHROPIC_BASE_URL=https://api.minimax.villamarket.ai
export ANTHROPIC_API_KEY=YOUR_API_KEY
noriCursor
Settings → Models → Add Model → OpenAI Compatible
Base URL: https://api.minimax.villamarket.ai/v1
API Key: YOUR_API_KEY
Model: minimax-m2.5Aider
# Option 1: Use mm launch
mm launch aider
# Option 2: Manual
aider --openai-api-base https://api.minimax.villamarket.ai/v1 \
--openai-api-key YOUR_API_KEY \
--model openai/minimax-m2.5Codex CLI
# Option 1: Use mm launch
mm launch codex
# Option 2: Manual
export OPENAI_BASE_URL=https://api.minimax.villamarket.ai/v1
export OPENAI_API_KEY=YOUR_API_KEY
codex --model minimax-m2.5OpenCode
# Option 1: Use mm launch
mm launch opencode
# Option 2: Manual
export OPENAI_BASE_URL=https://api.minimax.villamarket.ai/v1
export OPENAI_API_KEY=YOUR_API_KEY
opencodeContinue (VS Code)
{
"models": [{
"title": "MiniMax-M2.5",
"provider": "openai",
"model": "minimax-m2.5",
"apiBase": "https://api.minimax.villamarket.ai/v1",
"apiKey": "YOUR_API_KEY"
}]
}SillyTavern
API Type: Chat Completion (OpenAI)
Custom Endpoint: https://api.minimax.villamarket.ai/v1
API Key: YOUR_API_KEY
Model: minimax-m2.5Errors
| Code | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 402 | Budget exceeded for this key |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
| 503 | Model is loading or unavailable |