查询任务
curl --request GET \
--url https://octopusx.ai/v1/video/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://octopusx.ai/v1/video/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://octopusx.ai/v1/video/query', 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://octopusx.ai/v1/video/query",
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://octopusx.ai/v1/video/query"
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://octopusx.ai/v1/video/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/video/query")
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": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"status": "processing",
"progress": 50,
"created_at": 1774494511
}
{
"id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"status": "completed",
"progress": 100,
"created_at": 1774494511,
"completed_at": 1774494622,
"video_url": "https://example.com/video/aigcVideoGenFile.mp4"
}
统一视频
查询任务
使用 GET /v1/video/query 查询 Vidu 统一视频任务状态与结果。
GET
https://octopusx.ai
/
v1
/
video
/
query
查询任务
curl --request GET \
--url https://octopusx.ai/v1/video/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://octopusx.ai/v1/video/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://octopusx.ai/v1/video/query', 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://octopusx.ai/v1/video/query",
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://octopusx.ai/v1/video/query"
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://octopusx.ai/v1/video/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/video/query")
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": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"status": "processing",
"progress": 50,
"created_at": 1774494511
}
{
"id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"status": "completed",
"progress": 100,
"created_at": 1774494511,
"completed_at": 1774494622,
"video_url": "https://example.com/video/aigcVideoGenFile.mp4"
}
查询任务
Vidu 统一视频任务提交后,通过GET /v1/video/query 查询进度与结果。查询参数使用 id,值为 创建视频 返回的任务 ID。
- 路由入口是
GET /v1/video/query。 - 任务 ID 通过 Query 参数
id传入。 - 返回结构包含
status、progress、video_url等字段。
方法与路径
GET /v1/video/query?id={task_id}
请求示例
curl "https://octopusx.ai/v1/video/query?id=48038932-0ff5-4251-8b4b-7a76c09fd114" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
import requests
resp = requests.get(
"https://octopusx.ai/v1/video/query",
params={"id": "48038932-0ff5-4251-8b4b-7a76c09fd114"},
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
},
timeout=30,
)
print(resp.json())
const params = new URLSearchParams({
id: "48038932-0ff5-4251-8b4b-7a76c09fd114",
});
const response = await fetch(
`https://octopusx.ai/v1/video/query?${params.toString()}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
Accept: "application/json",
},
}
);
console.log(await response.json());
响应示例
{
"id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"status": "processing",
"progress": 50,
"created_at": 1774494511
}
{
"id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
"status": "completed",
"progress": 100,
"created_at": 1774494511,
"completed_at": 1774494622,
"video_url": "https://example.com/video/aigcVideoGenFile.mp4"
}
认证
Authorization: Bearer YOUR_API_KEY
Query Parameters
任务 ID,与创建接口返回的
task_id 一致。Response
任务 ID。
任务状态,常见值包括
processing、failed、completed。进度百分比(0-100)。
创建时间(Unix 时间戳)。
完成时间(Unix 时间戳),仅在任务完成时返回。
视频下载地址,仅在
completed 状态下返回。相关接口
⌘I