Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Retrieve video

client.videos.retrieve(stringvideoID, RequestOptionsoptions?): Video { id, completed_at, created_at, 10 more }
GET/videos/{video_id}

Fetch the latest metadata for a generated video.

ParametersExpand Collapse
videoID: string
ReturnsExpand Collapse
Video { id, completed_at, created_at, 10 more }

Structured information describing a generated video job.

id: string

Unique identifier for the video job.

completed_at: number | null

Unix timestamp (seconds) for when the job completed, if finished.

formatunixtime
created_at: number

Unix timestamp (seconds) for when the job was created.

formatunixtime
error: VideoCreateError { code, message } | null

Error payload that explains why generation failed, if applicable.

expires_at: number | null

Unix timestamp (seconds) for when the downloadable assets expire, if set.

formatunixtime
model: VideoModel

The video generation model that produced the job.

object: "video"

The object type, which is always video.

progress: number

Approximate completion percentage for the generation task.

prompt: string | null

The prompt that was used to generate the video.

remixed_from_video_id: string | null

Identifier of the source video if this video is a remix.

seconds: (string & {}) | VideoSeconds

Duration of the generated clip in seconds. For extensions, this is the stitched total duration.

size: VideoSize

The resolution of the generated video.

status: "queued" | "in_progress" | "completed" | "failed"

Current lifecycle status of the video job.

Retrieve video

import OpenAI from 'openai';

const client = new OpenAI();

const video = await client.videos.retrieve('video_123');

console.log(video.id);
{
  "id": "id",
  "completed_at": 0,
  "created_at": 0,
  "error": {
    "code": "code",
    "message": "message"
  },
  "expires_at": 0,
  "model": "sora-2",
  "object": "video",
  "progress": 0,
  "prompt": "prompt",
  "remixed_from_video_id": "remixed_from_video_id",
  "seconds": "4",
  "size": "720x1280",
  "status": "queued"
}
Returns Examples
{
  "id": "id",
  "completed_at": 0,
  "created_at": 0,
  "error": {
    "code": "code",
    "message": "message"
  },
  "expires_at": 0,
  "model": "sora-2",
  "object": "video",
  "progress": 0,
  "prompt": "prompt",
  "remixed_from_video_id": "remixed_from_video_id",
  "seconds": "4",
  "size": "720x1280",
  "status": "queued"
}