query_generation_task
Poll the status of an asynchronous generation task created by generate_video. When the task reaches Success, the server automatically retrieves the download URL for the generated video.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | ✓ | Task ID returned by generate_video |
Task Statuses
Section titled “Task Statuses”| Status | Meaning | What to do |
|---|---|---|
Preparing | Task is being prepared | Wait and poll again |
Queueing | Task is queued | Wait and poll again |
Processing | Video is being generated | Wait and poll again |
Success | Video is ready | Download URL is provided in response |
Fail | Generation failed | Try again with a different prompt |
Usage Examples
Section titled “Usage Examples”Check status:
“Check the status of video generation task 106916112212032.”
Poll until ready:
“Is my video ready? The task ID is 176843862716480.”
Two-Step Workflow
Section titled “Two-Step Workflow”Step 1: generate_video(prompt="A golden retriever playing fetch on a beach") → { task_id: "106916112212032" }
Step 2 (repeat until Success): query_generation_task(task_id="106916112212032") → { status: "Processing" } ← wait 30–60 seconds and retry → { status: "Success", downloadUrl: "https://..." }Response
Section titled “Response”Returns a text part with:
Task ID— the task being polledStatus— current task statusDownload URL— the URL to access the generated video (onSuccessonly)Resolution— video dimensions (onSuccessonly)
- Video generation typically takes 1–5 minutes. Poll every 30–60 seconds.
- The download URL is retrieved automatically when the status is
Success— no separate download step is needed. - On
Fail, retrygenerate_videowith a revised prompt or different model.