查询视频生成任务
curl --request GET \
--url https://api.tensorslab.com/v1/video/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorslab.com/v1/video/contents/generations/tasks/{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>",
"file_url": "<string>"
},
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"tool_usage": {}
},
"created_at": 123,
"updated_at": 123,
"error": {
"code": "<string>",
"message": "<string>"
},
"framespersecond": 123,
"draft_task_id": "<string>",
"resolution": "<string>",
"ratio": "<string>",
"duration": 123,
"frames": 123,
"seed": 123,
"execution_expires_after": 123,
"generate_audio": true,
"tools": [
{}
],
"output_format": "<string>",
"service_tier": "<string>",
"draft": true,
"priority": 4,
"safety_identifier": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}视频生成
查询视频任务
查询 Seedance 2.0 / 2.5 任务状态与视频结果
查询视频生成任务
curl --request GET \
--url https://api.tensorslab.com/v1/video/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{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.tensorslab.com/v1/video/contents/generations/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorslab.com/v1/video/contents/generations/tasks/{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>",
"file_url": "<string>"
},
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"tool_usage": {}
},
"created_at": 123,
"updated_at": 123,
"error": {
"code": "<string>",
"message": "<string>"
},
"framespersecond": 123,
"draft_task_id": "<string>",
"resolution": "<string>",
"ratio": "<string>",
"duration": 123,
"frames": 123,
"seed": 123,
"execution_expires_after": 123,
"generate_audio": true,
"tools": [
{}
],
"output_format": "<string>",
"service_tier": "<string>",
"draft": true,
"priority": 4,
"safety_identifier": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}
使用创建任务返回的
id 和同一账号的 API Key 查询。Seedance 2.0、2.5 共用此接口。点击“试一试”,自动带入本次会话中最近创建的任务 ID 和 API Key,也可手动填写。
创建成功后也可直接点击“查询任务”,无需重复填写。API Key 仅在当前页面会话内共用,刷新或关闭页面后清除。
queued 表示已排队,running 表示处理中;succeeded 时读取 content.video_url。若状态为 failed、cancelled 或 expired,查看 error.code 和 error.message。授权
响应
OK