curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": false
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-fast-260128",
"prompt": "让画面中的人物自然转身,看向镜头并微笑,背景灯光轻微闪烁",
"duration": 5,
"aspect_ratio": "9:16",
"first_image": "https://example.com/assets/first-frame.png"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "从首帧自然过渡到尾帧,保持人物服装和场景一致,动作连贯",
"duration": 6,
"aspect_ratio": "16:9",
"first_image": "https://example.com/assets/opening-frame.png",
"last_image": "https://example.com/assets/ending-frame.png"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考图片中的产品外观、参考视频的镜头运动,并使用参考音频作为背景音乐,生成广告感短视频",
"duration": 6,
"aspect_ratio": "16:9",
"reference_image_urls": [
"https://example.com/assets/product-front.png",
"https://example.com/assets/product-side.png"
],
"reference_video_urls": [
"https://example.com/assets/camera-motion.mp4"
],
"reference_audio_urls": [
"https://example.com/assets/background-music.mp3"
],
"generate_audio": true
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考视频的运动节奏和音频情绪,生成一段自然真实的短片",
"duration": 8,
"aspect_ratio": "16:9",
"reference_video_url": "https://example.com/assets/motion.mp4",
"audio_url": "https://example.com/assets/voice.mp3",
"generate_audio": true
}'
import requests
resp = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": False,
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "doubao-seedance-2-0-260128",
prompt: "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
duration: 6,
aspect_ratio: "16:9",
resolution: "720P",
watermark: false,
}),
});
console.log(await response.json());
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]any{
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": false,
}
body, err := json.Marshal(payload)
if err != nil {
panic(err)
}
req, err := http.NewRequest("POST", "https://magic666.top/v1/videos", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(respBody))
}
{
"id": "task_01jz8s3dbke8p9vq2m8r9a7gk4",
"object": "video",
"created": 1790557800,
"model": "doubao-seedance-2-0-260128",
"status": "queued"
}
{
"code": "invalid_request",
"message": "prompt is required"
}
{
"error": {
"message": "无效的令牌",
"type": "invalid_request_error"
}
}
{
"error": {
"message": "余额不足",
"type": "insufficient_quota"
}
}
{
"error": {
"message": "rate limit exceeded",
"type": "rate_limit_exceeded"
}
}
{
"code": "do_request_failed",
"message": "upstream request failed"
}
Seedance 2.0
Seedance 2.0 创建视频任务
使用 POST /v1/videos 创建 Seedance 2.0 异步视频生成任务。
POST
https://magic666.top
/
v1
/
videos
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": false
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-fast-260128",
"prompt": "让画面中的人物自然转身,看向镜头并微笑,背景灯光轻微闪烁",
"duration": 5,
"aspect_ratio": "9:16",
"first_image": "https://example.com/assets/first-frame.png"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "从首帧自然过渡到尾帧,保持人物服装和场景一致,动作连贯",
"duration": 6,
"aspect_ratio": "16:9",
"first_image": "https://example.com/assets/opening-frame.png",
"last_image": "https://example.com/assets/ending-frame.png"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考图片中的产品外观、参考视频的镜头运动,并使用参考音频作为背景音乐,生成广告感短视频",
"duration": 6,
"aspect_ratio": "16:9",
"reference_image_urls": [
"https://example.com/assets/product-front.png",
"https://example.com/assets/product-side.png"
],
"reference_video_urls": [
"https://example.com/assets/camera-motion.mp4"
],
"reference_audio_urls": [
"https://example.com/assets/background-music.mp3"
],
"generate_audio": true
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考视频的运动节奏和音频情绪,生成一段自然真实的短片",
"duration": 8,
"aspect_ratio": "16:9",
"reference_video_url": "https://example.com/assets/motion.mp4",
"audio_url": "https://example.com/assets/voice.mp3",
"generate_audio": true
}'
import requests
resp = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": False,
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "doubao-seedance-2-0-260128",
prompt: "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
duration: 6,
aspect_ratio: "16:9",
resolution: "720P",
watermark: false,
}),
});
console.log(await response.json());
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]any{
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": false,
}
body, err := json.Marshal(payload)
if err != nil {
panic(err)
}
req, err := http.NewRequest("POST", "https://magic666.top/v1/videos", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(respBody))
}
{
"id": "task_01jz8s3dbke8p9vq2m8r9a7gk4",
"object": "video",
"created": 1790557800,
"model": "doubao-seedance-2-0-260128",
"status": "queued"
}
{
"code": "invalid_request",
"message": "prompt is required"
}
{
"error": {
"message": "无效的令牌",
"type": "invalid_request_error"
}
}
{
"error": {
"message": "余额不足",
"type": "insufficient_quota"
}
}
{
"error": {
"message": "rate limit exceeded",
"type": "rate_limit_exceeded"
}
}
{
"code": "do_request_failed",
"message": "upstream request failed"
}
Seedance 2.0 创建视频任务
Seedance 2.0 视频生成接口用于提交文生视频、首帧生视频、首尾帧生视频和参考素材生成任务。- 异步处理模式,提交成功后返回视频任务 ID。
- 支持
doubao-seedance-2-0-260128、doubao-seedance-2-0-fast-260128。 - 使用
application/json提交;素材字段传公网 URL 或asset://{asset_id}。 - 支持首帧图、尾帧图、参考图、参考视频和参考音频 URL。
last_image必须和first_image同时传入。
方法与路径
POST /v1/videos
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": false
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-fast-260128",
"prompt": "让画面中的人物自然转身,看向镜头并微笑,背景灯光轻微闪烁",
"duration": 5,
"aspect_ratio": "9:16",
"first_image": "https://example.com/assets/first-frame.png"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "从首帧自然过渡到尾帧,保持人物服装和场景一致,动作连贯",
"duration": 6,
"aspect_ratio": "16:9",
"first_image": "https://example.com/assets/opening-frame.png",
"last_image": "https://example.com/assets/ending-frame.png"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考图片中的产品外观、参考视频的镜头运动,并使用参考音频作为背景音乐,生成广告感短视频",
"duration": 6,
"aspect_ratio": "16:9",
"reference_image_urls": [
"https://example.com/assets/product-front.png",
"https://example.com/assets/product-side.png"
],
"reference_video_urls": [
"https://example.com/assets/camera-motion.mp4"
],
"reference_audio_urls": [
"https://example.com/assets/background-music.mp3"
],
"generate_audio": true
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考视频的运动节奏和音频情绪,生成一段自然真实的短片",
"duration": 8,
"aspect_ratio": "16:9",
"reference_video_url": "https://example.com/assets/motion.mp4",
"audio_url": "https://example.com/assets/voice.mp3",
"generate_audio": true
}'
import requests
resp = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": False,
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "doubao-seedance-2-0-260128",
prompt: "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
duration: 6,
aspect_ratio: "16:9",
resolution: "720P",
watermark: false,
}),
});
console.log(await response.json());
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]any{
"model": "doubao-seedance-2-0-260128",
"prompt": "雨夜街头,一位穿红色雨衣的女孩慢跑,镜头缓慢跟拍,电影感光影",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720P",
"watermark": false,
}
body, err := json.Marshal(payload)
if err != nil {
panic(err)
}
req, err := http.NewRequest("POST", "https://magic666.top/v1/videos", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(respBody))
}
文件 URL 与素材引用
Seedance 2.0 的素材字段只接收 URL 字符串,不直接接收二进制文件。使用本地图片、视频或音频时,先把文件上传到服务端可访问的公网 URL,再填入对应字段;也可以先调用 创建素材,再用asset://{asset_id} 引用素材。
通过素材接口得到的 Result.Id 是裸素材 ID,例如 asset-20260528143012-a8x7k。在视频生成请求中引用它时,需要加上 asset:// 前缀:
asset://asset-20260528143012-a8x7k
GET /api/asset/get?id=asset-20260528143012-a8x7k
asset://{asset_id} 的字段:
| 字段 | 用途 | 示例 |
|---|---|---|
first_image | 首帧图 | "first_image": "asset://asset-20260528143012-a8x7k" |
last_image | 尾帧图 | "last_image": "asset://asset-20260528143351-b2n6q" |
reference_image_urls | 多张参考图 | "reference_image_urls": ["asset://asset-20260528143012-a8x7k"] |
reference_video_url | 单个参考视频 | "reference_video_url": "asset://asset-20260528143708-k9m2p" |
reference_video_urls | 多个参考视频 | "reference_video_urls": ["asset://asset-20260528143708-k9m2p"] |
reference_audios | 参考音频数组 | "reference_audios": ["asset://asset-20260528144123-r4s6n"] |
reference_audio_urls | 参考音频 URL 数组 | "reference_audio_urls": ["asset://asset-20260528144123-r4s6n"] |
audio_url | 单个参考音频 | "audio_url": "asset://asset-20260528144123-r4s6n" |
使用素材 ID 前,建议先调用
GET /api/asset/get,确认 Result.Status 已经变为 Active。响应示例
{
"id": "task_01jz8s3dbke8p9vq2m8r9a7gk4",
"object": "video",
"created": 1790557800,
"model": "doubao-seedance-2-0-260128",
"status": "queued"
}
{
"code": "invalid_request",
"message": "prompt is required"
}
{
"error": {
"message": "无效的令牌",
"type": "invalid_request_error"
}
}
{
"error": {
"message": "余额不足",
"type": "insufficient_quota"
}
}
{
"error": {
"message": "rate limit exceeded",
"type": "rate_limit_exceeded"
}
}
{
"code": "do_request_failed",
"message": "upstream request failed"
}
认证
Authorization: Bearer YOUR_API_KEY
Body
string
required
模型名称。支持标准档
doubao-seedance-2-0-260128 和 fast 档 doubao-seedance-2-0-fast-260128。string
required
视频生成提示词。
number
视频时长,单位秒。当前推荐使用该字段传入时长。
string
画幅比例。支持
21:9、16:9、4:3、1:1、3:4、9:16。string
固定输出尺寸,例如
1280x720。该字段只接收固定尺寸,不接收 16:9 这类比例写法。string
输出清晰度,例如
480P、720P、1080P。具体可用值以模型档位为准。boolean
是否添加水印。
boolean
是否启用音频生成或音频参考。传
true 时可同时提供 reference_audios、reference_audio_urls 或 audio_url。string
首帧图 URL 或素材引用 URI。可以传公网 URL,也可以传
asset://asset-20260528143012-a8x7k。string
尾帧图 URL 或素材引用 URI。必须和
first_image 同时使用。array<string>
参考图片 URL 或素材引用 URI 数组。适合传入主体、风格或产品参考图。
string
单个参考视频 URL 或素材引用 URI。
array<string>
多个参考视频 URL 或素材引用 URI。适合传入镜头运动或动作参考。
array<string>
参考音频 URL 或素材引用 URI 数组。
array<string>
参考音频 URL 或素材引用 URI 数组。
string
单个参考音频 URL 或素材引用 URI。
Response
string
视频任务 ID。后续用
GET /v1/videos/{id} 查询结果。string
对象类型,通常为
video。integer
任务创建时间戳。
string
本次任务使用的模型。
string
任务状态。常见值为
queued、in_progress、completed、failed。string
任务完成后的公开视频 URL。提交阶段通常为空,查询完成任务时返回。
integer
实际生成的视频时长。上游返回该字段时透出。
integer
任务计费用量。上游返回该字段时透出。
string
任务失败原因。
使用场景
文生视频
只传model、prompt、duration 和 aspect_ratio,适合从纯文本生成视频。
{
"model": "doubao-seedance-2-0-fast-260128",
"prompt": "清晨海边,航拍镜头掠过浪花,阳光穿过薄雾",
"duration": 5,
"aspect_ratio": "16:9"
}
首帧生视频
传入first_image,让静态图中的主体动起来。
{
"model": "doubao-seedance-2-0-260128",
"prompt": "让人物自然抬头,微笑,看向镜头",
"duration": 6,
"aspect_ratio": "9:16",
"first_image": "https://example.com/assets/person-first-frame.png"
}
首尾帧生视频
同时传入first_image 和 last_image,用于约束视频开头和结尾。
{
"model": "doubao-seedance-2-0-260128",
"prompt": "从首帧自然过渡到尾帧,保持人物身份和场景连续",
"duration": 6,
"aspect_ratio": "16:9",
"first_image": "https://example.com/assets/opening-frame.png",
"last_image": "https://example.com/assets/ending-frame.png"
}
使用素材 ID 生成视频
先用 创建素材 注册图片、视频或音频,再把返回的Result.Id 拼成 asset://{asset_id} 传入视频生成请求。
{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考素材中的产品外观和镜头运动,生成一条广告感短视频",
"duration": 6,
"aspect_ratio": "16:9",
"reference_image_urls": ["asset://asset-20260528143012-a8x7k"],
"reference_video_urls": ["asset://asset-20260528143708-k9m2p"],
"reference_audio_urls": ["asset://asset-20260528144123-r4s6n"],
"generate_audio": true
}
多参考素材生成
同时传参考图、参考视频和参考音频,用于控制主体外观、镜头语言和声音风格。{
"model": "doubao-seedance-2-0-260128",
"prompt": "参考产品图和镜头运动生成一条广告感短视频",
"duration": 6,
"aspect_ratio": "16:9",
"reference_image_urls": ["https://example.com/assets/product.png"],
"reference_video_url": "https://example.com/assets/motion.mp4",
"audio_url": "https://example.com/assets/music.mp3",
"generate_audio": true
}
注意事项
prompt和model必填。- 推荐使用
duration传入视频时长。 aspect_ratio只支持枚举值:21:9、16:9、4:3、1:1、3:4、9:16。size只支持固定尺寸,不支持16:9这类比例值。last_image必须和first_image同时传入。- 素材字段只接收公网 URL 或
asset://{asset_id},不支持直接上传二进制文件。 asset://{asset_id}只用于视频生成的素材字段;查询素材状态时不要给id参数加asset://前缀。
相关页面
⌘I