Seedance 官方接口
curl --request POST \
--url 'https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks'import requests
url = "https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body视频系列
Seedance 官方接口
Seedance 视频生成官方接口(提交 / 查询 / 下载)
POST
{llmApiOrigin}
/
seedance
/
api
/
v3
/
contents
/
generations
/
tasks
Seedance 官方接口
curl --request POST \
--url 'https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks'import requests
url = "https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{llmApiOrigin}}/seedance/api/v3/contents/generations/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body简介
Seedance 官方接口以model + content[] 参数风格对外提供豆包 Seedance 系列模型的视频生成能力。与统一视频入口不同,这里所有参数都是独立字段(resolution、ratio、duration 等顶层字段),不需要在提示词里写 --标记。内部会路由到火山官方或 TokenPony 渠道,外部调用方无需感知上游差异。
推荐入口:
POST /seedance/api/v3/contents/generations/tasks
GET /seedance/api/v3/contents/generations/tasks/{task_id}
Seedance 1.x 模型仍可走统一视频接口;本入口面向 Seedance 1.5 Pro / 2.0 系列。
涉及真人形象或复用素材时,需要先通过素材库与真人认证创建素材库并用 asset:// 引用。
认证
所有接口使用 Bearer Token:Authorization: Bearer {API_KEY}
Content-Type: application/json
支持模型
| 模型 | 说明 |
|---|---|
doubao-seedance-1-5-pro-251215 | Seedance 1.5 Pro |
doubao-seedance-2-0-260128 | Seedance 2.0 标准模型 |
doubao-seedance-2-0-fast-260128 | Seedance 2.0 Fast 模型 |
doubao-seedance-2-5-260628 | Seedance 2.5(视渠道开通情况) |
模型是否可用取决于服务端渠道配置与上游账号开通情况,未开通的模型提交时可能返回 ModelNotOpen。
创建任务
POST/seedance/api/v3/contents/generations/tasks
最小请求:文生视频
curl -X POST "https://api.shengmoai.com/seedance/api/v3/contents/generations/tasks" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"content": [
{ "type": "text", "text": "小型玻璃立方体在桌面上的产品展示,柔和日光,镜头缓慢推进" }
],
"resolution": "720p",
"ratio": "16:9",
"duration": 4
}'
{
"id": "task_KE1xHCZm0hsd4Uou6CxqVctJCb22LY5G"
}
请求参数(顶层)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 支持的模型之一 |
content | array | 是 | 输入内容数组,至少一个非空 text |
resolution | string | 否 | 例如 720p、1080p;doubao-seedance-2-0-fast-260128 不支持 1080p |
ratio | string | 否 | 画幅:16:9、9:16、1:1 等 |
duration | integer | 否 | 时长(秒)。Seedance 2.0 本地校验 4-15 |
generate_audio | boolean | 否 | 是否生成音频;显式 false 会保留 |
callback_url | string | 否 | 回调地址(是否生效取决于上游,仍建议以查询为准) |
return_last_frame | boolean | 否 | 是否返回尾帧 |
seed | integer | 否 | 随机种子 |
watermark | boolean | 否 | 水印 |
camera_fixed | boolean | 否 | 固定镜头 |
frames | integer | 否 | 帧数 |
只建议使用上表字段,未列出的字段不保证生效。
content[] 内容类型
| type | 必填字段 | 说明 |
|---|---|---|
text | text | 文本提示词,至少一个非空 |
image_url | image_url.url | 图片输入,用 role 表达语义 |
video_url | video_url.url | 视频输入(参考视频/续写) |
audio_url | audio_url.url | 音频输入 |
图片 role 语义
| role | 语义 |
|---|---|
reference_image | 参考图(人物、主体、风格) |
first_image(别名 first_frame) | 首帧图,首帧生视频 |
last_image(别名 last_frame) | 尾帧图,与 first_image 一起表达首尾帧生成 |
first_image + last_image 两张图;不要把普通参考图设成 first_image。
常见生成场景
参考图 + 文生视频:{
"model": "doubao-seedance-2-0-260128",
"content": [
{ "type": "image_url", "role": "reference_image", "image_url": { "url": "https://example.com/assets/character.png" } },
{ "type": "text", "text": "让参考图里的角色在镜头前自然挥手" }
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
{
"model": "doubao-seedance-2-0-260128",
"content": [
{ "type": "image_url", "role": "first_image", "image_url": { "url": "https://example.com/assets/first.png" } },
{ "type": "text", "text": "从这张首帧开始,镜头缓慢向右移动" }
],
"duration": 5
}
{
"model": "doubao-seedance-2-0-260128",
"content": [
{ "type": "image_url", "role": "first_image", "image_url": { "url": "..." } },
{ "type": "image_url", "role": "last_image", "image_url": { "url": "..." } },
{ "type": "text", "text": "画面从首帧自然过渡到尾帧,动作连贯" }
],
"duration": 5
}
content 中放 video_url / audio_url 对象即可(是否生效取决于模型与上游)。
查询任务
GET/seedance/api/v3/contents/generations/tasks/{task_id}
curl "https://api.shengmoai.com/seedance/api/v3/contents/generations/tasks/task_KE1xHCZm0hsd2UouCy" \
-H "Authorization: Bearer sk-xxxxxxxxxx"
| status | 含义 | 是否终态 |
|---|---|---|
queued | 排队中 | 否 |
processing | 生成中 | 否 |
succeeded | 已完成 | 是 |
failed | 已失败 | 是 |
content.video_url 下载结果视频):
{
"id": "task_KE1xHCZm0hsd2UoucycCq",
"model": "doubao-seedance-2-0-260128",
"status": "succeeded",
"content": { "video_url": "https://example-cdn.com/path/result.mp4" },
"created_at": 1782642668,
"updated_at": 1782642876
}
status):
{
"id": "task_xxx",
"status": "failed",
"error": { "code": "task_failed", "message": "upstream error message" }
}
下载视频
-
直接下载
content.video_url(临时签名 URL,尽快下载):curl -L "https://example-cdn.com/path/result.mp4" -o result.mp4 -
或通过内容代理:
GET /v1/videos/{task_id}/content(推荐用于代理下载,详见视频内容获取):curl -L "https://api.shengmoai.com/v1/videos/task_KE1xHCZm0hsd2UooUyCyc/content" \ -H "Authorization: Bearer sk-xxxxxxxxxx" -o result.mp4
错误处理
| 场景 | 错误信息 |
|---|---|
缺 model | model is required |
| 模型不在支持列表 | unsupported seedance model: {model} |
content 无文本 | text content is required |
| image/video/audio 缺 URL | image_url.url is required 等 |
| 尾帧与参考图混用 | last frame image content cannot be mixed with reference image |
| Seedance 2.0 时长超范围 | duration must be between 4 and 15 |
| Fast 模型用 1080p | doubao-seedance-2-0-fast-260128 does not support 1080p |
- 提交返回 404 且响应是 HTML 页面(
<!doctype html>)→ 请求没到后端,多半是反代只转发了带斜杠的轮询路径,漏掉了提交路径;请把整个/seedance/前缀转发到服务。 - 查询一直
queued/processing→ 保留task_id,降低轮询频率稍后再查。 ModelNotOpen→ 该上游账号未开通对应模型,联系服务方确认渠道。
相关页面
视频生成总览
异步流程与入口选择
视频内容获取
通过 /v1/videos//content 代理获取视频
素材库与真人认证
素材管理、真人认证与 asset:// 引用
