curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-fast",
"prompt": "海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-quality",
"prompt": "女孩在樱花树下旋转,花瓣随风飘落",
"duration": 5,
"aspect_ratio": "9:16",
"resolution": "1080p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-quality",
"prompt": "画面从白天逐渐过渡到夜晚,城市灯光逐渐亮起",
"duration": 5,
"image_with_roles": [
{"url": "https://example.com/day.png", "role": "first_frame"},
{"url": "https://example.com/night.png", "role": "last_frame"}
]
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedance-1-0-pro-fast",
"prompt": "海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"状态: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedance-1-0-pro-fast',
prompt: '海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩',
duration: 5,
aspect_ratio: '16:9',
resolution: '720p'
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`状态: ${task.status}`);
{
"id": "task_vid_xyz789ghi012",
"object": "generation.task",
"model": "doubao-seedance-1-0-pro-fast",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}
doubao-seedance-1-0-pro
Doubao SeeDance 视频生成
使用字节跳动豆包 Doubao SeeDance 模型生成视频
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-fast",
"prompt": "海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-quality",
"prompt": "女孩在樱花树下旋转,花瓣随风飘落",
"duration": 5,
"aspect_ratio": "9:16",
"resolution": "1080p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-quality",
"prompt": "画面从白天逐渐过渡到夜晚,城市灯光逐渐亮起",
"duration": 5,
"image_with_roles": [
{"url": "https://example.com/day.png", "role": "first_frame"},
{"url": "https://example.com/night.png", "role": "last_frame"}
]
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedance-1-0-pro-fast",
"prompt": "海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"状态: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedance-1-0-pro-fast',
prompt: '海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩',
duration: 5,
aspect_ratio: '16:9',
resolution: '720p'
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`状态: ${task.status}`);
{
"id": "task_vid_xyz789ghi012",
"object": "generation.task",
"model": "doubao-seedance-1-0-pro-fast",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}
国内用户请注意: 中国大陆用户请使用
https://toapis.cn 作为接口地址(Base URL)。文档示例中的 https://toapis.com 请替换为 https://toapis.cn。- 字节跳动豆包视频生成模型
- 通过 model 参数选择
doubao-seedance-1-0-pro-fast或doubao-seedance-1-0-pro-quality模型 - 支持文本到视频生成
- 支持首帧/尾帧/参考图控制
- 异步任务管理,通过任务 ID 查询结果
重要变更:为了更好的性能和成本控制,我们不再支持在
image_urls 中直接传入 base64 图片数据。请先使用 上传图片接口 上传图片,获取 URL 后再调用本接口。Authorizations
string
必填
所有接口均需要使用 Bearer Token 进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
Body
string
默认值:"doubao-seedance-1-0-pro-fast"
必填
视频生成模型名称可用模型:
doubao-seedance-1-0-pro-fast- 快速版(40-90 秒生成)doubao-seedance-1-0-pro-quality- 高质量版(90-300 秒生成)
string
必填
视频内容描述详细描述场景、动作、风格以获得更好的生成效果示例:
"海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩"integer
默认值:5
视频时长(秒)支持范围:
2 ~ 12 秒默认:5string
默认值:"16:9"
视频宽高比可选项:
16:9- 横屏9:16- 竖屏1:1- 方形4:3- 传统比例3:4- 竖向传统比例21:9- 超宽屏
16:9string
默认值:"720p"
视频分辨率可选项:
480p- 标清720p- 高清1080p- 全高清
720p1080p 限制:使用参考图(image_with_roles 中 role: reference)时,不支持 1080p 分辨率分辨率与宽高比组合
| 分辨率 | 支持的宽高比 | 备注 |
|---|---|---|
| 480p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | 全部支持 |
| 720p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | 全部支持 |
| 1080p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | 不支持参考图 |
string[]
首帧图像 URL 数组,用于图生视频⚠️ 仅支持 URL 格式(不再支持 base64)
- 公开可访问的图像 URL(http:// 或 https://)
- 可使用 上传图片接口 上传本地图片获取 URL
["https://example.com/cat.png"]image_urls 和 image_with_roles 不能同时使用array
带角色的图像数组,用于更精确的控制
示例:
显示 字段说明
显示 字段说明
[
{"url": "https://example.com/start.png", "role": "first_frame"},
{"url": "https://example.com/end.png", "role": "last_frame"}
]
image_urls和image_with_roles不能同时使用- 每种角色的图片仅支持上传一张
last_frame(尾帧图)仅doubao-seedance-1-0-pro-quality版本支持,fast 版本不支持首尾帧同时使用
Response
string
任务唯一标识符,用于查询任务状态
string
对象类型,固定为
generation.taskstring
使用的模型名称
string
任务状态
queued- 排队等待处理in_progress- 处理中completed- 成功完成failed- 失败
integer
任务进度百分比(0-100)
integer
任务创建时间戳(Unix 时间戳)
object
任务元数据
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-fast",
"prompt": "海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-quality",
"prompt": "女孩在樱花树下旋转,花瓣随风飘落",
"duration": 5,
"aspect_ratio": "9:16",
"resolution": "1080p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-1-0-pro-quality",
"prompt": "画面从白天逐渐过渡到夜晚,城市灯光逐渐亮起",
"duration": 5,
"image_with_roles": [
{"url": "https://example.com/day.png", "role": "first_frame"},
{"url": "https://example.com/night.png", "role": "last_frame"}
]
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedance-1-0-pro-fast",
"prompt": "海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"状态: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedance-1-0-pro-fast',
prompt: '海滩日落,金色阳光照在海面上,海浪轻轻拍打沙滩',
duration: 5,
aspect_ratio: '16:9',
resolution: '720p'
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`状态: ${task.status}`);
{
"id": "task_vid_xyz789ghi012",
"object": "generation.task",
"model": "doubao-seedance-1-0-pro-fast",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}