跳至正文
EN

Seedream API 接入文档

使用 VezAPI 密钥接入 Seedream。下列操作共用同一个账号余额和鉴权方式。

服务地址: https://api.vezapi.com
请求头使用 Authorization: Bearer YOUR_VEZAPI_KEY。每次提交使用唯一的 Idempotency-Key,查询同一笔提交时才复用。

Seedream 图片生成

POST/api/v1/jobs/createTask

模型标识: bytedance/seedream

参数类型说明与限制
model
必填
string

必填的模型标识,使用下方列出的固定值。

可选值:"bytedance/seedream"

默认:"bytedance/seedream"

callBackUrl
可选
string

接收任务完成通知的 HTTPS 回调地址,可选,建议在生产环境中设置。任务完成后会发送包含状态与结果的 POST JSON 请求;也可使用任务查询接口轮询。回调验签见 VezAPI 回调文档。

input
可选
object

生成任务的输入参数。

input.prompt
必填
string

用于描述生成图片的文本提示词,最多 5000 个字符。

maxLength: 5000

input.image_size
可选
string

输出尺寸预设:square 为正方形,square_hd 为高清正方形,portrait_4_3、portrait_16_9 为竖图,landscape_4_3、landscape_16_9 为横图。

可选值:"square", "square_hd", "portrait_4_3", "portrait_16_9", "landscape_4_3", "landscape_16_9"

默认:"square_hd"

input.guidance_scale
可选
number

控制图片与提示词的相关程度,数值越高越贴近提示词。范围为 1–10,步长 0.1。

默认:2.5

minimum: 1

maximum: 10

input.seed
可选
integer

控制图片生成随机性的种子值。

请求示例
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "bytedance/seedream",
  "input": {
    "prompt": "A 2D flat art style campsite poster with the text “Kie AI Seedream 3.0 API”. The scene includes mountains, brown tents under a sunny sky, a rabbit, a deer, some birds, green grass, and a flowing river, all illustrated in clean vector art."
  }
}'
返回值与错误

HTTP 200

参数类型说明与限制
code
可选
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

可选值:200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
可选
string

Response message, error description upon failure

data
必填
object
data.taskId
必填
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

HTTP 500

响应字段与业务状态码。

参数类型说明与限制
code
必填
integer

业务状态码:200 请求成功;401 鉴权凭据缺失或无效;402 积分不足;404 资源或接口不存在;408 超过 10 分钟未返回结果;422 参数校验失败;429 请求频率超限;455 系统维护;500 处理请求时发生内部错误;501 内容生成失败;505 功能当前关闭。

msg
必填
string

响应消息;失败时说明错误原因。

data
必填
object

任务状态与回调

异步任务请保存返回的 taskId。调用 GET /api/v1/jobs/recordInfo?taskId=... 查询,或在创建时设置 callBackUrl。只有任务所属账号可以查询任务或基于任务创建派生资源。

超时可能表示请求已经受理。请在控制台查看原请求,不要自动新建任务。回调可能重试并重复到达,请使用 X-VezAPI-Event-Id 去重。

文件、日志与计费

生成媒体通常随上游保留 14 天,上传文件在 24 小时后失效。请在过期前保存所需文件。VezAPI 仅流式转发已登记资源,不提供永久作品库。请求日志保留两个自然月。

调用前预留积分,最终按实际优惠扣分 1:1 结算。用量不明时暂停新付费请求。若保护其他任务预留后余额不足以结算,会保留待结算记录,补足余额后再扣费;模型用量不会将钱包扣成负数。按时长计价的输入文件由服务端读取时长,读取失败时不提交模型任务。