For production systems, webhooks are the better choice. Instead of polling, you register a URL and VideoGen sends you an event when work completes. For the full list of event types and payload schemas, see the Webhook events reference.
The response includes a signingSecret. Save it; you’ll need it to verify incoming requests.
When an execution reaches a terminal status, VideoGen sends a POST request to your URL:
Each entry in results contains the file id, type, and a hydrated file object with signed download URLs, so no extra API call is needed. For tool_execution.failed and tool_execution.cancelled events, results is absent.
Webhook deliveries follow the Standard Webhooks spec. Both SDKs ship a verifyWebhookSignature helper so you can confirm a request is authentic without pulling in the standardwebhooks library yourself:
The helpers throw if the signature is invalid or the timestamp is too old, so catch the error to reject the request.
In addition to tool execution events, you can subscribe to file upload lifecycle events. These are only fired for files uploaded via the API (not the VideoGen UI).
Register for file events the same way as tool events: