查询视频生成任务列表
curl --request GET \
--url https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/byteplus/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.powertokens.ai/byteplus/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 => "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.powertokens.ai/byteplus/api/v3/contents/generations/tasks"
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.powertokens.ai/byteplus/api/v3/contents/generations/tasks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks")
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{
"total": 2,
"items": [
{
"id": "cgt-2026****-****",
"model": "doubao-seedance-2-0-260128",
"status": "succeeded",
"content": {
"video_url": "https://ark-acg-cn-beijing.tos-cn-beijing.volces.com/xxx"
},
"usage": {
"completion_tokens": 109586,
"total_tokens": 109586
},
"created_at": 1779354227,
"updated_at": 1779354426,
"seed": 70172,
"resolution": "720p",
"ratio": "4:3",
"duration": 5,
"framespersecond": 24,
"service_tier": "default",
"execution_expires_after": 172800,
"generate_audio": true,
"draft": false,
"priority": 0
},
{
"id": "cgt-2026****-****",
"model": "doubao-seedance-2-0-260128",
"status": "succeeded",
"content": {
"video_url": "https://ark-acg-cn-beijing.tos-cn-beijing.volces.com/xxx"
},
"usage": {
"completion_tokens": 49761,
"total_tokens": 49761
},
"created_at": 1779353985,
"updated_at": 1779354268,
"seed": 68292,
"resolution": "480p",
"ratio": "3:4",
"duration": 5,
"framespersecond": 24,
"service_tier": "default",
"execution_expires_after": 172800,
"generate_audio": true,
"draft": false,
"priority": 0
}
]
}字节API兼容
查询视频生成任务列表
通过传入筛选参数,查询符合条件的视频生成任务。仅支持查询最近 7 天的任务记录,时间区间为 [T-7天, T),其中 T 为请求发起时刻的 UTC 时间戳(精确到秒)。
说明:下面参数为Query String Parameters,在URL String中传入。
GET
/
byteplus
/
api
/
v3
/
contents
/
generations
/
tasks
查询视频生成任务列表
curl --request GET \
--url https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/byteplus/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.powertokens.ai/byteplus/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 => "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.powertokens.ai/byteplus/api/v3/contents/generations/tasks"
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.powertokens.ai/byteplus/api/v3/contents/generations/tasks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks")
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{
"total": 2,
"items": [
{
"id": "cgt-2026****-****",
"model": "doubao-seedance-2-0-260128",
"status": "succeeded",
"content": {
"video_url": "https://ark-acg-cn-beijing.tos-cn-beijing.volces.com/xxx"
},
"usage": {
"completion_tokens": 109586,
"total_tokens": 109586
},
"created_at": 1779354227,
"updated_at": 1779354426,
"seed": 70172,
"resolution": "720p",
"ratio": "4:3",
"duration": 5,
"framespersecond": 24,
"service_tier": "default",
"execution_expires_after": 172800,
"generate_audio": true,
"draft": false,
"priority": 0
},
{
"id": "cgt-2026****-****",
"model": "doubao-seedance-2-0-260128",
"status": "succeeded",
"content": {
"video_url": "https://ark-acg-cn-beijing.tos-cn-beijing.volces.com/xxx"
},
"usage": {
"completion_tokens": 49761,
"total_tokens": 49761
},
"created_at": 1779353985,
"updated_at": 1779354268,
"seed": 68292,
"resolution": "480p",
"ratio": "3:4",
"duration": 5,
"framespersecond": 24,
"service_tier": "default",
"execution_expires_after": 172800,
"generate_audio": true,
"draft": false,
"priority": 0
}
]
}授权
在请求头中传入 Authorization: Bearer <token>。
查询参数
返回结果的页码。
必填范围:
1 <= x <= 500每页显示的结果数量。
必填范围:
1 <= x <= 500过滤参数,查询某个任务状态。
- queued:排队中的任务。
- running:运行中任务。
- cancelled:取消的任务。
- succeeded:任务的成功。
- failed:失败的任务。
可用选项:
queued, running, cancelled, succeeded, failed 视频生成任务 ID,精确搜索,支持同时搜索多个任务 ID。需通过重复参数名的方式传递,例如:filter.task_ids=id1&filter.task_ids=id2。
与返回参数不同,该字段为任务使用的推理接入点 ID,精确搜索。
处理任务使用的服务等级。default 表示在线推理模式,flex 表示离线推理模式。
可用选项:
default, flex ⌘I