Home/MiniMax M4 API
Developer API - OpenAI-compatible
MiniMax M4 API
An OpenAI-compatible chat completions endpoint for MiniMax M4. Keep your existing OpenAI SDK code, change the base URL and the model id, and pay per token with the same Creovox credits you use for video, image and music.
Independent service, not affiliated with or endorsed by MiniMax. MiniMax and MiniMax M4 are trademarks of their respective owners.
Quick start
- 01
Create an API key
Sign in and open API Keys in the dashboard. Create a separate key for each app so you can disable one without breaking the others.
- 02
Point your OpenAI SDK at Creovox
Set base_url (Python) or baseURL (Node) to https://creovox.ai/api/v1 and use your Creovox key as the API key.
- 03
Call minimax-m4
Send a chat completion request with the model id minimax-m4. Credits are charged per token from your Creovox balance.
Connection details
Any OpenAI SDK or HTTP client works. CORS is open, but keep your API key on your server and never put it in browser code.
| Item | Value |
|---|---|
| Base URL | https://creovox.ai/api/v1 |
| Endpoint | POST https://creovox.ai/api/v1/chat/completions |
| Authentication | Authorization: Bearer YOUR_API_KEY |
| Model id | minimax-m4 |
| OpenAI SDKs | Set base_url (Python) or baseURL (Node) to the base URL above |
Code samples
Each example reads your key from the CREOVOX_API_KEY environment variable.
curl
curl https://creovox.ai/api/v1/chat/completions \
-H "Authorization: Bearer $CREOVOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-m4",
"messages": [
{"role": "user", "content": "Write a Python function that merges two sorted lists."}
]
}'Python (OpenAI SDK)
import os
from openai import OpenAI
client = OpenAI(
base_url="https://creovox.ai/api/v1",
api_key=os.environ["CREOVOX_API_KEY"],
)
response = client.chat.completions.create(
model="minimax-m4",
messages=[{"role": "user", "content": "Write a Python function that merges two sorted lists."}],
reasoning_effort="medium",
)
print(response.choices[0].message.content)Node.js (OpenAI SDK)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://creovox.ai/api/v1",
apiKey: process.env.CREOVOX_API_KEY,
});
const response = await client.chat.completions.create({
model: "minimax-m4",
messages: [{ role: "user", content: "Write a Python function that merges two sorted lists." }],
reasoning_effort: "medium",
});
console.log(response.choices[0].message.content);Streaming (Python)
import os
from openai import OpenAI
client = OpenAI(
base_url="https://creovox.ai/api/v1",
api_key=os.environ["CREOVOX_API_KEY"],
)
stream = client.chat.completions.create(
model="minimax-m4",
messages=[{"role": "user", "content": "Write a Python function that merges two sorted lists."}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")Request parameters
Supported request fields. Messages are text only: images and files are not supported yet.
| Parameter | Type | Description |
|---|---|---|
model | string | Must be minimax-m4, the only model on this endpoint. |
messages | array | Conversation messages. content is a string or an array of text parts. Text only. |
stream | boolean | Set to true to receive server-sent events instead of a single JSON response. |
stream_options | object | Streaming options, as in the OpenAI API. |
reasoning_effort | string | low, medium, high or xhigh. Other values are ignored, because MiniMax M4 reasoning is always on. |
max_tokens | integer | Positive integer. Values above 131072 are capped at 131072. |
temperature | number | Sampling temperature, as in the OpenAI API. |
top_p | number | Nucleus sampling, as in the OpenAI API. |
tools | array | Function tool definitions in OpenAI format. |
tool_choice | string / object | Controls whether and which tool the model calls, as in the OpenAI API. |
parallel_tool_calls | boolean | Allow the model to return several tool calls in one turn. |
response_format | object | Request structured output, for example JSON mode. |
Pricing
Requests are billed from your Creovox credit balance. MiniMax's own list price is shown for reference only.
| Item | Creovox | MiniMax list price (reference) |
|---|---|---|
| Input tokens | 240 credits per 1M tokens | $0.80 per 1M tokens |
| Cached input tokens | — | $0.05 per 1M tokens |
| Output tokens | 930 credits per 1M tokens | $3.10 per 1M tokens |
| Minimum charge | 0.05 credits per request | — |
Credits are the same balance used across Creovox. The MiniMax column is MiniMax's own list price, not the Creovox price. See pricing
MiniMax M4 at a glance
Facts reported by MiniMax and OpenRouter, linked below.
| Item | Value |
|---|---|
| Developer | MiniMax |
| Release date | December 3, 2026 |
| Parameters | 2.74T total, 66B active per token, mixture-of-experts |
| Context window | 1M tokens |
| Max output on Creovox | 131,072 tokens per request |
| Reasoning | Always on and cannot be turned off |
| Input on this API | Text only for now. The model itself accepts image and video input; this endpoint does not expose it yet. |
| Weights | Not released yet, according to MiniMax's GitHub repository |
Benchmarks
Vendor-reported by MiniMax. These scores come from MiniMax's own chart and are not independent measurements. Higher is better.
| Benchmark | MiniMax M4 | Kimi K3.1 | DeepSeek V4.1 | GLM 5.3 | Gemini 4 Neon | GPT-6.2 Sol | Opus 5.5 | Fable 5.2 |
|---|---|---|---|---|---|---|---|---|
| FrontierCode-AA 2.0 | 33 | 25.5 | 28.2 | 21.6 | 44.4 | 44.4 | 46.9 | 48.8 |
| Code Arena (WebDev) | 1725 | 1682 | 1661 | 1623 | 1759 | 1752 | 1818 | 1819 |
| Agent Arena | 1194 | 1146 | 1108 | 1098 | 1313 | 1217 | 1350 | 1433 |
| Finance Agent v2.1 | 66.7 | 61.5 | 62.9 | 65 | 68.6 | 58.9 | 67.9 | 69.5 |
| Design Arena (HTML) | 1440 | 1402 | 1361 | 1335 | 1437 | 1466 | 1445 | 1460 |
MiniMax itself says a substantial gap remains compared with the strongest overseas models. Test the model on your own prompts before you rely on it.
Errors
Errors use the OpenAI shape: an error object with message, type and code. Branch on error.code.
| HTTP status | error.code | Meaning |
|---|---|---|
| 400 | invalid_request | The request is invalid, for example a missing or wrongly typed field or a model other than minimax-m4. |
| 401 | invalid_api_key | The API key is missing or invalid. |
| 402 | insufficient_credits | Your credit balance is too low for this request. Top up your credits. |
| 429 | rate_limit_exceeded | Too many requests. Retry with exponential backoff. |
| 502 | upstream_error | The upstream provider returned an error. |
| 503 | service_unavailable | The service is temporarily unavailable. Retry shortly. |
Served model and fallback
Requests are served by MiniMax M4 through OpenRouter (minimax/minimax-m4). If that upstream is unavailable, a request may be answered by GPT-6.2 Sol instead. A fallback is never presented as M4:
- The model field of the response says gpt-6.2-sol.
- The X-Served-Model response header says gpt-6.2-sol.
- The request is billed at the lower GPT-6.2 Sol rate: 180 credits per 1M input tokens and 900 credits per 1M output tokens.
Read the served model in code:
raw = client.chat.completions.with_raw_response.create(
model="minimax-m4",
messages=[{"role": "user", "content": "Hello"}],
)
print(raw.headers.get("X-Served-Model"))
response = raw.parse()
print(response.model) # "gpt-6.2-sol" means the fallback answeredFAQ
Is this the official MiniMax API?
No. Creovox is independent and is not affiliated with or endorsed by MiniMax. It offers MiniMax M4 through an OpenAI-compatible endpoint, served via OpenRouter, and bills in Creovox credits.
How much does the MiniMax M4 API cost on Creovox?
240 credits per 1M input tokens and 930 credits per 1M output tokens, with a minimum of 0.05 credits per request. For reference, MiniMax's own list price is $0.80 input, $0.05 cached input and $3.10 output per 1M tokens. That is MiniMax's price, not the Creovox price.
Does it work with the OpenAI SDK?
Yes. Set base_url (Python) or baseURL (Node) to https://creovox.ai/api/v1, use your Creovox API key and the model id minimax-m4. Any HTTP client can also call POST /chat/completions directly.
How are requests billed, and what are the limits?
Each request is charged in credits from your Creovox balance, per token, with a minimum of 0.05 credits. When the balance is too low the API returns 402 insufficient_credits. Too many requests return 429 rate_limit_exceeded; retry with exponential backoff.
Can I send images or files?
Not yet. This endpoint is text only: message content is a string or an array of text parts. Images and files are not supported yet.
What happens if MiniMax M4 is unavailable?
A request may be answered by GPT-6.2 Sol instead. When that happens, the response model field and the X-Served-Model header say gpt-6.2-sol, and the request is billed at the lower GPT-6.2 Sol rate. A fallback is never presented as M4.
Can I turn reasoning off?
No. MiniMax M4 reasoning is always on. reasoning_effort accepts low, medium, high or xhigh; other values are ignored.