Skip to main content
POST
对话补全

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
enum<string>
必填

模型 ID

可用选项:
MiniMax-M2.7
示例:

"MiniMax-M2.7"

messages
object[]
必填

对话消息数组。

Minimum array length: 1
示例:
max_tokens
integer

最大生成 Token 数。

必填范围: 1 <= x <= 204800
temperature
number
默认值:1

采样温度。较高的值会使输出更加随机。

必填范围: 0 <= x <= 2
示例:

1

top_p
number
默认值:0.9

核采样阈值。

必填范围: 0 <= x <= 1
frequency_penalty
number
默认值:0

根据已有文本中 Token 的出现频率进行惩罚。

必填范围: -2 <= x <= 2
presence_penalty
number
默认值:0

对已出现的 Token 进行惩罚。

必填范围: -2 <= x <= 2
stream
boolean
默认值:false

开启后通过 SSE 流式传输部分消息增量。

stop

触发停止生成 further tokens 的序列。

tools
object[]

工具/函数定义,用于智能体工作流。

tool_choice
any

工具选择策略。

响应

补全生成成功

id
string
必填
示例:

"chatcmpl-abc123"

object
string
必填
示例:

"chat.completion"

created
integer
必填

Unix 时间戳

model
string
必填
示例:

"MiniMax/MiniMax-M2.7"

choices
object[]
必填
usage
object