Seedance 1.5 Pro
Seedance 1.5 Pro 支持文生视频、首帧图生视频、首尾帧图生视频。生成模式由 input.image_urls 的图片数量自动决定。
模型
| 模型名称 | 时长 | 分辨率 | 宽高比 |
|---|---|---|---|
doubao-seedance-1.5-pro | 4-12s | 480p, 720p, 1080p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 |
定价
按公式计费:时长 × 每秒速率。速率由分辨率和 generate_audio 决定。
| 分辨率 | 无音频 | 有音频 |
|---|---|---|
| 480p | 3 credits/s | 7 credits/s |
| 720p | 7 credits/s | 14 credits/s |
| 1080p | 15 credits/s | 30 credits/s |
示例:
- 720p, 5s, 有音频:14 × 5 = 70 credits
- 1080p, 8s, 无音频:15 × 8 = 120 credits
- 480p, 12s, 有音频:7 × 12 = 84 credits
创建任务
POST https://api.aivideoapi.ai/v1/videos/generations
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 必须为 doubao-seedance-1.5-pro |
input | object | 是 | 生成参数,见下方 |
callback_url | string | 否 | 接收任务完成/失败通知的 URL |
Input 对象
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
prompt | string | 是 | 视频提示词 |
image_urls | string[] | object[] | 否 | 0 张图 = 文生视频,1 张图 = 首帧图生视频,2 张图 = 首尾帧图生视频 |
duration | integer | 否 | 视频时长,单位秒:4-12(默认:5) |
aspect_ratio | string | 否 | 16:9、4:3、1:1、3:4、9:16、21:9(默认:16:9)。也可使用 ratio 作为别名 |
resolution | string | 否 | 480p、720p 或 1080p(默认:720p) |
generate_audio | boolean | 否 | 是否生成同步音频(默认:true) |
watermark | boolean | 否 | 是否添加水印(默认:false) |
camera_fixed | boolean | 否 | 是否固定摄像头(默认:false)。详见固定摄像头 |
seed | integer | 否 | 随机种子,范围:[-1, 4294967295] |
该模型不支持 video_urls、audio_urls、generation_type、web_search、return_last_frame。
生成模式
image_urls 数量 | 模式 | 行为 |
|---|---|---|
| 0 | 文生视频 | 仅根据 prompt 生成视频 |
| 1 | 首帧图生视频 | 将图片作为视频首帧 |
| 2 | 首尾帧图生视频 | 第一张图作为首帧,第二张图作为尾帧 |
image_urls 格式
image_urls 支持字符串数组和对象数组:
"image_urls": [
"https://example.com/first-frame.jpg",
"https://example.com/last-frame.jpg"
]
"image_urls": [
{ "url": "https://example.com/first-frame.jpg" },
{ "url": "https://example.com/last-frame.jpg" }
]
仅支持公开可访问的 HTTP(S) 图片 URL。
示例
文生视频
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1.5-pro",
"callback_url": "https://your-server.com/webhook",
"input": {
"prompt": "一个女孩走过夜晚的霓虹城市,电影感运镜",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p",
"generate_audio": true
}
}'
首帧图生视频
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1.5-pro",
"input": {
"prompt": "镜头缓慢推进,人物微笑并转向光源。",
"image_urls": [
"https://example.com/first-frame.jpg"
],
"duration": 8,
"aspect_ratio": "9:16",
"resolution": "720p",
"generate_audio": true
}
}'
首尾帧图生视频
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1.5-pro",
"input": {
"prompt": "从首帧平滑过渡到尾帧,保持电影感镜头运动。",
"image_urls": [
{ "url": "https://example.com/first-frame.jpg" },
{ "url": "https://example.com/last-frame.jpg" }
],
"duration": 8,
"aspect_ratio": "9:16",
"resolution": "1080p",
"generate_audio": false
}
}'
响应
{
"code": 200,
"msg": "success",
"data": {
"taskId": "cbf6b69d-4f03-4817-8ed7-94c0292184a8"
}
}
查询任务
curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
-H "Authorization: Bearer sk-your-api-key"
状态变化:pending -> processing -> completed 或 failed。
完成
{
"id": "7d89c51e-9430-410e-909e-df347131ebaa",
"status": "completed",
"model": "doubao-seedance-1.5-pro",
"created_at": 1774790227,
"completed_at": 1774796529,
"output": {
"urls": [
"https://file.aivideoapi.ai/videos/2026/07/04/abc.mp4"
],
"metadata": {
"seed": 41485,
"ratio": "16:9",
"duration": 5,
"resolution": "720p",
"generate_audio": true,
"framespersecond": 24
}
}
}
视频 URL 可能会过期,请在生成完成后及时下载。
回调
创建任务时传入 callback_url,系统会在任务完成或失败时自动向你的 URL 发送 POST 请求。
请求头与重试策略详见回调说明。
参数详解
时长
整数,单位:秒。默认值:5。
- 取值范围:4-12
- 时长会影响计费
宽高比
默认值:16:9。
支持的值:16:9、4:3、1:1、3:4、9:16、21:9。
随机种子
整数。
- 取值范围:[-1, 4294967295] 之间的整数
- 实际使用的 seed 通过
output.metadata.seed返回
固定摄像头
布尔值。默认值:false。
| 值 | 说明 |
|---|---|
true | 固定摄像头。平台会在用户提示词中追加固定摄像头,实际效果不保证。 |
false | 不固定摄像头。 |
常见错误码
请求失败时,API 返回 JSON 格式的错误响应:
{
"error": {
"code": "insufficient_credits",
"message": "Your credit balance is too low. Please top up.",
"type": "billing_error"
}
}
错误码一览
| HTTP 状态码 | 错误码 | 类型 | 说明 |
|---|---|---|---|
| 400 | invalid_request | invalid_request_error | 缺少必填参数或参数无效 |
| 401 | invalid_api_key | authentication_error | API Key 无效、已禁用或已删除 |
| 402 | insufficient_credits | billing_error | 积分余额不足,请充值 |
| 403 | ip_not_allowed | permission_error | 请求 IP 不在 Key 的白名单中 |
| 404 | model_not_found | invalid_request_error | 模型不存在或已停用 |
| 404 | task_not_found | invalid_request_error | 任务 ID 不存在 |
| 429 | rate_limit_exceeded | rate_limit_error | 请求过于频繁,请降低频率 |
| 429 | spend_limit_exceeded | billing_error | 达到 Key 的消费限额(每小时/每天/总量) |
| 500 | internal_error | api_error | 服务器内部错误 |
| 503 | upstream_error | upstream_error | 上游 AI 服务返回错误 |
常见场景
invalid_request (400)
缺少必填字段或参数格式错误时返回。
{
"error": {
"code": "invalid_request",
"message": "'model' is required.",
"type": "invalid_request_error"
}
}
insufficient_credits (402)
积分不足。可通过 GET /v1/credits 查询余额,前往 Dashboard > Billing 充值。
invalid_api_key (401)
可能原因:
- Key 不以
sk-开头 - Key 已被禁用或删除
- 用户账户已被封禁
upstream_error (503)
上游 AI 服务返回错误,可能原因:
- 输入内容包含敏感或违规信息
- 上游服务暂时不可用
- 请求参数不被上游支持
因上游错误导致任务失败时,预扣积分会自动退还。