Skip to main content
Methods:
  • client.generate_video()
  • client.list_videos()
  • client.get_video()
  • client.get_video_content()
  • client.get_video_download_url()
  • client.cancel_video()
  • client.delete_video()
  • client.list_video_models()
  • client.get_async_job_websocket_url("video", video_id, ...)
  • client.videos.websocket_url(video_id, ...)
  • client.videos.create/list/get/content/download_url/cancel/delete/list_models()
job = client.generate_video({
    "model": "openai/sora-2",
    "prompt": "A calm ocean at dusk",
    "output": {"access": "both"},
})

jobs = client.list_videos({"status": "queued,completed", "limit": 2})

status = client.get_video(job["id"])
websocket_url = client.videos.websocket_url(job["id"], interval_ms=1500)

if status.get("status") == "completed" and status.get("download_url"):
    print(status["download_url"])
The create call returns an async video job record. Poll get_video() for completion, then use get_video_content() or get_video_download_url() to retrieve output. list_videos() returns the standard list envelope with object: "list" and a data array of async video jobs. Use client.videos.websocket_url(...) when you want to subscribe to the documented /v1/async/video/{id}/ws lifecycle stream instead of polling only. Use client.get_async_job_websocket_url("video", job["id"], ...) when you already have a generic async job kind/id pair and do not want to go through the resource helper. cancel_video() is exposed, but the public video cancel route currently returns a structured 501 not_implemented_yet error while provider-level cancellation is standardized.
Last modified on May 6, 2026