Get video task status
curl --request GET \
--url https://api.aiohub.org/v1/videos/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiohub.org/v1/videos/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aiohub.org/v1/videos/{task_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://api.aiohub.org/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.aiohub.org/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.aiohub.org/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/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",
"object": "video",
"model": "doubao-seedance-2-5-260628",
"status": "completed",
"progress": 100,
"created_at": 1791275108,
"seconds": "4"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Get video · OpenAI video
Check task status, handle failures and find the completed video.
GET
/
v1
/
videos
/
{task_id}
Get video task status
curl --request GET \
--url https://api.aiohub.org/v1/videos/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiohub.org/v1/videos/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aiohub.org/v1/videos/{task_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://api.aiohub.org/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.aiohub.org/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.aiohub.org/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/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",
"object": "video",
"model": "doubao-seedance-2-5-260628",
"status": "completed",
"progress": 100,
"created_at": 1791275108,
"seconds": "4"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Polling and status
Replace<TASK_ID> with the returned id and poll every 10 to 15 seconds:
curl "https://api.aiohub.org/v1/videos/<TASK_ID>" \
-H "Authorization: Bearer <AIOHUB_API_KEY>"
status | Action |
|---|---|
queued / in_progress | Keep polling |
completed | Download the MP4 |
failed | Stop polling and read error.message |
Failures and retries
Afailed task is a generation failure even with HTTP 200. After a polling disconnect, retry with the same id. Correct parameter errors before retrying a 400. Files remain for 72 hours and task records for 7 days.
After a 429 or temporary service error, wait before retrying the read; do not create another task. If a task is missing, check the identifier and the account that owns the API key.Authorizations
API key (sk-xxx)
Path Parameters
Video task ID