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

可用选项:
grok-3
示例:

"grok-3"

messages
object[]
必填

对话消息列表。

Minimum array length: 1
示例:
max_tokens
integer

生成的最大 token 数。

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

采样温度。

必填范围: 0 <= x <= 2
top_p
number

核采样参数。

必填范围: 0 <= x <= 1
stream
boolean
默认值:false

是否通过 SSE 流式返回。

响应

对话补全创建成功

id
string
object
string
示例:

"chat.completion"

created
integer
model
string
示例:

"grok-3"

choices
object[]
usage
object