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.VideoObject — Type
VideoObjectA video-generation job from the Videos API: id, plus optional status and model; raw holds the unparsed JSON response.
UniLM.VideoList — Type
VideoListA page of video jobs (raw JSON dicts) from list_videos; has_more signals that further pages are available.
Result Types
UniLM.VideoSuccess — Type
Successful create/retrieve result wrapping a VideoObject.
UniLM.VideoListSuccess — Type
Successful list_videos result wrapping a VideoList.
UniLM.VideoContentSuccess — Type
Successful video_content result; content holds the raw video bytes.
UniLM.VideoFailure — Type
Videos API error result: HTTP status and the raw response body.
UniLM.VideoCallError — Type
Local/transport error from a Videos API call (the request never completed).
Request Functions
UniLM.create_video — Function
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).
UniLM.retrieve_video — Function
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).
UniLM.list_videos — Function
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).
UniLM.video_content — Function
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).
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)