MiniMax-M3 API

MiniMax M3 supports coding and agent tasks, a 1M-token context window, and native multimodal capabilities.

POST /v1/chat/completions

Call MiniMax-M3 using the OpenAI-compatible protocol.

Request parameters

ParameterTypeRequiredDescription
modelstringYesThe model name to be called, fill in the name from the model gallery.
messagesarrayYesList of conversation messages, each containing role and content. The role can be system / user / assistant / tool.
streambooleanNoWhether to stream the response. When set to true, the response is pushed in chunks via SSE, suitable for scenarios requiring real-time display during generation.
temperaturenumberNoSampling temperature; higher values result in more diverse outputs, lower values result in more stable outputs.
max_tokensintegerNoMaximum number of tokens to generate in this response. Omitted means the model decides autonomously and will not be truncated.
top_pnumberNoNucleus sampling, selecting candidates from the top top_p cumulative probabilities. Only one of temperature and nucleus sampling should be used.
toolsarrayNoList of available tools that the model can call. When needed, the model will return tool_calls, which you then execute and feed back as a tool call with role=tool.
tool_choicestringNoControl whether and how to use tools: auto (model decides), none (disable), or specify a specific tool. Must be used together with tools.
response_formatobjectNoSpecify the output format, e.g., return in JSON format.
stoparrayNoStop generation upon encountering any of these strings; the strings will not appear in the result.
nintegerNoNumber of candidate responses to return per request. Billing is based on the total token count across all candidates.
seedintegerNoFixed random seed; ensures consistent output for the same input.
frequency_penaltynumberNoReduce the probability of a token being selected based on its frequency of appearance; used to suppress repetition.
presence_penaltynumberNoReduce the probability of a token being selected based on whether it has appeared previously; used to encourage topic change.
logit_biasobjectNoAdjust the selection probability of tokens by their token ID; can be used to strongly promote or suppress specific words.
parallel_tool_callsbooleanNoWhether to allow the model to return multiple tool calls in one response. Must be used together with tools.
logprobsbooleanNoWhether to return the log probability of selected tokens.
top_logprobsintegerNoNumber of additional candidate token probabilities to return per position. Must be enabled together with logprobs.
max_completion_tokensintegerNoMaximum length of the response. Some newer models use this field instead of max_tokens.
reasoning_effortstringNoInference strength. Increasing this value makes the model think longer, typically resulting in more accurate outputs, but at the cost of higher token consumption. Only effective for inference models. Options: minimal / low / medium / high
verbositystringNoLevel of detail in the response. Options: low / medium / high
modalitiesarrayNoThe expected output modality, such as text only or text plus audio. Only multimodal models are effective.
audioobjectNoAudio output settings, such as voice tone and audio format. Must include audio in the modalities.
predictionobjectNoPrediction output. Providing this when most of the response is known can accelerate generation.
stream_optionsobjectNoStreaming-related settings, such as whether to include usage statistics at the last frame. Requires stream=true.
storebooleanNoWhether the conversation is retained on the model service side.
metadataobjectNoCustom key-value pairs, which will be sent along with the request for your own classification and retrieval.
userstringNoIdentifier for the end-user, to help differentiate your user sources.
prompt_cache_keystringNoPrompt caching key. Requests with the same prefix using the same key are more likely to hit cache, resulting in faster and more efficient retrieval.
prompt_cache_retentionstringNoDuration for which prompt cache is retained.

Request example

curl https://api.router.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-你的令牌" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m3",
    "messages": [{"role": "user", "content": "你好"}]
  }'

Endpoint reference: Create a chat completion (OpenAI-compatible)

POST /v1/messages

Call MiniMax-M3 using the Anthropic-native protocol.

Request parameters

ParameterTypeRequiredDescription
modelstringYesThe model name to be called, fill in the name from the model gallery.
messagesarrayYesArray of conversation messages, each containing role and content. The role can only be user or assistant; system prompts are handled via a separate system field and not included here.
max_tokensintegerYesMaximum number of tokens to generate in this response. This is a required field under this protocol.
systemstringNoSystem prompt. Can be passed as a string or as an array to set different segments individually.
streambooleanNoWhether to stream the response. Set to true for incremental SSE streaming.
temperaturenumberNoSampling temperature; higher values result in more diverse outputs, lower values result in more stable outputs.
toolsarrayNoList of available tools for the model to use. The model will return a tool_use content block when needed, which you will then execute and refill with tool_result.
tool_choiceobjectNoControl over tool usage: whether to let the model decide, force usage, or specify a particular tool. Must be used in conjunction with tools.
stop_sequencesarrayNoStop generation upon encountering any of the following strings.
top_pnumberNoNucleus sampling, selecting candidates from the top top_p cumulative probabilities. Only one of temperature and nucleus sampling should be used.
top_kintegerNoOnly select from the top k candidates with highest probability.
thinkingobjectNoEnable extended thinking: the model will perform reasoning before generating a response. The reasoning process will be returned as a separate content block and counted toward output usage. Only available for models that support this capability.
metadataobjectNoCustom metadata for your own categorization and retrieval.

Request example

curl https://api.router.ai/v1/messages \
  -H "Authorization: Bearer sk-你的令牌" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m3",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "你好"}]
  }'

Endpoint reference: Create a message (Claude native)