Skip to main content

AI Gateway now supports asynchronous video generation

By Steven Van ·

Video generation on AI Gateway can now run asynchronously. By default, generateVideo keeps one HTTP request to AI Gateway open until the result is ready.

Vercel's AI Gateway can now generate video asynchronously instead of holding a single HTTP request open until rendering finishes, which could exceed request timeouts since video generation takes seconds or minutes. Existing generateVideo calls are unaffected and continue to work as before.

Four ways to request a video now exist, depending on whether a process can keep running and whether it can receive webhooks:

  • startVideo with the Workflow SDK: creates its own webhook URL and suspends the workflow run until AI Gateway delivers the completion event, with no compute running while the video renders.
  • generateVideo with webhook: waits for a completion event sent to your own endpoint, then fetches the result, useful for returning videos from one call without polling.
  • generateVideo with poll: sends short status requests at an interval (default 5 seconds, default 10-minute timeout) until the job finishes, for processes that can wait but can't receive webhooks.
  • startVideo and getVideoStatus: returns immediately with an operation ID that can be checked later from the same process or another one, for serverless functions, queues, and parallel jobs that must outlive the calling process.

All four support text-to-video, image-to-video, reference-to-video, and other video inputs. Using them requires the latest versions of the AI SDK and the AI Gateway provider. Asynchronous jobs also now appear on the AI Gateway Logs page as "Running" while in progress, and can be filtered by Request Mode: Async. See the full announcement for code examples.

Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →

Read the original announcement →

Read AI Gateway now supports asynchronous video generation on Creators Toolbox