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

可用选项:
claude-fable-5
示例:

"claude-fable-5"

messages
object[]
必填

组成对话的消息列表。

Minimum array length: 1
示例:
max_tokens
integer
默认值:8192

最大生成 Token 数。

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

采样温度。值越高输出越随机。

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

1

frequency_penalty
number
默认值:0

根据文本中已有的频率惩罚重复 Token。

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

惩罚已出现过的 Token。

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

设为 true 则通过 SSE 流式返回部分消息。

stop

触发模型停止生成后续 Token 的序列。

响应

补全生成成功

id
string
必填
示例:

"chatcmpl-abc123"

object
string
必填
示例:

"chat.completion"

created
integer
必填

Unix 时间戳

model
string
必填
示例:

"claude-fable-5"

choices
object[]
必填
usage
object