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

使用的模型。

Available options:
doubao-seed-2.0-pro,
doubao-seed-2.0-code,
doubao-seed-2.0-lite,
doubao-seed-2.0-mini,
doubao-seed-1-8-251228,
doubao-seed-1-6-flash-250828,
doubao-seed-1-6-251015,
doubao-seed-1-6-lite-251015,
doubao-seed-1-6-vision-250815,
glm-4.7
Example:

"doubao-seed-1-6-251015"

messages
object[]
required

对话消息列表,每条包含 rolecontent

content 数组项类型:

  • text{"type": "text", "text": "..."}
  • image_url{"type": "image_url", "image_url": {"url": "https://..."}}
  • video_url{"type": "video_url", "video_url": {"url": "https://...", "fps": 2}}
Minimum array length: 1
Example:
max_tokens
integer

生成的最大 token 数。

Required range: x >= 1
Example:

1024

temperature
number
default:1

采样温度。

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

核采样参数。

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

是否通过 SSE 流式返回。

stop
string[]

最多 4 个停止序列。

Response

对话补全创建成功

id
string
Example:

"chatcmpl-abc123"

object
string
Example:

"chat.completion"

created
integer
Example:

1774236644

model
string
Example:

"doubao-seed-1-6-251015"

choices
object[]
usage
object