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/v1

cURL

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/completions

Parameters

ParameterTypeRequiredDescription
modelstringYes"minimax-m2.5"
messagesarrayYesArray of message objects
temperaturenumberNo0-2, default 0.7
max_tokensintegerNoMax output tokens, default 4096
streambooleanNoEnable streaming, default false
toolsarrayNoTool definitions for function calling
top_pnumberNoNucleus sampling, default 1
stopstring/arrayNoStop 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 IDContextPrecisionInput PriceOutput Price
minimax-m2.5128KFP8$0.30/M$1.20/M
MiniMaxAI/MiniMax-M2.5128KFP8$0.30/M$1.20/M

Rate Limits

TierRPMBudgetKeys
Free5$1/mo1
Pro16$20/mo5
EnterpriseUnlimited$100/moUnlimited

CLI (mm)

mm is the official MiniMax terminal agent. Chat, code, run skills, and use the Ralph Loop — all from your terminal.

Install

MethodCommand
curlcurl -fsSL minimax.villamarket.ai/install | sh
brewbrew install gastown-publish/mm/mm
pippip install minimax-agent
uvuv tool install minimax-agent
pipxpipx install minimax-agent
aptsudo 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

CommandDescription
mm runInteractive chat REPL
mm termLaunch Nori TUI
mm launch <tool>Launch AI tools (claude, aider, codex, nori, opencode, openclaw)
mm acpStart ACP server (for IDEs)
mm loopRalph Loop (iterative dev)
mm skills listList bundled skills
mm skills run <name>Run a skill
mm auth loginStore API key
mm setup <tool>Configure IDE integration

Bundled Skills

SkillDescription
deep-researchSystematic web research with sources
code-reviewReview for bugs, security, performance
git-commitConventional commit messages
explain-codeStep-by-step code explanation
fix-testsDiagnose and fix failing tests
refactorSafe refactoring with verification
write-testsGenerate tests for existing code
ralph-loopIterative 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.5

Nori

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
nori

Cursor

Settings → Models → Add Model → OpenAI Compatible

Base URL: https://api.minimax.villamarket.ai/v1
API Key: YOUR_API_KEY
Model: minimax-m2.5

Aider

# 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.5

Codex 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.5

OpenCode

# 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
opencode

Continue (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.5

Errors

CodeMeaning
401Invalid or missing API key
402Budget exceeded for this key
429Rate limit exceeded
500Internal server error
503Model is loading or unavailable