API DOCS
MiniMax M4 Pro API documentation
The API follows the OpenAI Chat Completions format. Point an OpenAI client at the base URL below, use your key as the bearer token, and choose minimax-m4 or minimax-m4-pro.
Quickstart
- Create a key on the homepage and copy it. It starts with sk_minimaxm4-pro_.
- Add balance with a one-time payment from $5.
- Send a request with the base URL and your key.
https://minimaxm4.pro/v1curl https://minimaxm4.pro/v1/chat/completions \
-H "Authorization: Bearer $RIDGECALL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-m4-pro",
"messages": [{"role": "user", "content": "Write a Python function that merges overlapping intervals."}]
}'Models and reasoning
MiniMax M4 always thinks before it answers. Both model IDs run the same MiniMax M4 model at the same price per token; they differ only in how much it thinks.
minimax-m4Medium reasoning by default. Send reasoning_effort low, medium, high, xhigh or max to change it per request.minimax-m4-proAlways maximum reasoning. Any reasoning_effort you send is ignored. MiniMax publishes no separate Pro model; this is MiniMax M4 at max effort.Reasoning arrives in a separate reasoning field (delta.reasoning when streaming) and its tokens are counted in completion_tokens. When you continue a tool-calling conversation, send the assistant message back as you received it.
Use MiniMax M4 in editors and agents
Any tool that lets you add an OpenAI-compatible provider works. Set the base URL, paste your key, and type the model ID.
API Provider: OpenAI Compatible
Base URL: https://minimaxm4.pro/v1
API Key: sk_minimaxm4-pro_your_key
Model ID: minimax-m4-proOpen the extension settings in VS Code and choose the OpenAI Compatible provider.
Reference
POST /v1/chat/completions
Creates a reply. Supported fields: model, messages, max_tokens or max_completion_tokens, reasoning_effort, stream, stream_options, tools, tool_choice, parallel_tool_calls, response_format, stop and seed. temperature and top_p are accepted but MiniMax M4 uses fixed values. n must be 1.
With stream: true the reply arrives as server-sent events and ends with data: [DONE]. Set stream_options.include_usage to receive a final chunk with token counts.
{
"model": "minimax-m4-pro",
"messages": [{"role": "user", "content": "What is in src/app.ts?"}],
"tools": [{
"type": "function",
"function": {
"name": "read_file",
"description": "Read a file from the repository",
"parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}
}
}]
}{
"model": "minimax-m4-pro",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What is wrong with this chart?"},
{"type": "image_url", "image_url": {"url": "https://example.com/chart.png"}}
]
}]
}GET /v1/models
Lists the models that are available right now.
curl https://minimaxm4.pro/v1/models -H "Authorization: Bearer $RIDGECALL_API_KEY"GET /v1/balance
Returns the remaining USD balance of the account that owns the key.
curl https://minimaxm4.pro/v1/balance -H "Authorization: Bearer $RIDGECALL_API_KEY"Billing
Every request is billed from your USD balance by the tokens it uses, with a minimum of $0.001. Before a request starts, the cost of its input estimate plus max_tokens is held; when it finishes, you pay for the actual usage and the rest returns at once. If the balance cannot cover max_tokens, the request runs with a smaller max_tokens; below 256 tokens it is refused with 402. Failed requests are not charged.
Each response carries an X-Request-Id header. Non-streaming responses also carry X-Balance-Charged-Usd with the final charge.
See prices and top-ups →Errors and limits
Errors use the OpenAI error format, so SDKs raise their usual exceptions.
{
"error": {
"message": "Insufficient balance: this request needs at least $0.002. Add balance at https://minimaxm4.pro/pricing.",
"type": "insufficient_quota",
"param": null,
"code": "insufficient_quota"
}
}Requests and replies are not stored. We keep metering data only: model, reasoning setting, token counts, cost, status and time.