Skip to main content
POST

授权

Authorization
string
header
必填

在请求头中传入 Authorization: Bearer <token>

请求体

application/json

BytePlus chat completions 请求体。

model
enum<string>
必填

模型名称。支持的 BytePlus 对话模型包括 dola-seed-2-1-turbo-260628

可用选项:
dola-seed-2-1-turbo-260628
示例:

"dola-seed-2-1-turbo-260628"

messages
object[]
必填

消息列表。当前文档公开 systemuserassistanttool 四种角色。messages[].content 支持纯文本。

Minimum array length: 1
stream
boolean
默认值:true

是否启用流式输出。为 true 时响应内容类型为 text/event-stream

stream_options
object

流式响应附加选项。仅在 stream=true 时生效。

max_completion_tokens
integer

模型回答最大长度,单位 token。

response_format
object

控制回答格式(Beta)。

frequency_penalty
number
默认值:0

频率惩罚。值越高,越抑制重复表达。

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

存在惩罚。值越高,越鼓励模型引入新话题。

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

采样温度。越低越稳定,越高越发散。

必填范围: 0 <= x <= 2
top_p
number
默认值:0.95

核采样参数。通常与 temperature 二选一调优。

必填范围: 0 <= x <= 1
tools
object[]

可供模型调用的函数工具定义列表。

parallel_tool_calls
boolean

是否允许模型并行发起多个工具调用。

tool_choice

工具调用策略。可以是字符串模式,也可以是指定具体函数的对象。

可用选项:
none,
auto,
required

响应

调用成功。非流式模式返回 JSON;流式模式返回 SSE 事件流。

BytePlus chat completions 成功响应。

id
string

响应 ID。

object
string

对象类型,例如 chat.completion

created
integer

Unix 时间戳。

model
string

实际使用的模型名称。

choices
object[]
usage
object

Token 用量统计。