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

Request / 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
FieldField typeRequiredDefaultOptions / rangeDescriptionExample
messagesarrayY--Chat Completions message array; user messages can carry image_url parts (public URL or base64).[{"role":"user","content":"Hello, world"}]
temperaturenumberN--Controls randomness.1
top_pnumberN--Nucleus sampling probability threshold.0.95
max_tokensintegerN--Caps the length of this response; reasoning tokens count toward it.4096
stoparrayN--Strings that stop generation.["\n\n\n"]
streambooleanNfalse-Return the response as server-sent events.false
stream_optionsobjectN--Extra streaming options, e.g. include_usage.{"include_usage":true}
reasoning_effortenumN-low, medium, high, xhigh, maxMiniMax M4 always thinks (it cannot be switched off); this sets how much effort the thinking gets. Reasoning tokens are billed as output.medium
response_formatobjectN--Asks for a structured format such as a JSON object; describe the keys in the prompt.{"type":"json_object"}
toolsarrayN--Function calling definitions.[]
tool_choiceenumN-none, autoControls the tool calling strategy.auto
Response fields
FieldField typeRequiredDefaultOptions / rangeDescriptionExample
idstringN---chatcmpl_example
objectstringN---chat.completion
createdintegerN---1710000000
modelstringN---minimax-m4
choicesarrayN---[{"index":0,"message":{"role":"assistant","content":"Hello from Mix API"},"finish_reason":"stop"}]
choices[]objectN---{"index":0,"message":{"role":"assistant","content":"Hello from Mix API"},"finish_reason":"stop"}
choices[].indexintegerN---0
choices[].messageobjectN---{"role":"assistant","content":"Hello from Mix API"}
choices[].message.rolestringN---assistant
choices[].message.contentstringN---Hello from Mix API
choices[].finish_reasonstringN---stop
usageobjectN---{"total_tokens":24,"prompt_tokens":8,"completion_tokens":16}
usage.prompt_tokensintegerN---8
usage.completion_tokensintegerN---16
usage.total_tokensintegerN---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"
}'