MiniMax M4
minimax-m4
TextMiniMaxMiniMax M4minimax-m4
minimax-m4 is MiniMax M4: 1M-token context and image input. Thinking is always on and reasoning_effort sets its depth from low to max. Tool calls and JSON output, with one per-token price across the whole context window.
Authentication
- Base URL
- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- Model name (model)
minimax-m4
Integration protocol
Why choose this protocol
Best for existing OpenAI SDK, Chat Completions code, or unified gateway integrations.
Endpoint URL
POST/v1/chat/completions
Authorization: Bearer YOUR_API_KEYContent-Type: application/jsonRequest / response JSON
Request
{
"stop": [
"\n\n\n"
],
"model": "minimax-m4",
"top_p": 0.95,
"stream": false,
"messages": [
{
"role": "user",
"content": "Hello, world"
}
],
"max_tokens": 4096,
"temperature": 1,
"reasoning_effort": "medium"
}Response
{
"id": "chatcmpl_example",
"model": "minimax-m4",
"usage": {
"total_tokens": 24,
"prompt_tokens": 8,
"completion_tokens": 16
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello from Mix API"
},
"finish_reason": "stop"
}
],
"created": 1710000000
}Request / response fields
Request fields
| Field | Field type | Required | Default | Options / range | Description | Example |
|---|---|---|---|---|---|---|
| messages | array | Y | - | - | Chat Completions message array; user messages can carry image_url parts (public URL or base64). | [{"role":"user","content":"Hello, world"}] |
| temperature | number | N | - | - | Controls randomness. | 1 |
| top_p | number | N | - | - | Nucleus sampling probability threshold. | 0.95 |
| max_tokens | integer | N | - | - | Caps the length of this response; reasoning tokens count toward it. | 4096 |
| stop | array | N | - | - | Strings that stop generation. | ["\n\n\n"] |
| stream | boolean | N | false | - | Return the response as server-sent events. | false |
| stream_options | object | N | - | - | Extra streaming options, e.g. include_usage. | {"include_usage":true} |
| reasoning_effort | enum | N | - | low, medium, high, xhigh, max | MiniMax M4 always thinks (it cannot be switched off); this sets how much effort the thinking gets. Reasoning tokens are billed as output. | medium |
| response_format | object | N | - | - | Asks for a structured format such as a JSON object; describe the keys in the prompt. | {"type":"json_object"} |
| tools | array | N | - | - | Function calling definitions. | [] |
| tool_choice | enum | N | - | none, auto | Controls the tool calling strategy. | auto |
Response fields
| Field | Field type | Required | Default | Options / range | Description | Example |
|---|---|---|---|---|---|---|
| id | string | N | - | - | - | chatcmpl_example |
| object | string | N | - | - | - | chat.completion |
| created | integer | N | - | - | - | 1710000000 |
| model | string | N | - | - | - | minimax-m4 |
| choices | array | N | - | - | - | [{"index":0,"message":{"role":"assistant","content":"Hello from Mix API"},"finish_reason":"stop"}] |
| choices[] | object | N | - | - | - | {"index":0,"message":{"role":"assistant","content":"Hello from Mix API"},"finish_reason":"stop"} |
| choices[].index | integer | N | - | - | - | 0 |
| choices[].message | object | N | - | - | - | {"role":"assistant","content":"Hello from Mix API"} |
| choices[].message.role | string | N | - | - | - | assistant |
| choices[].message.content | string | N | - | - | - | Hello from Mix API |
| choices[].finish_reason | string | N | - | - | - | stop |
| usage | object | N | - | - | - | {"total_tokens":24,"prompt_tokens":8,"completion_tokens":16} |
| usage.prompt_tokens | integer | N | - | - | - | 8 |
| usage.completion_tokens | integer | N | - | - | - | 16 |
| usage.total_tokens | integer | N | - | - | - | 24 |
Code examples
cURLrequest.sh
curl -X POST "https://api.dreamto.ai/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-m4",
"messages": [
{
"role": "user",
"content": "Hello, world"
}
],
"temperature": 1,
"top_p": 0.95,
"max_tokens": 4096,
"stop": [
"\n\n\n"
],
"stream": false,
"reasoning_effort": "medium"
}'