跳转到主要内容
POST
Create Response
推理、函数调用、结构化输出、图片输入和流式输出请使用 Responses API。Chat Completions 支持文本及函数调用。
Responses 包含带有 encrypted_content 的 reasoning 输出项。Chat Completions 可包含 message.reasoning_content;Chat 的 Token 用量请读取 usage.prompt_tokens 和 usage.completion_tokens。

授权

Authorization
string
header
必填

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

请求体

application/json
model
enum<string>
必填

The model to use.

可用选项:
doubao-seed-2.0-pro,
doubao-seed-2.0-code,
doubao-seed-2.0-lite,
doubao-seed-2.0-mini,
doubao-seed-1-6-251015,
glm-4.7
示例:

"doubao-seed-1-6-251015"

input
object[]
必填

Input messages. Each item has role and content. For simple text you can also pass a plain string.

Content array item types:

  • input_text: {"type": "input_text", "text": "..."}
  • input_image: {"type": "input_image", "image_url": "https://..."}
  • input_video: {"type": "input_video", "video_url": "https://...", "fps": 1}
  • input_file: {"type": "input_file", "file_url": "https://..."}
示例:
stream
boolean
默认值:false

If true, stream partial response deltas using SSE.

temperature
number
默认值:1

Sampling temperature.

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

1

top_p
number

Nucleus sampling threshold.

必填范围: 0 <= x <= 1
max_output_tokens
integer

Maximum number of output tokens.

必填范围: x >= 1
reasoning
object

Configuration for reasoning. Example: {"effort": "high"}.

响应

Response generated successfully

id
string
示例:

"resp_021774236829912"

object
string
示例:

"response"

created_at
integer
completed_at
integer
model
string
示例:

"doubao-seed-1-6-251015"

status
enum<string>
可用选项:
completed,
failed,
in_progress,
incomplete
示例:

"completed"

output
object[]
usage
object