Skip to content

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.

ParameterTypeRequiredDescription
task_idstringTask ID returned by generate_video
StatusMeaningWhat to do
PreparingTask is being preparedWait and poll again
QueueingTask is queuedWait and poll again
ProcessingVideo is being generatedWait and poll again
SuccessVideo is readyDownload URL is provided in response
FailGeneration failedTry again with a different prompt

Check status:

“Check the status of video generation task 106916112212032.”

Poll until ready:

“Is my video ready? The task ID is 176843862716480.”

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://..." }

Returns a text part with:

  • Task ID — the task being polled
  • Status — current task status
  • Download URL — the URL to access the generated video (on Success only)
  • Resolution — video dimensions (on Success only)
  • 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, retry generate_video with a revised prompt or different model.