You need to enable JavaScript to run this app.
文档中心
火山方舟

火山方舟

复制全文
下载 pdf
图片生成 API
图片生成流式响应事件
复制全文
下载 pdf
图片生成流式响应事件
当请求时设置 stream: true,图片生成 API 会以 Server-Sent Events(SSE)的形式实时推送每张图片的生成结果。本节内容介绍服务器会推送的各类事件。​
说明​
流式输出的示例代码及返回示例,详见 流式输出 教程。​
error​
顶层错误事件 schema —— 当请求整体失败(如缺少必填参数、鉴权失败等)时返回。​
error object | 错误信息​
​
error 响应示例​
​
​
image_generation.completed​
流式响应结束事件 schema,携带本次请求汇总信息。​
created integer | 事件时间​
​
model string | 模型 ID​
​
type string | 事件类型​
​
tools object[] | 工具调用列表​
​
usage object | 用量信息​
​
image_generation.completed 响应示例​
​
​
image_generation.partial_failed​
单张图片生成失败的流式事件 schema。​
created integer | 事件时间​
​
model string | 模型 ID​
​
type string | 事件类型​
​
error object | 错误信息​
​
image_index integer | 图片序号​
​
image_generation.partial_failed 响应示例​
​
​
image_generation.partial_succeeded​
单张图片生成成功的流式事件 schema。​
created integer | 事件时间​
​
model string | 模型 ID​
​
type string | 事件类型​
​
b64_json string | 图片 Base64 数据​
​
image_index integer | 图片序号​
​
size string | 图像尺寸​
​
url string | 图片 URL​
​
image_generation.partial_succeeded 响应示例​
​
​
最近更新时间:2026.09.22 12:13:36
这个页面对您有帮助吗?
有用
有用
无用
无用