查询视频任务
curl --request GET \
--url https://api.heizhu.lol/v1/videos/{task_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.heizhu.lol/v1/videos/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heizhu.lol/v1/videos/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "in_progress",
"progress": 42,
"created_at": 1788480000
}查詢影片任務
使用任務 ID 查詢進度、最終狀態和失敗原因。
GET
https://api.heizhu.lol
/
v1
/
videos
/
{task_id}
查询视频任务
curl --request GET \
--url https://api.heizhu.lol/v1/videos/{task_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.heizhu.lol/v1/videos/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heizhu.lol/v1/videos/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "in_progress",
"progress": 42,
"created_at": 1788480000
}使用建立介面返回的任務 ID 查詢影片生成狀態。
string
必填
建立影片任務時返回的
id。請求示例
curl https://api.heizhu.lol/v1/videos/task_xxxxxxxxxx \
-H "Authorization: Bearer $BLACKPIG_API_KEY"
響應欄位
string
必填
平臺任務 ID。
string
必填
物件型別,固定為
video。string
必填
任務使用的模型名稱。
string
必填
queued、in_progress、completed、failed 或 unknown。integer
必填
任務進度百分比。
integer
必填
建立時間的 Unix 時間戳。
integer
任務結束時間的 Unix 時間戳。任務尚未結束時可能不存在。
處理中
{
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "in_progress",
"progress": 42,
"created_at": 1788480000
}
已完成
{
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "completed",
"progress": 100,
"created_at": 1788480000,
"completed_at": 1788480120
}
已失敗
{
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "failed",
"progress": 0,
"created_at": 1788480000,
"completed_at": 1788480031,
"error": {
"code": "video_generation_failed",
"message": "任务失败原因"
}
}
建議每 5 至 10 秒查詢一次。任務查詢的臨時網路錯誤不改變任務本身狀態。
授權
在控制台创建的黑猪AI API Token。
路徑參數
创建视频任务时返回的任务 ID。
範例:
"task_xxxxxxxxxx"
回應
任务状态
平台任务 ID。
Allowed value:
"video"任务使用的模型。
可用選項:
queued, in_progress, completed, failed, unknown 必填範圍:
0 <= x <= 100创建时间的 Unix 时间戳。
任务结束时间的 Unix 时间戳。
Show child attributes
Show child attributes
