label llms.txt open_chatgpt

Seedance 2.0 API 文档

通过 API v2 接入 Seedance 2.0、2.0 Fast 与 Seedance 2.0 Mini:支持文生视频与图生视频。

API v2 · 2.0 / Fast / Mini Base URL: https://seedanceapi.org/v2

快速开始

bash
1curl -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
1Authorization: Bearer YOUR_API_KEY

定价(积分)

单次任务按所选模型、时长、分辨率与输入类型扣除积分,详见下表。

如需充值积分,请前往 → 定价页面. (1 美元 = 100 积分)

2.0

Seedance 2.0(标准)

画质与效果更强,单位时长积分高于 Fast。

时长积分
5s240 credits
10s480 credits
15s720 credits
Fast

Seedance 2.0 Fast

生成更快、单秒积分更省。

时长积分
5s160 credits
10s320 credits
15s480 credits
Mini

Seedance 2.0 Mini

Mini 版本支持 4–15 秒、480p/720p 与更多画幅选项。

分辨率输入类型积分
480ptext / imageceil(14.25 × seconds)
480pwith reference_video_urls9 × seconds
720ptext / imageceil(30.75 × seconds)
720pwith reference_video_urlsceil(18.75 × seconds)

Mini 按 KIE 上游每秒积分加价 50% 计费,最终积分如有小数向上取整。传入 reference_video_urls 时使用含视频输入的较低费率。

API 端点

POST/v2/generate

发起 Seedance 2.0、2.0 Fast 或 Seedance 2.0 Mini 任务。文生视频使用 prompt + aspect_ratio;图生视频使用 prompt + images。

请求体

Body ParametersJSON
prompt:string

文本提示(必填,最多 2000 字符)

duration:number

时长(秒):2.0 / Fast 为 5、10 或 15;Mini 支持 4 到 15 的整数秒。 Defaults to 5.

resolution:optional string

输出分辨率:480p、720p 或 1080p。Mini 支持 480p 与 720p;Mini 传 1080p 时会按 720p 计费并提交给上游。 Defaults to 720p.

aspect_ratio:optional string

文生视频画幅:16:9、9:16、4:3、3:4。Mini 额外支持 1:1、21:9、adaptive。 Defaults to 16:9 (text-to-video only).

images:optional string[]

图生视频:1–4 张图片 URL(http/https)

reference_video_urls:optional string[]

可选:Mini 兼容的参考视频 URL。传入后 Mini 使用含视频输入费率。

reference_audio_urls:optional string[]

可选:Mini 兼容的参考音频 URL。

model:optional string

可选:seedance-2.0(默认)、seedance-2.0-fast 或 seedance-2-mini 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}

Mini 示例

json
1{
2 "prompt": "A compact product demo with smooth camera motion and clean lighting",
3 "aspect_ratio": "1:1",
4 "resolution": "720p",
5 "duration": 8,
6 "model": "seedance-2-mini"
7}

响应

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
1curl -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
1const 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

错误码

StatusCodeDescription
400 错误请求INVALID_PROMPT提示词无效或为空
400 错误请求INVALID_ASPECT_RATIO所选模型不支持该 aspect_ratio
400 错误请求INVALID_DURATION2.0 / Fast 的 duration 须为 5、10 或 15;Mini 支持 4–15 秒
400 错误请求TOO_MANY_IMAGES图片数量超限(最多 4 张)
401 未授权INVALID_API_KEYAPI 密钥无效
402 INSUFFICIENT_CREDITS积分不足
404 未找到TASK_NOT_FOUND任务不存在
500 服务器内部错误INTERNAL_ERROR服务器错误