Skip to main content
POST
对话补全

Authorizations

Authorization
string
header
required

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

Body

application/json
model
enum<string>
required

模型 ID

Available options:
grok-3-mini
Example:

"grok-3-mini"

messages
object[]
required

对话消息列表。

Minimum array length: 1
Example:
max_tokens
integer

生成的最大 token 数。

Required range: x >= 1
temperature
number
default:1

采样温度。

Required range: 0 <= x <= 2
top_p
number

核采样参数。

Required range: 0 <= x <= 1
stream
boolean
default:false

是否通过 SSE 流式返回。

Response

对话补全创建成功

id
string
object
string
Example:

"chat.completion"

created
integer
model
string
Example:

"grok-3-mini"

choices
object[]
usage
object