查询任务(seedance 兼容协议响应)
curl --request GET \
--url https://api.example.com/v1/seedance/video/generations/{taskId} \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/v1/seedance/video/generations/{taskId}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/v1/seedance/video/generations/{taskId}', 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/v1/seedance/video/generations/{taskId}",
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: <authorization>"
],
]);
$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/v1/seedance/video/generations/{taskId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.example.com/v1/seedance/video/generations/{taskId}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/seedance/video/generations/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"created_at": 123,
"updated_at": 123,
"framespersecond": 123,
"generate_audio": true,
"safety_identifier": "<string>",
"service_tier": "<string>",
"execution_expires_after": 123,
"draft_task_id": "<string>",
"id": "<string>",
"model": "<string>",
"status": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"content": {
"video_url": "<string>",
"last_frame_url": "<string>"
},
"usage": {
"completion_tokens": 123,
"total_tokens": 123
},
"seed": 123,
"resolution": "<string>",
"ratio": "<string>",
"duration": 123,
"frames": "<string>",
"priority": 123,
"draft": true
}视频
Seedance 视频任务查询
查询 Seedance 兼容视频任务的状态与生成结果
GET
/
v1
/
seedance
/
video
/
generations
/
{taskId}
查询任务(seedance 兼容协议响应)
curl --request GET \
--url https://api.example.com/v1/seedance/video/generations/{taskId} \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/v1/seedance/video/generations/{taskId}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/v1/seedance/video/generations/{taskId}', 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/v1/seedance/video/generations/{taskId}",
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: <authorization>"
],
]);
$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/v1/seedance/video/generations/{taskId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.example.com/v1/seedance/video/generations/{taskId}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/seedance/video/generations/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"created_at": 123,
"updated_at": 123,
"framespersecond": 123,
"generate_audio": true,
"safety_identifier": "<string>",
"service_tier": "<string>",
"execution_expires_after": 123,
"draft_task_id": "<string>",
"id": "<string>",
"model": "<string>",
"status": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"content": {
"video_url": "<string>",
"last_frame_url": "<string>"
},
"usage": {
"completion_tokens": 123,
"total_tokens": 123
},
"seed": 123,
"resolution": "<string>",
"ratio": "<string>",
"duration": 123,
"frames": "<string>",
"priority": 123,
"draft": true
}使用创建任务时返回的
id 查询状态。响应保持 Seedance 协议字段,成功后可从 content.video_url 获取视频地址。
建议每 10-15 秒轮询一次。设置
return_last_frame: true 后,成功响应还会包含可用于衔接下一段视频的尾帧地址。轮询示例
Python
import time
import requests
task_id = "cgt-20260730120000-a1b2c3"
url = f"https://api.haitoken.ai/v1/seedance/video/generations/{task_id}"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
while True:
result = requests.get(url, headers=headers).json()
status = result.get("status")
if status == "succeeded":
print(result["content"]["video_url"])
break
if status in ("failed", "cancelled", "expired"):
error = result.get("error") or {}
print(error.get("code"), error.get("message"))
break
time.sleep(5)
路径参数
响应
200 - application/json
任务创建时间(Unix 时间戳,秒)
任务最后更新时间(Unix 时间戳,秒)
生成视频帧率
生成视频帧率 生成的视频是否包含与视觉同步的音频。此参数仅在seedance 2.0 & 2.0 fast和seedance 1.5 pro中支持。 true:模型输出一个同步音频的视频。 false:输出无声视频。
终端用户的唯一标识符。如果在创建视频生成任务时设置此参数,则API将返回不变的参数。
服务层级:default 在线推理 / flex 离线推理
任务超时阈值(秒),以秒为单位
草稿视频任务ID。当根据草稿视频生成正式视频时,返回该参数
任务ID
模型名称
任务状态:queued / running / succeeded / failed / expired / cancelled
错误信息(任务失败时返回)
Show child attributes
Show child attributes
生成结果内容(任务成功时返回)
Show child attributes
Show child attributes
Token 用量统计
Show child attributes
Show child attributes
随机种子
生成视频分辨率:480p / 720p / 1080p / 4k
生成视频宽高比:16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9
生成视频时长(秒)
生成视频帧数 注意:只返回duration和frames参数中的一个。如果在创建视频生成请求中指定了帧数,则将返回帧数。
当前请求的执行优先级
生成的视频是否为草稿视频。此参数仅由seedance 1.5 pro返回。 true:当前输出为草稿视频。 false:当前输出为标准视频。