Implementation:Openai Openai python Video Model
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete tool for representing a Video generation job returned by the OpenAI Video API, provided by the openai-python SDK.
Description
Video is a Pydantic BaseModel subclass that provides structured information describing a generated video job. It tracks the full lifecycle of a video generation request including status (queued, in_progress, completed, or failed), progress percentage, the model used (e.g., sora-2), the original prompt, output size (resolution), clip seconds (duration), and optional fields like error details, completed_at timestamp, expires_at for downloadable assets, and remixed_from_video_id for remix lineage.
Usage
Import this type when you need to type-annotate or inspect responses from video generation endpoints such as client.videos.create(), client.videos.retrieve(), or client.videos.list().
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/video.py
Signature
class Video(BaseModel):
"""Structured information describing a generated video job."""
id: str
completed_at: Optional[int] = None
created_at: int
error: Optional[VideoCreateError] = None
expires_at: Optional[int] = None
model: VideoModel
object: Literal["video"]
progress: int
prompt: Optional[str] = None
remixed_from_video_id: Optional[str] = None
seconds: VideoSeconds
size: VideoSize
status: Literal["queued", "in_progress", "completed", "failed"]
Import
from openai.types import Video
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | Unique identifier for the video job. |
| completed_at | Optional[int] | No | Unix timestamp (seconds) for when the job completed, if finished. |
| created_at | int | Yes | Unix timestamp (seconds) for when the job was created. |
| error | Optional[VideoCreateError] | No | Error payload explaining why generation failed, if applicable. |
| expires_at | Optional[int] | No | Unix timestamp (seconds) for when downloadable assets expire, if set. |
| model | VideoModel | Yes | The video generation model that produced the job. |
| object | Literal["video"] | Yes | The object type, always "video". |
| progress | int | Yes | Approximate completion percentage for the generation task. |
| prompt | Optional[str] | No | The prompt that was used to generate the video. |
| remixed_from_video_id | Optional[str] | No | Identifier of the source video if this video is a remix. |
| seconds | VideoSeconds | Yes | Duration of the generated clip in seconds. |
| size | VideoSize | Yes | The resolution of the generated video. |
| status | Literal["queued", "in_progress", "completed", "failed"] | Yes | Current lifecycle status of the video job. |
Usage Examples
from openai import OpenAI
from openai.types import Video
client = OpenAI()
video: Video = client.videos.create(prompt="A serene mountain landscape at sunset")
print(video.id) # "video_abc123"
print(video.status) # "queued"
print(video.model) # "sora-2"
print(video.progress) # 0
print(video.seconds) # 4
print(video.size) # "720x1280"