Python
Official Python SDK for the VideoGen API.
Install
Create a client
The client reads from the VIDEOGEN_API_KEY environment variable when no token is provided.
Async client
Generate a video from a script
Workflows turn a script into a finished video asynchronously. Use poll_workflow_run to wait for the run:
For the async client, use async_poll_workflow_run:
Options
For the async client, pass asyncio.Event as cancel_event to async_poll_workflow_run, async_poll_executed_tool, async_poll_project_export, and async_poll_public_preview.
Run a standalone tool
All tool endpoints are asynchronous. Use poll_executed_tool to wait for the result: