Create chat completion
Generate a response from a conversation.
Authorizations
Modular Cloud API key. Obtain from the API keys page.
Body
Model identifier. See the supported models page.
"minimax/minimax-m3"
The conversation history.
Maximum number of tokens to generate.
Sampling temperature (0–2). Higher values produce more varied output.
0 <= x <= 2Nucleus sampling threshold (0–1). Limits token selection to the smallest set whose cumulative probability reaches this value. Lower values narrow the output distribution.
0 <= x <= 1Adjusts likelihood of tokens based on their frequency in the output so far (-2 to 2). Positive values decrease repetition.
-2 <= x <= 2Adjusts likelihood of tokens based on whether they've already appeared in the output (-2 to 2). Positive values increase topic diversity.
-2 <= x <= 2Up to 4 sequences that signal the model to stop generating. The returned text doesn't include the stop sequence.
Seed for deterministic sampling. Requests with the same seed and parameters return similar results, but determinism isn't guaranteed.
If true, stream partial tokens as server-sent events. Support for tools while streaming is model-dependent; set this to false if you see incomplete or malformed tool-call output.
List of functions the model may call. See the supported models page for a list of models that support tool use (function calling).
Controls when and how the model calls a tool.
none: Disables tool calls.auto(default): Lets the model decide whether to call a tool.required: Forces the model to call at least one tool.- A function object: Forces the model to call the named function.
The following example requires the model to call the get_weather function:
none, auto, required Controls whether the model generates chain-of-thought reasoning before responding. See the supported models page for a list of models that support reasoning.
We also support an equivalent thinking parameter. Use whichever format your client or model expects.
Controls how much reasoning the model performs. Shorthand for reasoning.effort. If both are set, reasoning.effort takes precedence.
See the supported models page for a list of models that support reasoning.
low, medium, high Response
Chat completion response.