Retrieves the current status and details of a specific video generation task.
Path Parameters
The unique identifier of the video.
Response
Unique identifier for the video.
Current status of the video generation:
pending - Queued for processing
processing - Currently being generated
completed - Ready for download
failed - Generation failed
The original prompt used for generation.
The model used for generation.
The dimensions of the video.
The duration of the video in seconds (available when completed).
Unix timestamp of when the task was created.
Unix timestamp of when the task completed (if applicable).
Error message if the generation failed.
Examples
Check Video Status
import requests
video_id = "vid_abc123"
response = requests.get(
f"https://api.voidai.app/v1/videos/{video_id}",
headers={"Authorization": "Bearer sk-voidai-your_key_here"}
)
video = response.json()
print(f"Status: {video['status']}")
if video['status'] == 'completed':
print(f"Duration: {video['duration']}s")
print("Ready for download!")
elif video['status'] == 'failed':
print(f"Error: {video['error']}")
Poll Until Complete
import time
import requests
def wait_for_video(video_id, timeout=600, interval=10):
"""Wait for video to complete, with timeout."""
start_time = time.time()
while time.time() - start_time < timeout:
response = requests.get(
f"https://api.voidai.app/v1/videos/{video_id}",
headers={"Authorization": "Bearer sk-voidai-your_key_here"}
)
video = response.json()
if video['status'] == 'completed':
return video
elif video['status'] == 'failed':
raise Exception(f"Video generation failed: {video.get('error')}")
print(f"Status: {video['status']}... waiting {interval}s")
time.sleep(interval)
raise TimeoutError("Video generation timed out")
video = wait_for_video("vid_abc123")
print(f"Video ready! Duration: {video['duration']}s")
Response Examples
Pending Video
{
"id": "vid_abc123",
"status": "pending",
"prompt": "A serene beach at sunset with gentle waves",
"model": "sora-2",
"size": "1920x1080",
"created_at": 1701691200
}
Completed Video
{
"id": "vid_abc123",
"status": "completed",
"prompt": "A serene beach at sunset with gentle waves",
"model": "sora-2",
"size": "1920x1080",
"duration": 10.0,
"created_at": 1701691200,
"completed_at": 1701691500
}
Failed Video
{
"id": "vid_abc123",
"status": "failed",
"prompt": "A serene beach at sunset with gentle waves",
"model": "sora-2",
"size": "1920x1080",
"created_at": 1701691200,
"error": "Content policy violation detected"
}