AI Gateway now supports asynchronous video generation
Vercel’s AI Gateway now supports asynchronous video generation, allowing applications to handle long-running video tasks without HTTP timeouts by using webhooks, polling, or deferred retrieval.
Vercel’s AI Gateway has introduced asynchronous video generation to address delays caused by long-running video tasks. Previously, the default synchronous `generateVideo` method kept an HTTP request open until completion, risking timeouts. The new approach lets applications receive a webhook upon job completion, poll for updates every five seconds, or defer retrieval using a stored operation ID. Each method supports text-to-video, image-to-video, and other input types without altering existing `generateVideo` calls.
The webhook option eliminates polling by sending a completion event when the job finishes or fails. The SDK automatically fetches the generated video using a shared token and store for verification. Polling involves repeated status checks until the video is ready or a ten-minute timeout is reached. Alternatively, `startVideo` initiates a job and returns an operation ID for later status checks via `getVideoStatus`, which does not download videos but provides provider URLs or inline bytes.
Asynchronous jobs are logged in the AI Gateway Logs page, showing status updates from Running to completion or failure. The Request Mode filter can display only asynchronous jobs, with each entry including the job ID and request details. Standard `generateVideo` calls appear as single completed requests, while asynchronous jobs generate separate entries. Hosted video URLs may expire, so applications should download videos promptly.
The update includes operational details such as size limits, idempotency for retried job starts, and webhook delivery retries. Developers can refer to the asynchronous video generation documentation or browse supported video models for further technical specifications and constraints.