Poll Video Results
Endpoint
Section titled “Endpoint”GET https://api.hipix.app/v1/videos/{task_id}Response Format
Section titled “Response Format”While Processing
Section titled “While Processing”{ "id": "vt-abc123def", "object": "video", "model": "aliyun/wan3-0/reference-to-video-global", "status": "in_progress", "progress": 45, "created_at": 1760000000}When Completed
Section titled “When Completed”{ "id": "vt-abc123def", "object": "video", "model": "aliyun/wan3-0/reference-to-video-global", "status": "completed", "created_at": 1760000000, "completed_at": 1760000142, "url": "https://cdn.example.com/output/video.mp4"}When Failed
Section titled “When Failed”{ "id": "vt-abc123def", "object": "video", "model": "aliyun/wan3-0/reference-to-video-global", "status": "failed", "created_at": 1760000000, "error": { "code": "generation_failed", "message": "Content policy violation detected in prompt" }}Status Values
Section titled “Status Values”| Status | Description | Action |
|---|---|---|
queued | Task waiting in queue | Continue polling |
in_progress | Model generating video | Continue polling |
completed | Video ready | Download from url |
failed | Generation failed | Check error field |
Polling Strategy
Section titled “Polling Strategy”import timeimport requests
def wait_for_video(task_id, api_key, max_wait=600, interval=5): """Poll until the video task reaches a terminal state.""" start = time.time() while time.time() - start < max_wait: resp = requests.get( f"https://api.hipix.app/v1/videos/{task_id}", headers={"Authorization": f"Bearer {api_key}"}, ).json()
if resp["status"] == "completed": return resp if resp["status"] == "failed": raise RuntimeError(f"Video failed: {resp.get('error', 'unknown')}")
time.sleep(interval)
raise TimeoutError(f"Video did not complete within {max_wait}s")Handling Timeouts
Section titled “Handling Timeouts”If your polling loop times out:
- The task may still be running — check again later with the same task ID
- Don’t resubmit immediately — you’d be charged for a duplicate
- Task IDs are valid for 24 hours — you can check the result at any time within that window
Video URL
Section titled “Video URL”The url field in a completed response points to the generated video file.
URLs may expire
We recommend downloading the video file to your own storage as soon as it’s completed. Don’t rely on the URL being permanently available.
# Download the videovideo_data = requests.get(resp["url"]).contentwith open("output.mp4", "wb") as f: f.write(video_data)Billing
Section titled “Billing”You are billed when the task is submitted, not when it completes. If a task fails:
- The charge is automatically refunded to your balance
- The refund may take a few minutes to appear
- You can verify by checking your Wallet transaction history