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.9.tar.gz (22.4 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.9-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: videogen-2.0.9.tar.gz
  • Upload date:
  • Size: 22.4 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.9.tar.gz
Algorithm Hash digest
SHA256 05f572a2681b32cb01e00c27fffa192dda4dbaa56fbbd2c84e69eed56b3da7d0
MD5 bbb6e478013a7f0e69e0116537170b08
BLAKE2b-256 3080aa3d3f942122d0f2f71c4331f1e713616405a648e27b4144f24db91bbd2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: videogen-2.0.9-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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2a3e25d8a71ec44541e841086a27d91b3de5dbb8b7c32471e2a55515924d6205
MD5 3f85c45b119fe360a666aa1141860b17
BLAKE2b-256 94401258785378ee1b1eb919a1255efc2ce05da6dfc8073c6ea39177484fe9de

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