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 | Default | Description |
|---|---|---|---|---|
task_id | string | ✓ | — | Task ID returned by generate_video |
api | string | — | auto | Which API the task was created with: v1 (V1 models), v2 (MiniMax-H3), or auto (default) — tries V2 first and falls back to V1 when the task is not found. |
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 statusAPI— the API version used (v1orv2)Download URL— the URL to access the generated video (onSuccessonly)Resolution— video dimensions (onSuccessonly)Error— the underlying error message (onFailonly)
- Video generation typically takes 1–5 minutes. Poll every 30–60 seconds.
- With the default
api: 'auto', V2 (MiniMax-H3) tasks are queried first, with automatic fallback to V1 when the task is not found — you don’t need to track which API created the task. - If you know the task came from a V1 model, you can pass
api: 'v1'to skip the V2 attempt. - 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.