Asynchronous Video Prediction Polling
Asynchronous video polling is the request-then-reconcile API pattern required for MAGI-2, where POST /api/jobs returns an immediate job ID and backend workers poll GET /api/jobs/{id} (or receive signed webhooks) until 1080p synthesis completes 7–26 minutes later.
Technical definition
Standard synchronous HTTP requests drop after 30 to 120 seconds across load balancers, serverless functions, and browser proxies—making blocking generation calls unworkable for continuous 4–30 second audio-video renders. Production architectures split job submission from completion delivery: the submit endpoint validates schema constraints, reserves ledger credits under an idempotency key, persists the upstream job handle in durable storage, and responds immediately with HTTP 202. An independent background reconciler then tracks state transitions until the finished MP4 is downloaded and archived safely.
How it works in flagship MAGI-2
Observed production render latency for flagship MAGI-2 spans 7 to 26 minutes depending on requested duration, Omni-Reference asset count, and GPU queue depth. Developers submit payloads to `POST https://magiai.ai/api/jobs` and inspect progress via `GET https://magiai.ai/api/jobs/{id}` using bounded polling intervals (for instance, polling every 20–30 seconds after a 60-second initial grace window). Immediately archiving completed MP4 outputs into independent object storage guarantees downloads remain accessible long after temporary links expire.
Production application & example
Never await video completion inside a Next.js Route Handler or active browser tab. Persist `request_id`, credit debit hold, and an idempotency key in Postgres on submit, run a bounded background worker reconciler every 20 seconds with exponential retry backoff on transient 5xx responses, mirror the finished MP4 into your R2 bucket, and push status updates to `/studio/jobs` or signed customer webhook endpoints.
POST /api/v1/model/generateVideo -> { id: "pred_..." } ==> Poll GET /api/v1/model/prediction/pred_... every 20s until terminal status.Related glossary terms
A policy-filtered automatic refund immediately restores 100% of reserved Studio credits to your double-entry ledger whenever MAGI-2’s upstream PG-13 safety classifier blocks a prompt, reference upload, or rendered frame, matching Sand.ai’s $0 upstream charge on filtered runs.
The 4-second audition workflow is a disciplined MAGI-2 production method where directors validate casting, Omni-Reference likeness, tungsten lighting, and vocal timbre using a minimum 4-second clip (40 credits / $0.32 wholesale) before committing budget to a full 15–30 second master.
NVFP4 is NVIDIA’s hardware-accelerated 4-bit floating-point quantization format introduced on Blackwell GPUs. It compresses open-weight 114B MAGI-2 Preview weights enough to run on a single 96GB RTX PRO 6000 workstation (with 64GB+ system RAM), whereas 24GB consumer RTX 4090 cards cannot load it.