curl --request POST \
--url https://api.minimax.cn/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "MiniMax-M3.1-Flash-Preview",
"thinking": {
"type": "adaptive"
},
"messages": [
{
"role": "user",
"content": "9.11 和 9.9 哪个更大?"
}
],
"max_completion_tokens": 500,
"reasoning_effort": "max"
}
'{
"id": "066b36619b147e326d17053cccdef70f",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "**9.9 更大。**\n\n比较方法很简单:把小数位数对齐:\n\n- 9.11 = 9.11\n- 9.90 = 9.9\n\n整数部分都是 9,所以比较小数部分:90 > 11,因此 **9.9 > 9.11**。\n\n---\n\n这是一个经典的小数比较问题,容易被混淆的原因在于:如果按**字符串**逐字符比较,\"9.9\"中的 '9' 会大于 \"9.11\"中的 '1',从而得出相反的结论。但在**数值**上,9.9 = 9.90 显然大于 9.11。",
"reasoning_content": "The user is asking which is larger: 9.11 or 9.9.\n\nLet me compare these two numbers:\n- 9.11\n- 9.9 = 9.90\n\nComparing 9.11 and 9.90:\n- The integer parts are both 9.\n- Compare the decimal parts: 11 vs 90 (treating as cents: 0.11 vs 0.90)\n- 90 > 11, so 9.9 > 9.11\n\nThis is actually a famous question that is sometimes used to trick people who might confuse string comparison with numerical comparison (since \"9.11\" > \"9.9\" as strings, but numerically 9.9 > 9.11).\n\nThe answer is straightforward: 9.9 is larger.",
"role": "assistant",
"name": "MiniMax AI",
"audio_content": ""
}
}
],
"created": 1780220769,
"model": "MiniMax-M3.1-Flash-Preview",
"object": "chat.completion",
"usage": {
"total_tokens": 473,
"total_characters": 0,
"prompt_tokens": 170,
"completion_tokens": 303,
"prompt_tokens_details": {
"cached_tokens": 157
}
},
"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": ""
}
}Chat Completions API
使用 OpenAI API 兼容 Chat Completions 格式调用 MiniMax 模型。
curl --request POST \
--url https://api.minimax.cn/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "MiniMax-M3.1-Flash-Preview",
"thinking": {
"type": "adaptive"
},
"messages": [
{
"role": "user",
"content": "9.11 和 9.9 哪个更大?"
}
],
"max_completion_tokens": 500,
"reasoning_effort": "max"
}
'{
"id": "066b36619b147e326d17053cccdef70f",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "**9.9 更大。**\n\n比较方法很简单:把小数位数对齐:\n\n- 9.11 = 9.11\n- 9.90 = 9.9\n\n整数部分都是 9,所以比较小数部分:90 > 11,因此 **9.9 > 9.11**。\n\n---\n\n这是一个经典的小数比较问题,容易被混淆的原因在于:如果按**字符串**逐字符比较,\"9.9\"中的 '9' 会大于 \"9.11\"中的 '1',从而得出相反的结论。但在**数值**上,9.9 = 9.90 显然大于 9.11。",
"reasoning_content": "The user is asking which is larger: 9.11 or 9.9.\n\nLet me compare these two numbers:\n- 9.11\n- 9.9 = 9.90\n\nComparing 9.11 and 9.90:\n- The integer parts are both 9.\n- Compare the decimal parts: 11 vs 90 (treating as cents: 0.11 vs 0.90)\n- 90 > 11, so 9.9 > 9.11\n\nThis is actually a famous question that is sometimes used to trick people who might confuse string comparison with numerical comparison (since \"9.11\" > \"9.9\" as strings, but numerically 9.9 > 9.11).\n\nThe answer is straightforward: 9.9 is larger.",
"role": "assistant",
"name": "MiniMax AI",
"audio_content": ""
}
}
],
"created": 1780220769,
"model": "MiniMax-M3.1-Flash-Preview",
"object": "chat.completion",
"usage": {
"total_tokens": 473,
"total_characters": 0,
"prompt_tokens": 170,
"completion_tokens": 303,
"prompt_tokens_details": {
"cached_tokens": 157
}
},
"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": ""
}
}MiniMax-M3.1-Flash-Preview核心能力:1M 超长上下文、多模态、思考深度可调。暂时仅通过 Token Plan 和 MiniMax Code 提供。MiniMax-M3.1-Flash-Preview 新特性:- 支持图片、视频理解,可参考右方示例代码
- 支持通过
reasoning_effort调节思考深度,可取low、medium、high、xhigh、max,默认档位为max - 深度思考默认开启,无需额外配置;思考内容通过
reasoning_content字段单独返回
授权
请求头
请求体的媒介类型,请设置为 application/json,确保请求数据的格式为 JSON
application/json 请求体
模型 ID
MiniMax-M3.1-Flash-Preview, MiniMax-M3, MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed, MiniMax-M2.1, MiniMax-M2.1-highspeed, MiniMax-M2 包含对话历史的消息列表。支持文本、图片、视频和工具调用。
Show child attributes
Show child attributes
控制 thinking 行为。adaptive 这个默认值对所有模型都生效,差异只在 disabled 的效果上。
MiniMax-M3.1-Flash-Preview:强制开启 thinking。传入disabled会返回 HTTP 400。如需调节思考深度,请使用reasoning_effort。MiniMax-M3:默认开启 adaptive thinking;传入disabled会跳过 thinking 直接回答。- M2.x 模型:thinking 无法关闭,传入
disabled会被接收但不生效。
Show child attributes
Show child attributes
调节思考深度。仅 MiniMax-M3.1-Flash-Preview 支持真正的思考深度调节,其他模型会忽略该字段。省略时,该模型的默认思考深度为 max。由于 MiniMax-M3.1-Flash-Preview 强制开启 thinking,不接受 none,传入会返回 HTTP 400。
low, medium, high, xhigh, max 输出格式开关。为 true 时将 thinking 内容拆分到 reasoning_content 字段;为 false 时 thinking 以 <think> 标签保留在 content 字段内。MiniMax-M3.1-Flash-Preview 暂不支持将该参数设为 false。该参数不会开启或关闭 thinking。
是否使用流式传输,默认为 false。设置为 true 后,响应将分批返回。
流式响应选项。
Show child attributes
Show child attributes
指定生成内容长度的上限(Token 数)。MiniMax-M3.1-Flash-Preview 和 MiniMax-M3 推荐值为 131072(128K),上限为 524288(512K);其他模型推荐值为 65536(64K),上限为 204800(200K)。如果生成因 length 原因中断,请尝试调高此值。
x >= 1温度系数,影响输出随机性,取值范围 [0, 2],默认值为 1。值越高,输出越随机;值越低,输出越确定。
0 <= x <= 2核采样参数,取值范围 [0, 1]。MiniMax-M3.1-Flash-Preview 和 MiniMax-M3 默认值为 0.95,M2.x 系列模型默认值为 0.9。
0 <= x <= 1工具定义列表,当前支持 function 工具。
Show child attributes
Show child attributes
旧版生成长度限制参数。已弃用,请改用 max_completion_tokens。
x >= 1响应
本次响应的唯一 ID
响应选择列表
Show child attributes
Show child attributes
响应创建的 Unix 时间戳(秒)
本次请求使用的模型 ID
对象类型。非流式为 chat.completion,流式为 chat.completion.chunk
chat.completion, chat.completion.chunk 本次请求的 Token 使用情况统计
Show child attributes
Show child attributes
输入内容是否命中敏感词。如果输入内容严重违规,接口会返回内容违规错误信息,回复内容为空
输入命中敏感词类型,当input_sensitive为true时返回。取值为以下其一:1 严重违规;2 色情;3 广告;4 违禁;5 谩骂;6 暴恐;7 其他
输出内容是否命中敏感词。如果输出内容严重违规,接口会返回内容违规错误信息,回复内容为空
输出命中敏感词类型
错误状态码和详情
Show child attributes
Show child attributes
此页面对您有帮助吗?