switch_heading
Seedream 5 Pro
/v1/images图片生成 API
使用 Seedream 5 Pro 文生图,或编辑最多十张参考图。对外只提供稳定模型别名、可预测的产品计费和与供应商无关的任务响应。
模型别名
seedream-5-pro
输入模式
文本或参考图
基础价格
9 / 18 credits
快速开始
创建任务并保存 task ID,然后轮询状态接口,直到任务进入 SUCCESS 或 FAILED。
bash
| 1 | curl -X POST 'https://seedanceapi.org/v1/images/generations' \ |
| 2 | -H 'Authorization: Bearer YOUR_API_KEY' \ |
| 3 | -H 'Content-Type: application/json' \ |
| 4 | -d '{ |
| 5 | "model": "seedream-5-pro", |
| 6 | "prompt": "A cinematic product photo on a reflective surface", |
| 7 | "aspect_ratio": "1:1", |
| 8 | "resolution": "1k", |
| 9 | "image_urls": [] |
| 10 | }' |
请求生命周期
- 01
身份验证
在 Bearer Authorization 请求头中使用现有 Seedance API Key。
- 02
创建任务
发送创建请求,并保存接口返回的 task ID。
- 03
轮询结果
使用 task ID 查询;成功图片最终返回自有 CDN 地址。
身份验证
所有图片接口均使用现有 Seedance API Key,内部供应商凭据不会对外暴露。
http
| 1 | Authorization: Bearer YOUR_API_KEY |
| 2 | Content-Type: application/json |
计费
价格绑定公开产品,不随供应商路由变化。创建响应返回 estimated_credits,成功状态返回 consumed_credits。
| 分辨率 | 基础费用 | 额外参考图 |
|---|---|---|
| 1K | 9 credits | 从第 2 张起,每张 +0.8 credits |
| 2K | 18 credits | 从第 2 张起,每张 +0.8 credits |
接口
POST
/v1/images/generationsimage_urls 为空时执行文生图;传入一至十个 URL 时执行参考图编辑。
Body ParametersJSON
model:string
必须为 seedream-5-pro。
prompt:string
图片描述或编辑指令,最多 3000 个字符。
aspect_ratio:optional string
可选 1:1、4:3、3:4、16:9、9:16、2:3 或 3:2。 Defaults to 1:1.
resolution:optional string
使用 1k 或 2k。 Defaults to 1k.
image_urls:optional string[]
0 至 10 个公网 HTTPS 图片 URL;为空时执行文生图。
文生图请求
json
| 1 | { |
| 2 | "model": "seedream-5-pro", |
| 3 | "prompt": "A cinematic product photo on a reflective surface", |
| 4 | "aspect_ratio": "1:1", |
| 5 | "resolution": "1k", |
| 6 | "image_urls": [] |
| 7 | } |
参考图编辑请求
json
| 1 | { |
| 2 | "model": "seedream-5-pro", |
| 3 | "prompt": "Place this product in a minimal studio scene", |
| 4 | "aspect_ratio": "4:3", |
| 5 | "resolution": "2k", |
| 6 | "image_urls": [ |
| 7 | "https://cdn.example.com/reference.png" |
| 8 | ] |
| 9 | } |
HTTP 202
json
| 1 | { |
| 2 | "task_id": "n30c6f2...seed", |
| 3 | "status": "IN_PROGRESS", |
| 4 | "model": "seedream-5-pro", |
| 5 | "estimated_credits": 9 |
| 6 | } |
GET
/v1/images/generations/:task_id使用创建接口返回的 task ID 查询最新任务状态。
bash
| 1 | curl 'https://seedanceapi.org/v1/images/generations/n30c6f2...seed' \ |
| 2 | -H 'Authorization: Bearer YOUR_API_KEY' |
SUCCESS
json
| 1 | { |
| 2 | "task_id": "n30c6f2...seed", |
| 3 | "status": "SUCCESS", |
| 4 | "model": "seedream-5-pro", |
| 5 | "images": [ |
| 6 | { "url": "https://cdn44.gogloai.com/results/image.png" } |
| 7 | ], |
| 8 | "consumed_credits": 9, |
| 9 | "created_at": "2026-07-13 10:00:00" |
| 10 | } |
FAILED
json
| 1 | { |
| 2 | "task_id": "n30c6f2...seed", |
| 3 | "status": "FAILED", |
| 4 | "model": "seedream-5-pro", |
| 5 | "consumed_credits": 0, |
| 6 | "error": { |
| 7 | "code": "GENERATION_FAILED", |
| 8 | "message": "Image generation failed." |
| 9 | } |
| 10 | } |
错误码
| HTTP | Code | 说明 |
|---|---|---|
| 400 | INVALID_* | JSON、模型、提示词、比例、分辨率、URL 或图片数量无效。 |
| 401 | INVALID_API_KEY | Bearer API Key 缺失或无效。 |
| 402 | INSUFFICIENT_CREDITS | API Key 积分不足。 |
| 404 | TASK_NOT_FOUND | 任务不存在。 |
| 502 / 503 | UPSTREAM_* | 上游图片服务暂时不可用或拒绝创建任务。 |