curl https://api.nodylink.com/v2/videos/generations \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "Doubao-Seedance-2.0",
"content": [
{"type": "text", "text": "小猫对着镜头打哈欠,午后阳光,浅景深"}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true
}'
import time
import requests
API_KEY = "sk-你的密钥"
BASE = "https://api.nodylink.com"
headers = {"Authorization": f"Bearer {API_KEY}"}
submit = requests.post(
f"{BASE}/v2/videos/generations",
headers=headers,
json={
"model": "Doubao-Seedance-2.0",
"content": [{"type": "text", "text": "小猫对着镜头打哈欠,午后阳光,浅景深"}],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": True,
},
).json()
task_id = submit["id"]
def video_url(data):
task = data.get("task") or {}
if task.get("outputs"):
return task["outputs"][0]
return (data.get("content") or {}).get("video_url")
while True:
task = requests.get(f"{BASE}/v2/videos/generations/{task_id}", headers=headers).json()
if task["status"] == "SUCCESS":
print(video_url(task["data"]))
break
if task["status"] == "FAILURE":
raise RuntimeError(task["fail_reason"])
time.sleep(10)
const API_KEY = "sk-你的密钥";
const BASE = "https://api.nodylink.com";
const headers = {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
};
const submit = await fetch(`${BASE}/v2/videos/generations`, {
method: "POST",
headers,
body: JSON.stringify({
model: "Doubao-Seedance-2.0",
content: [{ type: "text", text: "小猫对着镜头打哈欠,午后阳光,浅景深" }],
resolution: "720p",
ratio: "16:9",
duration: 5,
generate_audio: true,
}),
}).then((r) => r.json());
const videoUrl = (data) => data?.task?.outputs?.[0] ?? data?.content?.video_url;
while (true) {
const task = await fetch(`${BASE}/v2/videos/generations/${submit.id}`, { headers })
.then((r) => r.json());
if (task.status === "SUCCESS") {
console.log(videoUrl(task.data));
break;
}
if (task.status === "FAILURE") throw new Error(task.fail_reason);
await new Promise((r) => setTimeout(r, 10000));
}
{
"id": "task_01M5XWYVFZC183T1ZJWR5N6XJK",
"task_id": "task_01M5XWYVFZC183T1ZJWR5N6XJK",
"object": "video",
"model": "Doubao-Seedance-2.0",
"status": "queued",
"progress": 0,
"created_at": 1792000000
}
{
"code": "missing_model",
"message": "model field is required",
"data": null
}
Doubao Seedance
Seedance 2.0
字节跳动 Doubao Seedance 2.0 视频生成:文生视频、首尾帧、多模态参考与有声视频。请求体与火山方舟官方一致。
POST
/
v2
/
videos
/
generations
curl https://api.nodylink.com/v2/videos/generations \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "Doubao-Seedance-2.0",
"content": [
{"type": "text", "text": "小猫对着镜头打哈欠,午后阳光,浅景深"}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true
}'
import time
import requests
API_KEY = "sk-你的密钥"
BASE = "https://api.nodylink.com"
headers = {"Authorization": f"Bearer {API_KEY}"}
submit = requests.post(
f"{BASE}/v2/videos/generations",
headers=headers,
json={
"model": "Doubao-Seedance-2.0",
"content": [{"type": "text", "text": "小猫对着镜头打哈欠,午后阳光,浅景深"}],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": True,
},
).json()
task_id = submit["id"]
def video_url(data):
task = data.get("task") or {}
if task.get("outputs"):
return task["outputs"][0]
return (data.get("content") or {}).get("video_url")
while True:
task = requests.get(f"{BASE}/v2/videos/generations/{task_id}", headers=headers).json()
if task["status"] == "SUCCESS":
print(video_url(task["data"]))
break
if task["status"] == "FAILURE":
raise RuntimeError(task["fail_reason"])
time.sleep(10)
const API_KEY = "sk-你的密钥";
const BASE = "https://api.nodylink.com";
const headers = {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
};
const submit = await fetch(`${BASE}/v2/videos/generations`, {
method: "POST",
headers,
body: JSON.stringify({
model: "Doubao-Seedance-2.0",
content: [{ type: "text", text: "小猫对着镜头打哈欠,午后阳光,浅景深" }],
resolution: "720p",
ratio: "16:9",
duration: 5,
generate_audio: true,
}),
}).then((r) => r.json());
const videoUrl = (data) => data?.task?.outputs?.[0] ?? data?.content?.video_url;
while (true) {
const task = await fetch(`${BASE}/v2/videos/generations/${submit.id}`, { headers })
.then((r) => r.json());
if (task.status === "SUCCESS") {
console.log(videoUrl(task.data));
break;
}
if (task.status === "FAILURE") throw new Error(task.fail_reason);
await new Promise((r) => setTimeout(r, 10000));
}
{
"id": "task_01M5XWYVFZC183T1ZJWR5N6XJK",
"task_id": "task_01M5XWYVFZC183T1ZJWR5N6XJK",
"object": "video",
"model": "Doubao-Seedance-2.0",
"status": "queued",
"progress": 0,
"created_at": 1792000000
}
{
"code": "missing_model",
"message": "model field is required",
"data": null
}
请注意:如果Seedance生成请求中未创建素材,后台将为其自动创建素材再提交任务。因此若无需素材管理则生成请求中直接传公网URL即可。
- 请求体与 火山方舟视频生成 API 官方格式一致:文本、图片、视频、音频都放在
content数组中,用role区分用途。 - 异步接口:提交后立即返回任务
id,再调用 查询视频任务 获取结果。 - 计费与时长、分辨率、是否包含参考视频相关,见 模型价格。任务失败自动退款。
- 需要 480p,或标准版的 4k 时,使用 Seedance 2.0 Full。
模型
| 模型 ID | 说明 | 分辨率 |
|---|---|---|
Doubao-Seedance-2.0 | 标准版 | 720p / 1080p |
Doubao-Seedance-2.0-fast | 快速版,功能与标准版一致,生成更快 | 仅 720p |
Doubao-Seedance-2.0-mini | 迷你版,功能与标准版一致 | 仅 720p |
curl https://api.nodylink.com/v2/videos/generations \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "Doubao-Seedance-2.0",
"content": [
{"type": "text", "text": "小猫对着镜头打哈欠,午后阳光,浅景深"}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true
}'
import time
import requests
API_KEY = "sk-你的密钥"
BASE = "https://api.nodylink.com"
headers = {"Authorization": f"Bearer {API_KEY}"}
submit = requests.post(
f"{BASE}/v2/videos/generations",
headers=headers,
json={
"model": "Doubao-Seedance-2.0",
"content": [{"type": "text", "text": "小猫对着镜头打哈欠,午后阳光,浅景深"}],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": True,
},
).json()
task_id = submit["id"]
def video_url(data):
task = data.get("task") or {}
if task.get("outputs"):
return task["outputs"][0]
return (data.get("content") or {}).get("video_url")
while True:
task = requests.get(f"{BASE}/v2/videos/generations/{task_id}", headers=headers).json()
if task["status"] == "SUCCESS":
print(video_url(task["data"]))
break
if task["status"] == "FAILURE":
raise RuntimeError(task["fail_reason"])
time.sleep(10)
const API_KEY = "sk-你的密钥";
const BASE = "https://api.nodylink.com";
const headers = {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
};
const submit = await fetch(`${BASE}/v2/videos/generations`, {
method: "POST",
headers,
body: JSON.stringify({
model: "Doubao-Seedance-2.0",
content: [{ type: "text", text: "小猫对着镜头打哈欠,午后阳光,浅景深" }],
resolution: "720p",
ratio: "16:9",
duration: 5,
generate_audio: true,
}),
}).then((r) => r.json());
const videoUrl = (data) => data?.task?.outputs?.[0] ?? data?.content?.video_url;
while (true) {
const task = await fetch(`${BASE}/v2/videos/generations/${submit.id}`, { headers })
.then((r) => r.json());
if (task.status === "SUCCESS") {
console.log(videoUrl(task.data));
break;
}
if (task.status === "FAILURE") throw new Error(task.fail_reason);
await new Promise((r) => setTimeout(r, 10000));
}
{
"id": "task_01M5XWYVFZC183T1ZJWR5N6XJK",
"task_id": "task_01M5XWYVFZC183T1ZJWR5N6XJK",
"object": "video",
"model": "Doubao-Seedance-2.0",
"status": "queued",
"progress": 0,
"created_at": 1792000000
}
{
"code": "missing_model",
"message": "model field is required",
"data": null
}
鉴权
Bearer <API Key>。在 API 密钥 页面创建。请求参数
输入内容数组,可以包含文本、图片、视频、音频。
显示 文本
显示 文本
显示 图片
显示 图片
显示 视频
显示 视频
- 使用首帧 / 尾帧时,不能同时传参考视频或参考音频。
- 参考音频不能单独使用,必须搭配参考图或参考视频。
- 真人人脸作为参考素材时可能会被上游内容审核拦截。
提交阶段的错误返回
{"code": "...", "message": "...", "data": null} 结构。HTTP 状态码为 429 时,message 为「当前分组上游负载已饱和,请稍后再试」,请退避后重试。提交响应
任务 ID,用于 查询视频任务。
使用示例
图生视频(首帧)
{
"model": "Doubao-Seedance-2.0",
"content": [
{"type": "text", "text": "女孩转身微笑,头发随风飘动"},
{"type": "image_url", "image_url": {"url": "https://example.com/girl.jpg"}, "role": "first_frame"}
],
"ratio": "adaptive",
"duration": 5
}
首尾帧
{
"model": "Doubao-Seedance-2.0",
"content": [
{"type": "text", "text": "镜头缓慢推进,城市从白天过渡到夜晚"},
{"type": "image_url", "image_url": {"url": "https://example.com/day.jpg"}, "role": "first_frame"},
{"type": "image_url", "image_url": {"url": "https://example.com/night.jpg"}, "role": "last_frame"}
],
"ratio": "adaptive",
"duration": 8
}
多模态参考(图片 + 视频 + 音频)
{
"model": "Doubao-Seedance-2.0",
"content": [
{"type": "text", "text": "图片1中的角色按照视频1的舞蹈动作跳舞,音频1作为背景音乐"},
{"type": "image_url", "image_url": {"url": "https://example.com/character.png"}, "role": "reference_image"},
{"type": "video_url", "video_url": {"url": "https://example.com/dance.mp4"}, "role": "reference_video"},
{"type": "audio_url", "audio_url": {"url": "https://example.com/music.mp3"}, "role": "reference_audio"}
],
"resolution": "720p",
"ratio": "9:16",
"duration": 10
}
连续生成(返回尾帧)
{
"model": "Doubao-Seedance-2.0-fast",
"content": [
{"type": "text", "text": "一辆红色跑车在海岸公路上疾驰"}
],
"resolution": "720p",
"duration": 5,
"return_last_frame": true
}
first_frame 即可续接画面。
联网搜索
{
"model": "Doubao-Seedance-2.0",
"content": [
{"type": "text", "text": "介绍今年最新发布的国产电动汽车,产品展示风格"}
],
"tools": [{"type": "web_search"}]
}

