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 分辨率

快速生成,适合预览和草稿

时长无音频含音频
4s8 credits ($0.04)14 credits ($0.07)
8s14 credits ($0.07)28 credits ($0.14)
12s19 credits ($0.095)38 credits ($0.19)
720p

720p 分辨率

高质量输出,推荐用于正式项目

时长无音频含音频
4s14 credits ($0.07)28 credits ($0.14)
8s28 credits ($0.14)56 credits ($0.28)
12s42 credits ($0.21)84 credits ($0.42)

API 端点

POST/v1/generate
使用 Seedance 2.0 模型创建新的视频生成任务。支持文生视频和图生视频模式。

请求体

Parameter类型必填描述
promptstring必填视频描述文本(最多 2000 字符)
aspect_ratiostring可选输出宽高比。支持:1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21 (默认值: 1:1)
resolutionstring可选视频分辨率:"480p" 或 "720p" (默认值: 720p)
durationstring可选视频时长(秒):"4"、"8" 或 "12" (默认值: 8)
generate_audioboolean可选启用 AI 音频生成 (默认值: false)
fixed_lensboolean可选锁定镜头以减少运动模糊 (默认值: false)
image_urlsstring[]可选参考图片 URL 数组,用于图生视频(最多 1 张)
callback_urlstring可选异步状态通知的 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_idstring必填生成接口返回的唯一任务 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

错误代码

StatusCodeDescription
400 错误请求INVALID_PROMPT提示词无效或为空
400 错误请求INVALID_ASPECT_RATIO不支持的宽高比
400 错误请求INVALID_RESOLUTION分辨率必须是 480p 或 720p
400 错误请求INVALID_DURATION时长必须是 4、8 或 12 秒
400 错误请求TOO_MANY_IMAGESimage_urls 数组最多允许 1 张图片
401 未授权INVALID_API_KEYAPI 密钥缺失或无效
402 INSUFFICIENT_CREDITS积分不足
404 未找到TASK_NOT_FOUND任务 ID 未找到或不属于您的账户
500 服务器内部错误INTERNAL_ERROR服务器错误,请稍后重试