Skip to main content
POST
cURL
使用 POST /v1/images/generationsasync: true 提交 Seedream 图像任务,无需保持 HTTP 连接打开。 此异步工作流适用于以下模型 ID: 如需了解账户可用性,请参阅 模型页面 或查询 /v1/models。有关提供商参数的详细信息,请参阅 BytePlus 图像生成 API 以及 Seedream 4.0-5.0 教程.

提交任务

发送 modelpromptasync: true。示例还请求 2K URL 响应,并指定 watermark: false。不同模型 ID 支持的尺寸各不相同,因此请使用所选模型支持的尺寸。 创建响应会返回 data.task_iddata.status 以及空的 data.data 数组,此时任务处于待处理状态。请保存 data.task_id;不要将顶级响应代码用作任务标识符。

轮询任务

将存储的任务 ID 传递给 检索 Seedream 图像任务。当 data.statuspending 时,继续轮询。当其变为 successfailure 时停止。

读取图像 URL

任务成功后,从解析后的 JSON 中读取 data.data[0].url。在 shell 中,jq -r '.data.data[0].url' 可保留完整 URL 中的特殊字符。请及时下载或传输图像。该 URL 是临时的;本文档不假定其具有固定的有效期。

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

application/json
model
string
必填

Seedream model ID. This async workflow is documented for doubao-seedream-4-0-250828, doubao-seedream-4-5-251128, doubao-seedream-5-0-260128, and seedream-5-0-pro-260628. Query /v1/models or open the Models page for account availability.

示例:

"doubao-seedream-5-0-260128"

prompt
string
必填

Text prompt describing the image to generate.

示例:

"A clean studio photograph of a small red ceramic teapot on a pale blue table, soft window light, no text."

async
boolean
必填

Asynchronous task mode. Set this to true, store data.task_id, and poll the task endpoint.

size
string

Requested output size. Use a value supported by the selected model.

示例:

"2K"

response_format
string

Response workflow for this async request. The example uses url and retrieves the URL from the completed task.

示例:

"url"

watermark
boolean

Whether to request a visible watermark on the generated image.

示例:

false

响应

200 - application/json

Seedream asynchronous task submission response.

code
string
必填

Request status code. A successful submission returns success.

示例:

"success"

message
string
必填

Status message. A successful submission can return an empty string.

data
object
必填
最后修改于 2026年7月31日