curl --request POST \
--url https://api.looprouter.com/api/v3/contents/generations/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
'import requests
url = "https://api.looprouter.com/api/v3/contents/generations/tasks"
payload = {
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedance-2-0-260128',
content: [{type: 'text', text: '海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上'}],
resolution: '720p',
ratio: '16:9',
duration: 5
})
};
fetch('https://api.looprouter.com/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.looprouter.com/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",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doubao-seedance-2-0-260128',
'content' => [
[
'type' => 'text',
'text' => '海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上'
]
],
'resolution' => '720p',
'ratio' => '16:9',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.looprouter.com/api/v3/contents/generations/tasks"
payload := strings.NewReader("{\n \"model\": \"doubao-seedance-2-0-260128\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上\"\n }\n ],\n \"resolution\": \"720p\",\n \"ratio\": \"16:9\",\n \"duration\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.looprouter.com/api/v3/contents/generations/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedance-2-0-260128\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上\"\n }\n ],\n \"resolution\": \"720p\",\n \"ratio\": \"16:9\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/api/v3/contents/generations/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedance-2-0-260128\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上\"\n }\n ],\n \"resolution\": \"720p\",\n \"ratio\": \"16:9\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"id": "task_xxxx"
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}创建视频生成任务
提交一个异步视频生成任务。仅返回任务 ID,成片需通过查询接口轮询获取。
文生视频、图生视频、多模态参考共用本接口,靠 content 数组组合区分模式。
Seedance 2.5 的任务类型还取决于提示词;首帧 / 首尾帧、编辑、延长任务仅支持 ratio=adaptive,编辑任务仅支持 duration=-1。
平台不会按 edit / extend 自动修正 ratio 或 duration;调用方须设置符合约束的值。编辑应锁定比例和时长,延长只需锁定比例,时长仍可选 -1 或 4–30 秒整数。
Seedance 2.5 支持 output_format(mp4 / mov)和 omni_reference_task_type(auto / reference / edit / extend),参数值与任务约束由上游校验。其他模型请勿传入这两个字段。
显式请求 mov 时保留上游原生规格产物;省略格式或指定 mp4 的任务按平台默认交付策略处理。
curl --request POST \
--url https://api.looprouter.com/api/v3/contents/generations/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
'import requests
url = "https://api.looprouter.com/api/v3/contents/generations/tasks"
payload = {
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedance-2-0-260128',
content: [{type: 'text', text: '海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上'}],
resolution: '720p',
ratio: '16:9',
duration: 5
})
};
fetch('https://api.looprouter.com/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.looprouter.com/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",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doubao-seedance-2-0-260128',
'content' => [
[
'type' => 'text',
'text' => '海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上'
]
],
'resolution' => '720p',
'ratio' => '16:9',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.looprouter.com/api/v3/contents/generations/tasks"
payload := strings.NewReader("{\n \"model\": \"doubao-seedance-2-0-260128\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上\"\n }\n ],\n \"resolution\": \"720p\",\n \"ratio\": \"16:9\",\n \"duration\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.looprouter.com/api/v3/contents/generations/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedance-2-0-260128\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上\"\n }\n ],\n \"resolution\": \"720p\",\n \"ratio\": \"16:9\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/api/v3/contents/generations/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedance-2-0-260128\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"海边日落,无人机航拍视角缓缓推进,金色阳光洒在海面上\"\n }\n ],\n \"resolution\": \"720p\",\n \"ratio\": \"16:9\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"id": "task_xxxx"
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}授权
LoopRouter API Key(sk- 开头),在控制台「令牌」页创建
请求体
模型名,如 doubao-seedance-2-0-260128、doubao-seedance-2-5-260628
生成素材数组(文本 / 图片 / 视频 / 音频)
Show child attributes
Show child attributes
输出分辨率。Seedance 2.0 支持 480p / 720p / 1080p / 4k;Seedance 2.5 支持 480p / 720p / 1080p(默认 720p,暂不支持 4k,传入 4k 返回 400 且不扣费)。具体可用档位以控制台「模型广场」为准
480p, 720p, 1080p, 4k 画面宽高比,默认 adaptive。Seedance 2.5 的首帧 / 首尾帧、视频编辑、视频延长任务仅支持 adaptive;文生视频与参考生成可指定比例
16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive 输出时长(秒)。Seedance 2.0 为 4–15 秒整数或 -1;Seedance 2.5 为 4–30 秒整数或 -1(默认 -1,智能选择),编辑任务仅支持 -1
是否生成同步音频,默认 true;有声视频输出为单声道
是否叠加 AI 生成水印,默认 false
仅 Seedance 2.5 支持,默认 mp4。输出容器格式;mov 适合专业后期,保留上游原生规格产物。其他模型请勿传入
mp4, mov 仅 Seedance 2.5 全模态参考任务支持,默认 auto。reference 为参考生成;edit 为视频编辑,须包含 4–30 秒 reference_video、ratio=adaptive、duration=-1;extend 为视频延长,须包含 reference_video、ratio=adaptive。其他模型请勿传入
auto, reference, edit, extend 旧版 Seedance 1.x 随机种子参数;官方未将 Seedance 2.0 / 2.5 列入支持模型,请勿在这两代模型的请求中传入
成功后额外返回无水印 PNG 末帧图片,尺寸与输出视频一致
从任务创建时间起计算的超时秒数,超时未完成转为 expired
3600 <= x <= 259200响应
任务创建成功
任务 ID,用于查询任务状态