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_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

*AndWait wrappers on tools, workflows, and projects 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.4.tar.gz (21.0 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.4-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: videogen-2.0.4.tar.gz
  • Upload date:
  • Size: 21.0 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.4.tar.gz
Algorithm Hash digest
SHA256 dc917e94a9a012c9e67f8c241cca6184bc5d6079865306bb669f2210751e3ca4
MD5 cfc16d4b865da5fd86937593e7d00b72
BLAKE2b-256 301395ed7c16cd7fbefdb9b481517d3f671fb6dee2ab0fadc1ce5220453b68b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: videogen-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 35.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d1a8ca2ea469664d18e140f392ffe4c293f103ef6c8e5647c8dd01704ab9b2a5
MD5 159eb68e16c4ebfa203ea38b340b1038
BLAKE2b-256 296e2ffde98b1ce68098948712a9e53eebbf55c1c60c5cd4316369100b9d945b

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