AI Gateway Adds Support for Asynchronous Video Generation
Key point
Vercel AI Gateway has added asynchronous video generation capabilities via webhooks and polling.
Details
Vercel AI Gateway has been updated to handle video generation tasks asynchronously. The existing generateVideo API required maintaining the HTTP request until the result was ready, which could cause request timeout issues given that video generation takes anywhere from seconds to minutes.
With this update, developers can choose one of four asynchronous processing options depending on their application environment.
- webhook: Receives completion events via webhook to return results without polling.
- poll: Suitable for environments where the calling process can wait, as the SDK sends short status requests.
- startVideo/getVideoStatus: Immediately returns a task ID, optimized for tasks that last longer than the calling process, such as serverless functions or queues.
- Default option: Maintains the request and waits for the result, identical to the previous behavior.
All options support various input formats, including text-to-video and image-to-video, and existing generateVideo calls continue to work as before. You can use these features by installing the latest AI SDK and AI Gateway providers.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.