Back to wiki Inference

Video API async jobs

A Wan2.2 sample is minutes, not hundreds of milliseconds. Every serious API therefore returns a job id and asks you to poll or subscribe. Holding a single HTTP request open until the MP4 exists will time out.

DashScopeGradiojob_id
On this page 6
POST jobs, PENDING, GPU worker RUNNING, SUCCEEDED or FAILED
Shared pattern: enqueue, poll, fetch URL. DashScope, Gradio, Replicate, and fal all look like this.

DashScope / Model Studio

Alibaba Cloud Wan tasks use an async header (X-DashScope-Async: enable) on create, then GET /api/v1/tasks/{task_id} until SUCCEEDED, FAILED, or CANCELED. The video URL is on the task payload. Prompt-extension Qwen calls are ordinary chat completions and can stay synchronous; the DiT job cannot.

Gradio Spaces (HF / ModelScope)

Public demos join a queue: upload → hash → /queue/join → SSE events (estimation, process, complete). That is how the official Wan-AI Spaces and this site’s /wan2.2-s2v demo talk to ZeroGPU. Timeouts, sleeps, and daily caps are queue properties, not model properties.

Replicate / fal / others

  • Replicate: POST prediction, poll GET /v1/predictions/{id}, status starting|processing|succeeded|failed|canceled.
  • fal: queue.submit + queue.result, or webhook.
  • Always store the provider id; never block a serverless Worker for the full sample.

Client rules that prevent ghosts

  1. Create the job, persist job_id + user id.
  2. Poll 2–5 s with backoff; cap total wait (S2V can exceed 10 minutes on a busy Space).
  3. Treat 409 / 429 as queue, not as “the model is broken.”
  4. On SUCCEEDED, copy the file to your own storage — provider URLs expire.
  5. On FAILED, show the provider message (OOM, NSFW, empty audio) instead of retry storms.

FAQ

Can I stream frames?
Not from official generate.py. You get a finished video. Some hosts preview the first clip via --num_clip on S2V.
Webhook vs poll?
Webhooks are better on your own API. Browsers should poll or use SSE from your backend so the GPU vendor never sees the user’s socket directly if you can avoid it.

Primary sources

Checked against Wan-Video/Wan2.2 README · Aug 28, 2026

© 2026 wan2.video