Seedance 2.0 API 文档
将 Seedance 2.0 视频生成 API 集成到您的应用程序的完整指南。
API v1.0 Base URL: https://seedanceapi.org/v1
快速开始
bash
curl -X POST 'https://seedanceapi.org/v1/generate' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "A cinematic shot of mountains at sunrise with flowing clouds",
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": "8"
}'身份认证
所有 API 请求都需要在 Authorization 头中使用 Bearer 令牌进行身份验证。
重要提示: 您可以在控制面板的 API Keys 页面获取您的 API 密钥。 → 获取 API 密钥
http
Authorization: Bearer YOUR_API_KEY定价
480p
480p 分辨率
快速生成,适合预览和草稿
| 时长 | 无音频 | 含音频 |
|---|---|---|
| 4s | 8 credits ($0.04) | 14 credits ($0.07) |
| 8s | 14 credits ($0.07) | 28 credits ($0.14) |
| 12s | 19 credits ($0.095) | 38 credits ($0.19) |
720p
720p 分辨率
高质量输出,推荐用于正式项目
| 时长 | 无音频 | 含音频 |
|---|---|---|
| 4s | 14 credits ($0.07) | 28 credits ($0.14) |
| 8s | 28 credits ($0.14) | 56 credits ($0.28) |
| 12s | 42 credits ($0.21) | 84 credits ($0.42) |
API 端点
POST
/v1/generate使用 Seedance 2.0 模型创建新的视频生成任务。支持文生视频和图生视频模式。
请求体
| Parameter | 类型 | 必填 | 描述 |
|---|---|---|---|
prompt | string | 必填 | 视频描述文本(最多 2000 字符) |
aspect_ratio | string | 可选 | 输出宽高比。支持:1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21 (默认值: 1:1) |
resolution | string | 可选 | 视频分辨率:"480p" 或 "720p" (默认值: 720p) |
duration | string | 可选 | 视频时长(秒):"4"、"8" 或 "12" (默认值: 8) |
generate_audio | boolean | 可选 | 启用 AI 音频生成 (默认值: false) |
fixed_lens | boolean | 可选 | 锁定镜头以减少运动模糊 (默认值: false) |
image_urls | string[] | 可选 | 参考图片 URL 数组,用于图生视频(最多 1 张) |
callback_url | string | 可选 | 异步状态通知的 Webhook URL。必须是公网可访问地址(不支持 localhost)。 |
文生视频
json
{
"prompt": "A majestic eagle soaring through golden sunset clouds over ocean waves",
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": "8"
}图生视频
json
{
"prompt": "The character slowly turns and smiles at the camera",
"image_urls": [
"https://example.com/my-image.jpg"
],
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": "4"
}含音频生成
json
{
"prompt": "A peaceful river flowing through a forest with birds singing",
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": "8",
"generate_audio": true,
"fixed_lens": true
}响应
Task created successfully
{
"code": 200,
"message": "success",
"data": {
"task_id": "seed15abc123def456pro",
"status": "IN_PROGRESS"
}
}GET
/v1/status检查视频生成任务的状态,并在完成后获取结果。
查询参数
| Parameter | 类型 | 必填 | 描述 |
|---|---|---|---|
task_id | string | 必填 | 生成接口返回的唯一任务 ID |
请求示例
bash
curl -X GET 'https://seedanceapi.org/v1/status?task_id=seed15abc123def456pro' \
-H 'Authorization: Bearer YOUR_API_KEY'💡 Tip: 状态 API 中的 response 字段是一个视频 URL 数组,您可以直接通过 data.response[0] 获取视频 URL。
javascript
// Extract video URL from response
const videoUrl = data.response[0];响应
{
"code": 200,
"message": "success",
"data": {
"task_id": "seed15abc123def456pro",
"status": "SUCCESS",
"consumed_credits": 28,
"created_at": "2026-02-07T10:30:00Z",
"request": {
"prompt": "A majestic eagle soaring through golden sunset clouds",
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": "8"
},
"response": [
"https://cdn.example.com/videos/seed15abc123def456pro.mp4"
],
"error_message": null
}
}API 测试工具
直接在浏览器中测试 API。将 YOUR_API_KEY 替换为您的实际 API 密钥。
API 测试沙盒POST
错误代码
| Status | Code | Description |
|---|---|---|
| 400 错误请求 | INVALID_PROMPT | 提示词无效或为空 |
| 400 错误请求 | INVALID_ASPECT_RATIO | 不支持的宽高比 |
| 400 错误请求 | INVALID_RESOLUTION | 分辨率必须是 480p 或 720p |
| 400 错误请求 | INVALID_DURATION | 时长必须是 4、8 或 12 秒 |
| 400 错误请求 | TOO_MANY_IMAGES | image_urls 数组最多允许 1 张图片 |
| 401 未授权 | INVALID_API_KEY | API 密钥缺失或无效 |
| 402 | INSUFFICIENT_CREDITS | 积分不足 |
| 404 未找到 | TASK_NOT_FOUND | 任务 ID 未找到或不属于您的账户 |
| 500 服务器内部错误 | INTERNAL_ERROR | 服务器错误,请稍后重试 |