外观
Seedance 2.0 视频模型 API
本文说明如何使用 seedance-2.0 生成文生视频、图生视频和多素材参考视频。该接口采用异步任务模式,并支持原生音频。
接口概览
| 项目 | 值 |
|---|---|
| Base URL | https://api.opennave.top/v1 |
| 模型 | seedance-2.0 |
| 创建任务 | POST /videos |
| 查询任务 | GET /videos/{task_id} |
| 下载结果 | GET /videos/{task_id}/content |
| 认证 | Authorization: Bearer YOUR_API_KEY |
Standard 和 720p 支持 4 至 15 秒;1080p 仅支持 4 至 12 秒。请求中 seconds 必须传 JSON 字符串,例如 "5"。
快速开始
sh
curl -X POST "https://api.opennave.top/v1/videos" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"prompt": "电影感的清晨海面,柔和金色阳光穿过薄雾,一艘白色帆船缓慢驶过,镜头平稳横移,真实自然,环境中有轻微海浪声",
"seconds": "5",
"resolution": "standard",
"size": "864x496",
"audio": true
}'响应中的 id 是任务 ID。建议首次请求使用 standard、864x496、5 秒的组合。
请求参数
| 字段 | 类型 | 说明 |
|---|---|---|
model | string | 必填,固定为 seedance-2.0。 |
prompt | string | 必填,描述主体、动作、环境、镜头、风格与声音。 |
seconds | string | 推荐。Standard/720p 为 "4" 至 "15",1080p 为 "4" 至 "12"。 |
size | string | 推荐,例如 1280x720。 |
audio | boolean | 可选,是否生成原生音频。 |
input_reference | string 或 string[] | 可选,单张起始帧或最多 4 张语义参考图。 |
video_reference | string 或 string[] | 可选,最多 3 段参考视频。 |
audio_reference | string 或 string[] | 可选,最多 1 段参考音频。 |
duration | integer | 兼容字段,和 seconds 不要同时传。 |
resolution | string | 兼容字段,可为 standard、720p、1080p。 |
aspect_ratio | string | 兼容字段,和 resolution 配合使用。 |
生成模式
文生视频
只传提示词与输出参数:
json
{
"model": "seedance-2.0",
"prompt": "雨夜霓虹街道,一辆黑色跑车从积水中驶过,低机位跟拍,轮胎溅起水花,电影级光影,远处有雷声",
"seconds": "8",
"size": "1280x720",
"audio": true
}图生视频
input_reference 为字符串时表示一张起始帧:
json
{
"model": "seedance-2.0",
"prompt": "镜头缓慢推进,人物衣摆随风摆动,远处竹叶飘落,保持原图人物、服装和构图一致",
"input_reference": "https://example.com/start-frame.jpg",
"seconds": "5",
"size": "1280x720",
"audio": true
}多素材参考
input_reference 为数组时可使用最多 4 张图片;参考视频最多 3 段,参考音频最多 1 段:
json
{
"model": "seedance-2.0",
"prompt": "沿用建筑参考图的外观与材质,采用参考视频的镜头节奏,配合参考音频氛围,生成楼盘介绍短片",
"input_reference": [
"https://example.com/building-front.jpg",
"https://example.com/building-lobby.jpg"
],
"video_reference": [
"https://example.com/camera-motion.mp4"
],
"audio_reference": "https://example.com/music.mp3",
"seconds": "10",
"size": "1920x1080",
"audio": true
}图片可使用 HTTPS URL 或 Data URL;视频和音频必须使用 HTTP(S) URL 或已上传素材 UUID。参考视频支持 MP4、MOV,每段最大 200 MB;参考音频支持 MP3、WAV、M4A、AAC,最大 200 MB。
尺寸与计费
| 档位 | 单价 | 示例尺寸 |
|---|---|---|
| Standard / 480p | $6 / 秒 | 864x496、496x864、640x640 |
| 720p | $10 / 秒 | 1280x720、720x1280、960x960 |
| 1080p | $17 / 秒 | 1920x1080、1080x1920、1080x1080 |
1080p 最长 12 秒,不支持 4K。提交前应向用户展示预计费用:分辨率单价乘以生成秒数。
任务轮询和下载
- 创建后保存任务 ID。
- 首次等待 8 秒,之后每 8 至 10 秒轮询。
queued和in_progress表示继续等待;completed后下载;failed时读取error。- 1080p 长任务总等待时间建议至少为 25 分钟。
sh
curl -L "https://api.opennave.top/v1/videos/task_xxx/content" \
-H "Authorization: Bearer YOUR_API_KEY" \
--output seedance-result.mp4下载请求必须允许重定向,cURL 使用 -L。取得任务 ID 后不要因等待时间较长而重复提交,否则可能重复计费。
错误处理与上线检查
| 情况 | 处理方式 |
|---|---|
| 400 | 检查模型、时长、尺寸、素材数量和 URL。 |
| 401 | 检查 API Key 是否使用 Bearer 格式。 |
| 404 | 检查任务 ID 与账户归属。 |
| 429 | 降低频率,使用带随机抖动的指数退避。 |
| 5xx | 保存响应体,仅对可重试错误进行有限重试。 |
生产环境应只在服务端存储密钥,持久化任务 ID 和业务订单号,分别限制提交与轮询频率,并限制用户只能使用允许的尺寸与时长。
查看 video-v1 视频 API