MaaS_MiniMax_M2.5/2.7
模型名称 MiniMax-M2.5/M2.7
上下文窗口 204,800
模型介绍 顶尖性能与极致性价比,轻松驾驭复杂任务(输出速度约 60 TPS)
模型名称 MiniMax-M2.5-highspeed/MiniMax-M2.7-highspeed
上下文窗口 204,800
模型介绍 M2.5 极速版:效果不变,更快,更敏捷(输出速度约 100 TPS)
请求协议
Https
请求Header
| 参数名 | 值 |
|---|---|
| Authorization | Bearer |
| Content-Type | multipart/form-data |
参数
核心参数
| 属性名 | 类型 | 必需/可选 | 描述 |
|---|---|---|---|
| model | string | 必需 | 模型名称。 |
| messages | array | 必需 | 对话消息列表,包含对话历史。支持基础角色(system、user、assistant)和高级角色(user_system、group、sample_message_user、sample_message_ai)。 |
| temperature | number | 可选 | 温度系数,控制输出随机性,取值范围 (0, 1]。值越高输出越随机,值越低输出越确定,默认值为 1.0。 |
| top_p | number | 可选 | 核采样策略,控制输出多样性,取值范围 (0, 1]。值越小输出越保守。 |
| max_tokens / max_completion_tokens | integer | 可选 | 生成内容的最大 token 数,上限为 2048。建议合理设置此值,避免输出被截断。 |
| stream | boolean | 可选 | 是否使用流式传输,默认 false。设置为 true 后响应将分批返回。 |
高级功能参数
| 属性名 | 类型 | 必需/可选 | 描述 |
|---|---|---|---|
| stop | string/array | 可选 | 最多 4 个停止序列,API 遇到这些序列时将停止生成 token。 |
| n | integer | 可选 | 为每条输入消息生成的聊天补全选项数量。MiniMax目前只支持 n = 1。 |
| frequency_penalty | number | 可选 | 频率惩罚,取值范围 -2.0 到 2.0。正值会惩罚已经频繁出现的 token,降低模型重复语句的概率。 |
| presence_penalty | number | 可选 | 存在惩罚,取值范围 -2.0 到 2.0。正值会惩罚已经出现过的 token,鼓励模型探索新主题。 |
| response_format | object | 可选 | 指定模型输出格式。设置 {"type": "json_object"} 可启用 JSON 模式。 |
| seed | integer | 可选 | 用于确定性采样的种子。相同种子和参数下,系统会尽力返回相同结果。 |
| tool_choice | string/object | 可选 | 控制模型是否调用工具。可选值:"none"(不调用)、"auto"(自动选择)、"required"(必须调用)或指定具体函数。 |
| tools | array | 可选 | 模型可调用的工具列表,目前仅支持 function 类型。 |
| mask_sensitive_info | boolean | 可选 | 是否对输出中的敏感信息进行脱敏,默认 true。 |
| user | string | 可选 | 终端用户的唯一标识,用于监控和滥用检测。 |
特殊角色参数(messages 数组中可用)
| 属性名 | 类型 | 必需/可选 | 描述 |
|---|---|---|---|
| role | string | 必需 | 角色类型。基础角色:system(设定模型角色)、user(用户输入)、assistant(模型回复)。高级角色:user_system(设定用户人设)、group(对话分组)、sample_message_user(示例用户输入)、sample_message_ai(示例模型输出)。 |
| name | string | 可选 | 消息发送者的名称标识,用于区分对话中的不同参与者。 |
| content | string | 条件必需 | 消息的文本内容。对于普通对话消息为必需字段,对于示例对话(sample_message_user/sample_message_ai)为必需字段。 |
/chat/completions请求示例
curl --location --request POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions' \
--header 'Authorization: Bearer {YOUR AK}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "MiniMax-M2.5",
"reasoning_split": true,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "what is elephent?"
}
]
}
]
}'
返回示例
{
"id": "chatcmpl-wY8FIAgqKvdcHBAZsSL3n2H1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Elephants are mammals belonging to the family Elephantidae. They are the largest land animals, mainly divided into two genera: Loxodonta (African elephants) and Elephas (Asian elephants). Elephants are known for their enormous size, long trunk, and large ears. They live in a variety of habitats such as grasslands, forests, and swamps, and are herbivores, feeding on grasses, leaves, bark, fruits, and more. Elephants are highly social animals, typically living in groups, and have complex social structures and communication methods.
",
"reasoning_details": [
{
"type": "reasoning.text",
"text": "<answer>\nElephants are mammals belonging to the family Elephantidae. They are the largest land animals, mainly divided into two genera: Loxodonta (African elephants) and Elephas (Asian elephants). Elephants are known for their enormous size, long trunk, and large ears. They live in a variety of habitats such as grasslands, forests, and swamps, and are herbivores, feeding on grasses, leaves, bark, fruits, and more. Elephants are highly social animals, typically living in groups, and have complex social structures and communication methods\n</answer>\n",
"signature": null
}
]
},
"finish_reason": "stop",
"native_finish_reason": "stop"
}
],
"created": 1779174874,
"model": "MaaS_Minimax_M2.7_20260318",
"object": "chat.completion",
"usage": {
"prompt_tokens": 46,
"completion_tokens": 203,
"total_tokens": 249,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0,
"reasoning_tokens": 172,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 35,
"image_tokens": 0
}
}
}
文本对话(OpenAI API 兼容)
请求示例
curl --request POST \
--url https://{新平台域名}/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MaaS_Minimax_M2.7_20260318",
"messages": [
{
"role": "system",
"name": "MiniMax AI"
},
{
"role": "user",
"content": "hello",
"name": "user"
}
]
}
'
返回示例
{
"id": "chatcmpl-Sfq4bWiUnaarkHytvNwBcrRw",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! Is there anything I can help you with?"
},
"finish_reason": "stop",
"native_finish_reason": "stop"
}
],
"created": 1779175080,
"model": "MaaS_Minimax_M2.7_20260318",
"object": "chat.completion",
"usage": {
"prompt_tokens": 43,
"completion_tokens": 29,
"total_tokens": 72,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0,
"reasoning_tokens": 33,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 35,
"image_tokens": 0
}
}
}