Skip to main content
POST
/
v1
/
text
/
chatcompletion_v2
curl --request POST \
--url https://api.minimax.io/v1/text/chatcompletion_v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '{
"model": "MiniMax-M1",
"messages": [
{
"role": "system",
"name": "MiniMax AI"
},
{
"role": "user",
"name": "user",
"content": "hello"
}
]
}'
{
"id": "04ecb5d9b1921ae0fb0e8da9017a5474",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! How can I assist you?",
"role": "assistant",
"name": "MiniMax AI",
"audio_content": "",
"reasoning_content": "...omitted"
}
}
],
"created": 1755153113,
"model": "MiniMax-M1",
"object": "chat.completion",
"usage": {
"total_tokens": 249,
"total_characters": 0,
"prompt_tokens": 26,
"completion_tokens": 223,
"completion_tokens_details": {
"reasoning_tokens": 214
}
},
"input_sensitive": false,
"output_sensitive": false,
"input_sensitive_type": 0,
"output_sensitive_type": 0,
"output_sensitive_int": 0,
"base_resp": {
"status_code": 0,
"status_msg": ""
}
}

Authorizations

Authorization
string
header
required

HTTP: Bearer Auth

Headers

Content-Type
enum<string>
default:application/json
required

The media type of the request body. Must be set to application/json to ensure the data is sent in JSON format.

Available options:
application/json

Body

application/json
model
enum<string>
required

Model ID. Options: MiniMax-M2, MiniMax-M1, MiniMax-Text-01. MiniMax-M2 and MiniMax-M1 are reasoning models, recommended with streaming output for best performance.

Available options:
MiniMax-M2,
MiniMax-M1,
MiniMax-Text-01
messages
object[]
required

List of messages containing conversation history

stream
boolean
default:false

Whether to enable streaming. Defaults to false. If true, the response will be returned in multiple chunks.

max_tokens
integer
deprecated

Deprecated in favor of max_completion_tokens.

Maximum number of tokens allowed in the generated output. Content beyond this limit will be truncated. If the generation is cut off due to length limits, consider increasing this value.

Default:

  • MiniMax-M2: 10240
  • MiniMax-M1: 8192
  • MiniMax-Text-01: 2048
Required range: x >= 1
max_completion_tokens
integer

Maximum number of tokens allowed in the generated output. Content beyond this limit will be truncated. If the generation is cut off due to length limits, consider increasing this value.

Default:

  • MiniMax-M2: 10240
  • MiniMax-M1: 8192
  • MiniMax-Text-01: 2048
Required range: x >= 1
temperature
number

Controls randomness of the output. Range: (0, 1]. Higher values will make the output more random, while lower values will make it more focused and deterministic.

Default values:

  • MiniMax-M2: recommended 1.0 -MiniMax-M1: 1.0 (recommended range [0.8, 1.0])
  • MiniMax-Text-01: 0.1 (can be raised to 0.7–1.0 for creative tasks).
Required range: 0 < x <= 1
top_p
number
default:0.95

Sampling strategy that affects output diversity. Range: (0, 1]

  • MiniMax-M2 recommended 0.95
Required range: 0 < x <= 1
tool_choice
enum<string>
default:auto

Controls how the model uses tools:

  • none: never call tools
  • auto: decide automatically (default)
Available options:
none,
auto
tools
object[]

List of tools available for the model to call. For more details, see MiniMax-M2 Function Calling Guide

response_format
object

Specifies the output format (only supported by MiniMax-Text-01). Example: { "type": "json_schema", "json_schema": {...} }

stream_options
object

Options for streaming mode.

mask_sensitive_info
boolean
default:false

Mask (replace with ***) content in the output that involves private information, including but not limited to email, domain, link, ID number, home address, etc.

Defaults false.

Response

id
string

Unique ID of this response.

choices
object[]

List of response choices.

created
integer

Unix timestamp (seconds) when the response was created.

model
string

Model ID used for this request.

object
enum<string>

Object type:

  • chat.completion: non-streaming
  • chat.completion.chunk: streaming
Available options:
chat.completion,
chat.completion.chunk
usage
object

Token usage statistics for this request.

input_sensitive
boolean

Whether the input contained sensitive content. See input_sensitive_type for details on the type of sensitive content.

input_sensitive_type
integer

Type of sensitive content in input. Possible values:

1: severe violation 2: pornography 3: advertising 4: prohibited 5: abusive 6: terrorism/violence 7: other

output_sensitive
boolean

Whether the output contained sensitive content.

output_sensitive_type
integer

Type of sensitive content in output.

base_resp
object

Error status codes and details.