Videos API

OpenAI schedules this API and Sora 2 for shutdown on September 24, 2026, with no replacement listed. See OpenAI's deprecation schedule.

Create, retrieve, and list Sora video-generation jobs, and download their rendered content. Generation is asynchronous — create a job, poll it with retrieve_video until it is ready, then fetch the file with video_content. OpenAI only.

Parsed Objects

UniLM.VideoObjectType
VideoObject

A video-generation job from the Videos API: id, plus optional status and model; raw holds the unparsed JSON response.

source

Result Types

Request Functions

UniLM.create_videoFunction
create_video(; prompt, model="sora-2", seconds=nothing, size=nothing, input_reference=nothing, service=OPENAIServiceEndpoint)

Pass config::Union{Nothing,RequestConfig} to override the timeout budget for this call (a single bounded attempt; max_attempts does not apply).

source
UniLM.retrieve_videoFunction
retrieve_video(id; service=OPENAIServiceEndpoint)

Pass config::Union{Nothing,RequestConfig} to override the timeout budget for this call (a single bounded attempt; max_attempts does not apply).

source
UniLM.list_videosFunction
list_videos(; limit=nothing, after=nothing, service=OPENAIServiceEndpoint)

Pass config::Union{Nothing,RequestConfig} to override the timeout budget for this call (a single bounded attempt; max_attempts does not apply).

source
UniLM.video_contentFunction
video_content(id; service=OPENAIServiceEndpoint)  → VideoContentSuccess (raw bytes)

Pass config::Union{Nothing,RequestConfig} to override the timeout budget for this call (a single bounded attempt; max_attempts does not apply).

source

Usage

# Create a Sora video-generation job
result = create_video(prompt="A cat surfing a wave", model="sora-2")
result isa VideoSuccess && println("Job: ", result.response.id)

# Poll status, list jobs, download the finished video
retrieve_video("video_abc123")
list_videos(limit=10)
content = video_content("video_abc123")
content isa VideoContentSuccess && write("cat.mp4", content.content)