Seedance 2.0 API 文档
通过 API v2 接入 Seedance 2.0 与 2.0 Fast:文生视频、图生视频,时长 5/10/15 秒。
API v2 · 2.0 Base URL: https://seedanceapi.org/v2
快速开始
bash
| 1 | curl -X POST 'https://seedanceapi.org/v2/generate' \ |
| 2 | -H 'Authorization: Bearer YOUR_API_KEY' \ |
| 3 | -H 'Content-Type: application/json' \ |
| 4 | -d '{ |
| 5 | "prompt": "A cinematic aerial shot over coastline at golden hour", |
| 6 | "aspect_ratio": "16:9", |
| 7 | "duration": 10, |
| 8 | "model": "seedance-2.0" |
| 9 | }' |
身份认证
所有请求须在 Authorization 头中携带 Bearer Token。
重要: 请在控制台的 API Keys 页面获取密钥。 → 获取 API 密钥
http
| 1 | Authorization: Bearer YOUR_API_KEY |
定价(积分)
单次任务按所选时长与模型扣除积分,详见下表。
2.0
Seedance 2.0(标准)
画质与效果更强,单位时长积分高于 Fast。
| 时长 | 积分 |
|---|---|
| 5s | 240 credits |
| 10s | 480 credits |
| 15s | 720 credits |
Fast
Seedance 2.0 Fast
生成更快、单秒积分更省。
| 时长 | 积分 |
|---|---|
| 5s | 160 credits |
| 10s | 320 credits |
| 15s | 480 credits |
API 端点
POST
/v2/generate发起 Seedance 2.0 或 2.0 Fast 任务。文生视频使用 prompt + aspect_ratio;图生视频使用 prompt + images。
请求体
Body ParametersJSON
prompt:string
文本提示(必填,最多 2000 字符)
duration:number
时长(秒):5、10 或 15 Defaults to 5.
aspect_ratio:optional string
文生视频画幅:16:9、9:16、4:3、3:4 Defaults to 16:9 (text-to-video only).
images:optional string[]
图生视频:1–4 张图片 URL(http/https)
model:optional string
可选:seedance-2.0(默认)或 seedance-2.0-fast Defaults to seedance-2.0.
callback_url:optional string
可选:异步回调地址(须公网可访问,不支持 localhost)
public:optional boolean
可选:是否公开(用于展示位等能力,视平台开放为准)
文生视频
json
| 1 | { |
| 2 | "prompt": "A slow dolly shot through a neon-lit street in the rain", |
| 3 | "aspect_ratio": "16:9", |
| 4 | "duration": 10, |
| 5 | "model": "seedance-2.0" |
| 6 | } |
图生视频
json
| 1 | { |
| 2 | "prompt": "The subject walks forward and looks at the camera", |
| 3 | "images": [ |
| 4 | "https://example.com/reference.jpg" |
| 5 | ], |
| 6 | "duration": 5, |
| 7 | "model": "seedance-2.0" |
| 8 | } |
Fast 示例
json
| 1 | { |
| 2 | "prompt": "Sunrise over misty mountains with birds crossing the frame", |
| 3 | "aspect_ratio": "9:16", |
| 4 | "duration": 15, |
| 5 | "model": "seedance-2.0-fast" |
| 6 | } |
响应
Task created
| 1 | { |
| 2 | "code": 200, |
| 3 | "message": "success", |
| 4 | "data": { |
| 5 | "task_id": "n90a1b2c3d4e5f6sd20", |
| 6 | "status": "IN_PROGRESS", |
| 7 | "consumed_credits": 480 |
| 8 | } |
| 9 | } |
GET
/v2/status用 task_id 轮询直到 SUCCESS 或 FAILED;视频地址在 response 字段。
查询参数
Body ParametersJSON
task_id:string
POST /v2/generate 返回的 task_id
请求示例
bash
| 1 | curl -X GET 'https://seedanceapi.org/v2/status?task_id=n90a1b2c3d4e5f6sd20' \ |
| 2 | -H 'Authorization: Bearer YOUR_API_KEY' |
Tip: 状态为 SUCCESS 时,data.response 为视频 URL 数组,可用 data.response[0] 取首条。
javascript
| 1 | const videoUrl = data.response[0]; |
响应
| 1 | { |
| 2 | "code": 200, |
| 3 | "message": "success", |
| 4 | "data": { |
| 5 | "task_id": "n90a1b2c3d4e5f6sd20", |
| 6 | "status": "SUCCESS", |
| 7 | "consumed_credits": 480, |
| 8 | "created_at": "2026-04-03T10:30:00Z", |
| 9 | "request": { |
| 10 | "prompt": "A slow dolly shot…", |
| 11 | "aspect_ratio": "16:9", |
| 12 | "duration": 10 |
| 13 | }, |
| 14 | "response": [ |
| 15 | "https://cdn.example.com/videos/n90a1b2c3d4e5f6sd20.mp4" |
| 16 | ], |
| 17 | "error_message": null |
| 18 | } |
| 19 | } |
API 测试工具
在浏览器中调试接口,将 YOUR_API_KEY 换成真实密钥。
API 测试沙盒POST
错误码
| Status | Code | Description |
|---|---|---|
| 400 错误请求 | INVALID_PROMPT | 提示词无效或为空 |
| 400 错误请求 | INVALID_ASPECT_RATIO | 不支持的 aspect_ratio |
| 400 错误请求 | INVALID_DURATION | duration 须为 5、10 或 15 |
| 400 错误请求 | TOO_MANY_IMAGES | 图片数量超限(最多 4 张) |
| 401 未授权 | INVALID_API_KEY | API 密钥无效 |
| 402 | INSUFFICIENT_CREDITS | 积分不足 |
| 404 未找到 | TASK_NOT_FOUND | 任务不存在 |
| 500 服务器内部错误 | INTERNAL_ERROR | 服务器错误 |