查询视频生成任务
curl --request GET \
--url https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}', 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/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.looprouter.com/api/v3/contents/generations/tasks/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"status": "queued",
"content": {
"video_url": "<string>",
"last_frame_url": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"usage": {
"completion_tokens": 123,
"total_tokens": 123
},
"seed": 123,
"resolution": "<string>",
"ratio": "<string>",
"duration": 123,
"framespersecond": 123,
"generate_audio": true,
"output_format": "mp4",
"created_at": 123,
"updated_at": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}Doubao Seedance
查询视频生成任务
查询任务状态与结果。状态机:queued → running → succeeded / failed / cancelled / expired。
成功后 content.video_url 为临时成片下载地址(下载时不要携带 Authorization 头)。
官方原始视频 URL 有效期为 24 小时,Seedance 2.5 视频 URL 最多下载 100 次;平台转存链接以实际存储策略为准,请及时转存。
Seedance 2.5 在上游返回时提供 output_format(mp4 / mov);旧任务或上游未返回时省略。
GET
/
api
/
v3
/
contents
/
generations
/
tasks
/
{task_id}
查询视频生成任务
curl --request GET \
--url https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}', 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/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.looprouter.com/api/v3/contents/generations/tasks/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/api/v3/contents/generations/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"status": "queued",
"content": {
"video_url": "<string>",
"last_frame_url": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"usage": {
"completion_tokens": 123,
"total_tokens": 123
},
"seed": 123,
"resolution": "<string>",
"ratio": "<string>",
"duration": 123,
"framespersecond": 123,
"generate_audio": true,
"output_format": "mp4",
"created_at": 123,
"updated_at": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}授权
LoopRouter API Key(sk- 开头),在控制台「令牌」页创建
路径参数
创建任务时返回的任务 ID
响应
任务详情
可用选项:
queued, running, succeeded, failed, cancelled, expired Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
输出视频的整数秒约数。Seedance 2.5 按实际总帧数 / 24 向下取整,不保证等于文件精确时长
Seedance 2.5 上游生成视频的格式;旧任务或上游未返回时省略
可用选项:
mp4, mov