VideoGen Python SDK
Official Python client for the VideoGen API.
Package: videogen (PyPI) · Import: videogen · Version: 2.0.0
Install
pip install videogen
For local development from this repo:
cd sdk-python
python -m venv .venv
source .venv/bin/activate
pip install -e .
Quick start
import os
from videogen import VideoGen
vg = VideoGen(api_key=os.environ["VIDEOGEN_API_KEY"])
run = vg.workflows.script_to_video_and_wait(
script="Staying hydrated keeps your body and mind running at their best.",
visual_style={
"type": "AI_IMAGE",
"ai_style": "loose watercolor illustration with visible brushstrokes",
},
quality="HIGH",
remix_actions=[
{"type": "ENABLE_CAPTIONS"},
{
"type": "CONVERT_IMAGES_TO_VIDEOS",
"motion_prompt": "slow cinematic push-in",
"mute_output_videos": True,
"quality": "HIGH",
},
],
)
print(run["status"], run.get("project_id"))
Async twin:
from videogen import AsyncVideoGen
vg = AsyncVideoGen(api_key=os.environ["VIDEOGEN_API_KEY"])
run = await vg.workflows.script_to_video_and_wait(script="...")
Default base URL: https://api.videogen.io. Omit api_key to read VIDEOGEN_API_KEY from the environment.
Naming and JSON
- Methods: snake_case (
script_to_video,get_tool_execution_info). - Requests: pass snake_case kwargs (and nested dict keys). The client serializes body/query keys to camelCase for the wire.
- Responses: JSON objects are converted recursively to snake_case keys so Python callers use idiomatic names (
tool_execution_id,workflow_run_id,has_more).
Resources
account · workflows · projects · tools · files · assistant · text · resources · webhooks
Every public REST operation is a thin method (see @sdk-operation markers). Convenience helpers are exported as module functions and bound on the client:
| Helper | Purpose |
|---|---|
poll_assistant_message / async_poll_assistant_message |
Poll an assistant message to a terminal status |
poll_executed_tool / async_poll_executed_tool |
Poll a tool execution to a terminal status |
poll_workflow_run / async_poll_workflow_run |
Poll a workflow run |
poll_project_export / async_poll_project_export |
Poll a project export |
poll_remix_actions / async_poll_remix_actions |
Poll remix actions until all are terminal |
poll_public_preview / async_poll_public_preview |
Poll until a public preview URL is ready |
upload_file / async_upload_file |
Presign, PUT bytes, poll until the file is ready |
get_hydrated_file / async_get_hydrated_file |
Hydrate signed source URLs |
download_file / async_download_file |
Hydrate then download bytes (optional path) |
create_public_preview / async_create_public_preview |
Enable + poll public preview |
verify_webhook_signature |
Verify Standard Webhooks and return the event dict |
*_and_wait wrappers on tools, workflows, projects, and assistant start work and poll to completion.
Cancellation
Pass cancel_event=threading.Event() (sync) or asyncio.Event() (async) to poll helpers or thin request / resource methods. Setting the event raises PollCancelledError.
Errors
VideoGenError exposes status, body, and request_id (from x-request-id when present).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file videogen-2.0.5.tar.gz.
File metadata
- Download URL: videogen-2.0.5.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14e78e779936836f6190309a8fdc2ca3862a809b0cf5aee66f897c7f62abc44e
|
|
| MD5 |
6632999ebae599db45d774156ee786ed
|
|
| BLAKE2b-256 |
20f5b8752a25b198f5564f2ddba44e74d2cc1a154e87c93745f6d163ad513eef
|
File details
Details for the file videogen-2.0.5-py3-none-any.whl.
File metadata
- Download URL: videogen-2.0.5-py3-none-any.whl
- Upload date:
- Size: 38.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f489a52293b2b132e4f66bb9657ab1d9ad0a15a33c7a1de834fb4822f788959d
|
|
| MD5 |
ae43bcffb1383f3fb69ff20f69209808
|
|
| BLAKE2b-256 |
df7f2248a83db30745418d29aee818613d887cbd3b3c434d1a8eb5ba3b46e49f
|