curl https://api.nodylink.com/v2/videos/generations \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"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-260128",
"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-260128",
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": "6b2f8d1e-3c4a-4e9b-8f70-1a5d9c2e7b36",
"task_id": "6b2f8d1e-3c4a-4e9b-8f70-1a5d9c2e7b36",
"object": "video",
"model": "doubao-seedance-2-0-260128",
"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-260128",
"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-260128",
"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-260128",
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": "6b2f8d1e-3c4a-4e9b-8f70-1a5d9c2e7b36",
"task_id": "6b2f8d1e-3c4a-4e9b-8f70-1a5d9c2e7b36",
"object": "video",
"model": "doubao-seedance-2-0-260128",
"status": "queued",
"progress": 0,
"created_at": 1792000000
}
{
"code": "missing_model",
"message": "model field is required",
"data": null
}
- 请求体与 火山方舟视频生成 API 官方格式一致:文本、图片、视频、音频都放在
content数组中,用role区分用途。 - 异步接口:提交后立即返回任务
id,再调用 查询视频任务 获取结果。 - 计费与时长、分辨率、是否包含参考视频相关,见 模型价格。任务失败自动退款。
模型
| 模型 ID | 说明 |
|---|---|
doubao-seedance-2-0-260128 | 标准版,支持 480p / 720p / 1080p |
doubao-seedance-2-0-fast-260128 | 快速版,功能与标准版一致,生成更快,支持 480p / 720p |
curl https://api.nodylink.com/v2/videos/generations \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"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-260128",
"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-260128",
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": "6b2f8d1e-3c4a-4e9b-8f70-1a5d9c2e7b36",
"task_id": "6b2f8d1e-3c4a-4e9b-8f70-1a5d9c2e7b36",
"object": "video",
"model": "doubao-seedance-2-0-260128",
"status": "queued",
"progress": 0,
"created_at": 1792000000
}
{
"code": "missing_model",
"message": "model field is required",
"data": null
}
鉴权
请求参数
string
必填
模型 ID:
doubao-seedance-2-0-260128 或 doubao-seedance-2-0-fast-260128。array
必填
输入内容数组,可以包含文本、图片、视频、音频。
显示 文本
显示 文本
显示 图片
显示 图片
显示 视频
显示 视频
string
默认值:"720p"
分辨率:
480p、720p、1080p。快速版不支持 1080p。string
默认值:"16:9"
宽高比:
16:9、4:3、1:1、3:4、9:16、21:9,或 adaptive(根据输入图片 / 视频自动匹配)。integer
默认值:"5"
视频时长(秒),取值 4~15。传
-1 时由模型自动决定时长,提交时按上限预扣费用,完成后按实际结果结算。boolean
默认值:"true"
是否生成与画面同步的音频(人声、音效、背景音乐)。
integer
随机种子,取值 -1 到 2^32-1。相同请求和种子会生成相似结果,但不保证完全一致。
boolean
默认值:"false"
是否在视频中添加「AI 生成」水印。
boolean
默认值:"false"
是否额外返回视频最后一帧的图片,可以作为下一段视频的首帧,实现连续生成。
array
增强工具。目前支持联网搜索:
[{"type": "web_search"}],生成时参考网络上的实时信息。- 使用首帧 / 尾帧时,不能同时传参考视频或参考音频。
- 参考音频不能单独使用,必须搭配参考图或参考视频。
- 真人人脸作为参考素材时可能会被上游内容审核拦截。
提交阶段的错误返回
{"code": "...", "message": "...", "data": null} 结构。HTTP 状态码为 429 时,message 为「当前分组上游负载已饱和,请稍后再试」,请退避后重试。提交响应
string
与
id 相同,为兼容旧接口保留。string
固定为
video。string
请求的模型 ID。
string
固定为
queued。integer
固定为
0。integer
提交时间,Unix 时间戳(秒)。
使用示例
图生视频(首帧)
{
"model": "doubao-seedance-2-0-260128",
"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-260128",
"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-260128",
"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-260128",
"content": [
{"type": "text", "text": "一辆红色跑车在海岸公路上疾驰"}
],
"resolution": "480p",
"duration": 5,
"return_last_frame": true
}
first_frame 即可续接画面。
联网搜索
{
"model": "doubao-seedance-2-0-260128",
"content": [
{"type": "text", "text": "介绍今年最新发布的国产电动汽车,产品展示风格"}
],
"tools": [{"type": "web_search"}]
}

