查询视频任务
curl --request GET \
--url https://xuwuai.com/v1/videos/{video_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://xuwuai.com/v1/videos/{video_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://xuwuai.com/v1/videos/{video_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://xuwuai.com/v1/videos/{video_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://xuwuai.com/v1/videos/{video_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://xuwuai.com/v1/videos/{video_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/v1/videos/{video_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": "video_abc123",
"object": "video",
"status": "in_progress",
"model": "veo-3.1-fast-generate-preview",
"progress": 45
}视频
视频查询
查询视频生成任务的状态和结果
GET
/
v1
/
videos
/
{video_id}
查询视频任务
curl --request GET \
--url https://xuwuai.com/v1/videos/{video_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://xuwuai.com/v1/videos/{video_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://xuwuai.com/v1/videos/{video_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://xuwuai.com/v1/videos/{video_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://xuwuai.com/v1/videos/{video_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://xuwuai.com/v1/videos/{video_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/v1/videos/{video_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": "video_abc123",
"object": "video",
"status": "in_progress",
"model": "veo-3.1-fast-generate-preview",
"progress": 45
}查询已创建的视频生成任务的当前状态、进度和结果。
任务完成:
查询视频任务
通过视频 ID 查询任务详情:curl "https://xuwuai.com/v1/videos/$VIDEO_ID" \
-H "Authorization: Bearer $TOKEN"
响应示例
任务进行中:{
"id": "video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737",
"object": "video",
"created_at": 1762789802,
"status": "in_progress",
"model": "sora-2",
"prompt": "百事可乐宣传片",
"progress": 45,
"seconds": "4",
"size": "720x1280"
}
{
"id": "video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737",
"object": "video",
"created_at": 1762789802,
"completed_at": 1762789891,
"expires_at": 1762793491,
"status": "completed",
"model": "sora-2",
"prompt": "百事可乐宣传片",
"progress": 100,
"seconds": "4",
"size": "720x1280"
}
状态说明
queued:任务已排队,等待处理in_progress/processing:正在生成视频completed/success:生成完成,可下载视频failed:生成失败
不同上游和任务来源可能返回
in_progress/completed 或兼容旧异步任务口径的 processing/success。客户端判断时建议同时兼容这两组状态。响应字段说明
id:视频任务的唯一标识符created_at:任务创建时间戳completed_at:任务完成时间戳(仅在 completed / success 状态下存在)expires_at:视频过期时间戳(仅在 completed / success 状态下存在)progress:处理进度(0-100)seconds:视频时长(字符串格式)size:视频分辨率
下载视频内容
直接下载生成的视频文件:curl -L "https://xuwuai.com/v1/videos/$VIDEO_ID/content" \
-H "Authorization: Bearer $TOKEN" \
--output "$VIDEO_ID.mp4"
Authorizations
API Key
Path Parameters
视频任务 ID
Response
查询成功
任务 ID
Example:
"video_abc123"
Available options:
video Example:
"video"
创建时间戳
Example:
1761234567
完成时间戳
任务状态
Available options:
queued, in_progress, completed, failed Example:
"queued"
模型名称
Example:
"veo-3.1-fast-generate-preview"
提示词
进度(0-100)
Example:
0
视频时长
Example:
6
分辨率
Example:
"1280x720"
视频直链(完成后返回)
Show child attributes
Show child attributes