Wan
Bir Wan videosunu retrieve edin
Durum, ilerleme, zaman damgaları ve tamamlanan video URL’si dahil olmak üzere, task ID ile bir Wan video görevini retrieve edin.
GET
/
v1
/
videos
/
{task_id}
cURL
curl https://api.cometapi.com/v1/videos/<TASK_ID> \
-H "Authorization: Bearer $COMETAPI_KEY"import os
import time
import requests
TASK_ID = "<TASK_ID>"
headers = {"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]}
terminal_statuses = {"completed", "failed", "error"}
while True:
response = requests.get(
f"https://api.cometapi.com/v1/videos/{TASK_ID}",
headers=headers,
timeout=60,
)
response.raise_for_status()
task = response.json()
print(task["status"], task.get("progress"))
if task["status"] in terminal_statuses:
print(task.get("video_url"))
break
time.sleep(10)
const TASK_ID = "<TASK_ID>";
const terminalStatuses = new Set(["completed", "failed", "error"]);
while (true) {
const response = await fetch(
`https://api.cometapi.com/v1/videos/${TASK_ID}`,
{ headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` } },
);
const task = await response.json();
console.log(task.status, task.progress);
if (terminalStatuses.has(task.status)) {
console.log(task.video_url);
break;
}
await new Promise((resolve) => setTimeout(resolve, 10_000));
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/v1/videos/{task_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://api.cometapi.com/v1/videos/{task_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://api.cometapi.com/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/v1/videos/{task_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": "task_example",
"model": "wan2.6",
"object": "video",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}Bir Wan video görevi oluşturduktan sonra bu endpoint’i kullanın. Görev durumunu döndürür ve görev tamamlandıktan sonra
video_url bilgisini içerir.
Bu alanları kontrol edin
status, görevinqueued,in_progress,completed,failedveyaerrordurumunda olup olmadığını söyler.progress, yaklaşık bir tamamlanma yüzdesidir.video_url, tamamlanmış yanıtlarda görünür.error, bir görev başarısız olduğunda görünür.
Polling akışı
1
Önce görevi oluşturun
Create a Wan video ile başlayın ve döndürülen
id değerini saklayın.2
Task ID ile polling yapın
status, completed, failed veya error durumuna ulaşana kadar task ID’yi bu endpoint’e gönderin.3
MP4 dosyasını indirin
status değeri completed olduğunda, Retrieve Wan video content çağrısını yapın.Yanıt
Current Wan video task state.
Son değiştirilme tarihi 23 Haziran 2026
⌘I
cURL
curl https://api.cometapi.com/v1/videos/<TASK_ID> \
-H "Authorization: Bearer $COMETAPI_KEY"import os
import time
import requests
TASK_ID = "<TASK_ID>"
headers = {"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]}
terminal_statuses = {"completed", "failed", "error"}
while True:
response = requests.get(
f"https://api.cometapi.com/v1/videos/{TASK_ID}",
headers=headers,
timeout=60,
)
response.raise_for_status()
task = response.json()
print(task["status"], task.get("progress"))
if task["status"] in terminal_statuses:
print(task.get("video_url"))
break
time.sleep(10)
const TASK_ID = "<TASK_ID>";
const terminalStatuses = new Set(["completed", "failed", "error"]);
while (true) {
const response = await fetch(
`https://api.cometapi.com/v1/videos/${TASK_ID}`,
{ headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` } },
);
const task = await response.json();
console.log(task.status, task.progress);
if (terminalStatuses.has(task.status)) {
console.log(task.video_url);
break;
}
await new Promise((resolve) => setTimeout(resolve, 10_000));
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/v1/videos/{task_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://api.cometapi.com/v1/videos/{task_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://api.cometapi.com/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/v1/videos/{task_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": "task_example",
"model": "wan2.6",
"object": "video",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}