查询图片任务状态
curl --request GET \
--url https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations', 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.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations",
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.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations"
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.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations")
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{
"state": "success",
"err_code": "",
"credits": 4,
"payload": "",
"creations": [
{
"id": "your_creations_id",
"url": "https://example.com/generated_image.png",
"cover_url": "https://example.com/cover_image.png"
}
]
}Vidu
Vidu 图片任务状态查询
根据任务ID查询图片生成任务的状态和结果。
GET
/
vidu
/
ent
/
v2
/
tasks
/
{task_id}
/
creations
查询图片任务状态
curl --request GET \
--url https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations', 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.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations",
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.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations"
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.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/vidu/ent/v2/tasks/{task_id}/creations")
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{
"state": "success",
"err_code": "",
"credits": 4,
"payload": "",
"creations": [
{
"id": "your_creations_id",
"url": "https://example.com/generated_image.png",
"cover_url": "https://example.com/cover_image.png"
}
]
}授权
在请求头中传入 Authorization: Bearer <token>。
路径参数
图片创建接口返回的任务ID(例如:POST /vidu/v1/images/reference2image)。
响应
查询成功,返回图片任务状态信息。
任务处理状态:
- created: 任务创建成功
- queueing: 任务排队中
- processing: 任务处理中
- success: 生成成功
- failed: 任务失败
可用选项:
created, queueing, processing, success, failed 失败时返回的错误代码。无错误时为空字符串。
此任务消耗的积分数量。单位:积分。
本次调用使用的透传参数。
本次调用是否使用背景音乐(BGM)。
本次调用是否使用非高峰模式。
生成结果数组。
Show child attributes
Show child attributes
⌘I