对话补全 (Chat)
MiniMax 系列
MiniMax M2 系列对话模型
适用模型
| 模型 | 上下文 | 最大输出 |
|---|---|---|
minimax-m2.7 | 200,000 | 128,000 |
Minimax-M2.5 | 200,000 | 128,000 |
公开协议
使用 OpenAI 兼容的 POST /v1/chat/completions。两个级别共享同一请求结构,支持多轮消息、流式输出和工具调用;模型名大小写必须与模型列表一致。
curl https://api.vibelab.me/v1/chat/completions \
-H "Authorization: Bearer $LOOPTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-m2.7",
"messages": [{"role": "user", "content": "把这段会议记录整理成行动项"}],
"max_tokens": 4096
}'请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | - | 本页适用模型之一,大小写敏感 |
messages | array | 是 | - | 对话消息列表 |
messages[].role | string | 是 | - | system、user、assistant 或 tool |
messages[].content | string | 是 | - | 消息文本 |
stream | boolean | 否 | false | 是否启用 SSE 流式输出 |
max_tokens | integer | 否 | 模型默认 | 最大输出 Token 数 |
temperature | number | 否 | 1 | 采样温度,范围 [0, 2) |
top_p | number | 否 | 1 | 核采样阈值,范围 (0, 1] |
stop | string/array | 否 | - | 停止序列 |
tools | array | 否 | - | 函数工具定义 |
tool_choice | string/object | 否 | auto | 工具调用策略 |
response_format | object | 否 | {"type":"text"} | 输出格式 |
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 请求 ID |
object | string | 对象类型 |
created | integer | Unix 时间戳 |
model | string | 模型名称 |
choices[].index | integer | 候选结果序号 |
choices[].message.role | string | assistant |
choices[].message.content | string/null | 生成文本 |
choices[].message.tool_calls | array | 工具调用列表 |
choices[].finish_reason | string | 停止原因 |
usage.prompt_tokens | integer | 输入 Token 数 |
usage.completion_tokens | integer | 输出 Token 数 |
usage.total_tokens | integer | 总 Token 数 |
{
"id": "chatcmpl_01H...",
"object": "chat.completion",
"created": 1783819200,
"model": "minimax-m2.7",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "行动项:1. 确认需求负责人;2. 周三前完成接口联调。"},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 120, "completion_tokens": 38, "total_tokens": 158}
}错误响应格式及状态码见错误码。