Skip to main content

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

videogen-2.0.6.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

videogen-2.0.6-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file videogen-2.0.6.tar.gz.

File metadata

  • Download URL: videogen-2.0.6.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

Hashes for videogen-2.0.6.tar.gz
Algorithm Hash digest
SHA256 f6dc0e28ec617adba4c32aeace16e36d74b6fc3d6b6de70cf58130307714ab86
MD5 d7150ecc4c50f80e1349018b0ac2ddcb
BLAKE2b-256 9f08d10f63e3cc5f2f9c8cad6da6b67a53d80efc9a26a3cc6a071b51c18cc818

See more details on using hashes here.

File details

Details for the file videogen-2.0.6-py3-none-any.whl.

File metadata

  • Download URL: videogen-2.0.6-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

Hashes for videogen-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bff5cfb267f3db8a418f9838b6be58dfe5c922ff4c05210461e3097244ed9072
MD5 2a0529e700635c762f64428342390eec
BLAKE2b-256 92ed213d2e591f027976afb9a3819646107d15729b4366e4274a87b6c330b20f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page