Skip to main content
MAGIAI
API & Billing|Verified as of 2026-12-02|DefinedTerm

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.

Canonical syntax snippet
POST /api/v1/model/generateVideo -> { id: "pred_..." }  ==>  Poll GET /api/v1/model/prediction/pred_... every 20s until terminal status.

Related glossary terms

MAGI-2 Async Video Polling, Latency & Webhook Patterns