Videos
Create video
videos.create(VideoCreateParams**kwargs) -> Video
post /videos
Create a new video generation job from a prompt and optional reference assets.
Parameters
-
prompt: strText prompt that describes the video to generate.
-
input_reference: Optional[InputReference]Optional reference asset upload or reference object that guides generation.
-
FileTypesOptional reference asset upload or reference object that guides generation.
-
class ImageInputReferenceParam: …-
file_id: Optional[str] -
image_url: Optional[str]A fully qualified URL or base64-encoded data URL.
-
-
-
model: Optional[VideoModelParam]The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to
sora-2.-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
seconds: Optional[VideoSeconds]Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.
-
"4" -
"8" -
"12"
-
-
size: Optional[VideoSize]Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
Returns
-
class Video: …Structured information describing a generated video job.
-
id: strUnique identifier for the video job.
-
completed_at: Optional[int]Unix timestamp (seconds) for when the job completed, if finished.
-
created_at: intUnix timestamp (seconds) for when the job was created.
-
error: Optional[VideoCreateError]Error payload that explains why generation failed, if applicable.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
-
expires_at: Optional[int]Unix timestamp (seconds) for when the downloadable assets expire, if set.
-
model: VideoModelThe video generation model that produced the job.
-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
object: Literal["video"]The object type, which is always
video."video"
-
progress: intApproximate completion percentage for the generation task.
-
prompt: Optional[str]The prompt that was used to generate the video.
-
remixed_from_video_id: Optional[str]Identifier of the source video if this video is a remix.
-
seconds: Union[str, VideoSeconds]Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
str -
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
-
-
size: VideoSizeThe resolution of the generated video.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
-
status: Literal["queued", "in_progress", "completed", "failed"]Current lifecycle status of the video job.
-
"queued" -
"in_progress" -
"completed" -
"failed"
-
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
video = client.videos.create(
prompt="x",
)
print(video.id)
Response
{
"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"
}
Example
from openai import OpenAI
client = OpenAI()
video = client.videos.create(
prompt="A calico cat playing a piano on stage",
)
print(video.id)
Response
{
"id": "video_123",
"object": "video",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1712697600,
"size": "1024x1792",
"seconds": "8",
"quality": "standard"
}
Create a new video generation job by editing a source video or existing generated video.
videos.edit(VideoEditParams**kwargs) -> Video
post /videos/edits
Create a new video generation job by editing a source video or existing generated video.
Parameters
-
prompt: strText prompt that describes how to edit the source video.
-
video: VideoReference to the completed video to edit.
-
FileTypesReference to the completed video to edit.
-
class VideoVideoReferenceInputParam: …Reference to the completed video to edit.
-
id: strThe identifier of the completed video.
-
-
Returns
-
class Video: …Structured information describing a generated video job.
-
id: strUnique identifier for the video job.
-
completed_at: Optional[int]Unix timestamp (seconds) for when the job completed, if finished.
-
created_at: intUnix timestamp (seconds) for when the job was created.
-
error: Optional[VideoCreateError]Error payload that explains why generation failed, if applicable.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
-
expires_at: Optional[int]Unix timestamp (seconds) for when the downloadable assets expire, if set.
-
model: VideoModelThe video generation model that produced the job.
-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
object: Literal["video"]The object type, which is always
video."video"
-
progress: intApproximate completion percentage for the generation task.
-
prompt: Optional[str]The prompt that was used to generate the video.
-
remixed_from_video_id: Optional[str]Identifier of the source video if this video is a remix.
-
seconds: Union[str, VideoSeconds]Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
str -
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
-
-
size: VideoSizeThe resolution of the generated video.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
-
status: Literal["queued", "in_progress", "completed", "failed"]Current lifecycle status of the video job.
-
"queued" -
"in_progress" -
"completed" -
"failed"
-
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
video = client.videos.edit(
prompt="x",
video=b"Example data",
)
print(video.id)
Response
{
"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"
}
Create an extension of a completed video.
videos.extend(VideoExtendParams**kwargs) -> Video
post /videos/extensions
Create an extension of a completed video.
Parameters
-
prompt: strUpdated text prompt that directs the extension generation.
-
seconds: VideoSecondsLength of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).
-
"4" -
"8" -
"12"
-
-
video: VideoReference to the completed video to extend.
-
FileTypesReference to the completed video to extend.
-
class VideoVideoReferenceInputParam: …Reference to the completed video.
-
id: strThe identifier of the completed video.
-
-
Returns
-
class Video: …Structured information describing a generated video job.
-
id: strUnique identifier for the video job.
-
completed_at: Optional[int]Unix timestamp (seconds) for when the job completed, if finished.
-
created_at: intUnix timestamp (seconds) for when the job was created.
-
error: Optional[VideoCreateError]Error payload that explains why generation failed, if applicable.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
-
expires_at: Optional[int]Unix timestamp (seconds) for when the downloadable assets expire, if set.
-
model: VideoModelThe video generation model that produced the job.
-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
object: Literal["video"]The object type, which is always
video."video"
-
progress: intApproximate completion percentage for the generation task.
-
prompt: Optional[str]The prompt that was used to generate the video.
-
remixed_from_video_id: Optional[str]Identifier of the source video if this video is a remix.
-
seconds: Union[str, VideoSeconds]Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
str -
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
-
-
size: VideoSizeThe resolution of the generated video.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
-
status: Literal["queued", "in_progress", "completed", "failed"]Current lifecycle status of the video job.
-
"queued" -
"in_progress" -
"completed" -
"failed"
-
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
video = client.videos.extend(
prompt="x",
seconds="4",
video=b"Example data",
)
print(video.id)
Response
{
"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"
}
Create a character from an uploaded video.
videos.create_character(VideoCreateCharacterParams**kwargs) -> VideoCreateCharacterResponse
post /videos/characters
Create a character from an uploaded video.
Parameters
-
name: strDisplay name for this API character.
-
video: FileTypesVideo file used to create a character.
Returns
-
class VideoCreateCharacterResponse: …-
id: Optional[str]Identifier for the character creation cameo.
-
created_at: intUnix timestamp (in seconds) when the character was created.
-
name: Optional[str]Display name for the character.
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
response = client.videos.create_character(
name="x",
video=b"Example data",
)
print(response.id)
Response
{
"id": "id",
"created_at": 0,
"name": "name"
}
Fetch a character.
videos.get_character(strcharacter_id) -> VideoGetCharacterResponse
get /videos/characters/{character_id}
Fetch a character.
Parameters
character_id: str
Returns
-
class VideoGetCharacterResponse: …-
id: Optional[str]Identifier for the character creation cameo.
-
created_at: intUnix timestamp (in seconds) when the character was created.
-
name: Optional[str]Display name for the character.
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
response = client.videos.get_character(
"char_123",
)
print(response.id)
Response
{
"id": "id",
"created_at": 0,
"name": "name"
}
List videos
videos.list(VideoListParams**kwargs) -> SyncConversationCursorPage[Video]
get /videos
List recently generated videos for the current project.
Parameters
-
after: Optional[str]Identifier for the last item from the previous pagination request
-
limit: Optional[int]Number of items to retrieve
-
order: Optional[Literal["asc", "desc"]]Sort order of results by timestamp. Use
ascfor ascending order ordescfor descending order.-
"asc" -
"desc"
-
Returns
-
class Video: …Structured information describing a generated video job.
-
id: strUnique identifier for the video job.
-
completed_at: Optional[int]Unix timestamp (seconds) for when the job completed, if finished.
-
created_at: intUnix timestamp (seconds) for when the job was created.
-
error: Optional[VideoCreateError]Error payload that explains why generation failed, if applicable.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
-
expires_at: Optional[int]Unix timestamp (seconds) for when the downloadable assets expire, if set.
-
model: VideoModelThe video generation model that produced the job.
-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
object: Literal["video"]The object type, which is always
video."video"
-
progress: intApproximate completion percentage for the generation task.
-
prompt: Optional[str]The prompt that was used to generate the video.
-
remixed_from_video_id: Optional[str]Identifier of the source video if this video is a remix.
-
seconds: Union[str, VideoSeconds]Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
str -
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
-
-
size: VideoSizeThe resolution of the generated video.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
-
status: Literal["queued", "in_progress", "completed", "failed"]Current lifecycle status of the video job.
-
"queued" -
"in_progress" -
"completed" -
"failed"
-
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
page = client.videos.list()
page = page.data[0]
print(page.id)
Response
{
"data": [
{
"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"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}
Example
from openai import OpenAI
client = OpenAI()
page = client.videos.list()
page = page.data[0]
print(page.id)
Response
{
"data": [
{
"id": "video_123",
"object": "video",
"model": "sora-2",
"status": "completed"
}
],
"object": "list"
}
Retrieve video
videos.retrieve(strvideo_id) -> Video
get /videos/{video_id}
Fetch the latest metadata for a generated video.
Parameters
video_id: str
Returns
-
class Video: …Structured information describing a generated video job.
-
id: strUnique identifier for the video job.
-
completed_at: Optional[int]Unix timestamp (seconds) for when the job completed, if finished.
-
created_at: intUnix timestamp (seconds) for when the job was created.
-
error: Optional[VideoCreateError]Error payload that explains why generation failed, if applicable.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
-
expires_at: Optional[int]Unix timestamp (seconds) for when the downloadable assets expire, if set.
-
model: VideoModelThe video generation model that produced the job.
-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
object: Literal["video"]The object type, which is always
video."video"
-
progress: intApproximate completion percentage for the generation task.
-
prompt: Optional[str]The prompt that was used to generate the video.
-
remixed_from_video_id: Optional[str]Identifier of the source video if this video is a remix.
-
seconds: Union[str, VideoSeconds]Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
str -
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
-
-
size: VideoSizeThe resolution of the generated video.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
-
status: Literal["queued", "in_progress", "completed", "failed"]Current lifecycle status of the video job.
-
"queued" -
"in_progress" -
"completed" -
"failed"
-
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
video = client.videos.retrieve(
"video_123",
)
print(video.id)
Response
{
"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"
}
Example
from openai import OpenAI
client = OpenAI()
video = client.videos.retrieve(
"video_123",
)
print(video.id)
Delete video
videos.delete(strvideo_id) -> VideoDeleteResponse
delete /videos/{video_id}
Permanently delete a completed or failed video and its stored assets.
Parameters
video_id: str
Returns
-
class VideoDeleteResponse: …Confirmation payload returned after deleting a video.
-
id: strIdentifier of the deleted video.
-
deleted: boolIndicates that the video resource was deleted.
-
object: Literal["video.deleted"]The object type that signals the deletion response.
"video.deleted"
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
video = client.videos.delete(
"video_123",
)
print(video.id)
Response
{
"id": "id",
"deleted": true,
"object": "video.deleted"
}
Example
from openai import OpenAI
client = OpenAI()
video = client.videos.delete(
"video_123",
)
print(video.id)
Remix video
videos.remix(strvideo_id, VideoRemixParams**kwargs) -> Video
post /videos/{video_id}/remix
Create a remix of a completed video using a refreshed prompt.
Parameters
-
video_id: str -
prompt: strUpdated text prompt that directs the remix generation.
Returns
-
class Video: …Structured information describing a generated video job.
-
id: strUnique identifier for the video job.
-
completed_at: Optional[int]Unix timestamp (seconds) for when the job completed, if finished.
-
created_at: intUnix timestamp (seconds) for when the job was created.
-
error: Optional[VideoCreateError]Error payload that explains why generation failed, if applicable.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
-
expires_at: Optional[int]Unix timestamp (seconds) for when the downloadable assets expire, if set.
-
model: VideoModelThe video generation model that produced the job.
-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
object: Literal["video"]The object type, which is always
video."video"
-
progress: intApproximate completion percentage for the generation task.
-
prompt: Optional[str]The prompt that was used to generate the video.
-
remixed_from_video_id: Optional[str]Identifier of the source video if this video is a remix.
-
seconds: Union[str, VideoSeconds]Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
str -
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
-
-
size: VideoSizeThe resolution of the generated video.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
-
status: Literal["queued", "in_progress", "completed", "failed"]Current lifecycle status of the video job.
-
"queued" -
"in_progress" -
"completed" -
"failed"
-
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
video = client.videos.remix(
video_id="video_123",
prompt="x",
)
print(video.id)
Response
{
"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"
}
Example
from openai import OpenAI
client = OpenAI()
video = client.videos.remix(
video_id="video_123",
prompt="Extend the scene with the cat taking a bow to the cheering audience",
)
print(video.id)
Response
{
"id": "video_456",
"object": "video",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1712698600,
"size": "720x1280",
"seconds": "8",
"remixed_from_video_id": "video_123"
}
Retrieve video content
videos.download_content(strvideo_id, VideoDownloadContentParams**kwargs) -> BinaryResponseContent
get /videos/{video_id}/content
Download the generated video bytes or a derived preview asset.
Streams the rendered video content for the specified video job.
Parameters
-
video_id: str -
variant: Optional[Literal["video", "thumbnail", "spritesheet"]]Which downloadable asset to return. Defaults to the MP4 video.
-
"video" -
"thumbnail" -
"spritesheet"
-
Returns
BinaryResponseContent
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
response = client.videos.download_content(
video_id="video_123",
)
print(response)
content = response.read()
print(content)
Example
from openai import OpenAI
client = OpenAI()
response = client.videos.download_content(
video_id="video_123",
)
print(response)
content = response.read()
print(content)
Domain Types
Image Input Reference Param
-
class ImageInputReferenceParam: …-
file_id: Optional[str] -
image_url: Optional[str]A fully qualified URL or base64-encoded data URL.
-
Video
-
class Video: …Structured information describing a generated video job.
-
id: strUnique identifier for the video job.
-
completed_at: Optional[int]Unix timestamp (seconds) for when the job completed, if finished.
-
created_at: intUnix timestamp (seconds) for when the job was created.
-
error: Optional[VideoCreateError]Error payload that explains why generation failed, if applicable.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
-
expires_at: Optional[int]Unix timestamp (seconds) for when the downloadable assets expire, if set.
-
model: VideoModelThe video generation model that produced the job.
-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
-
object: Literal["video"]The object type, which is always
video."video"
-
progress: intApproximate completion percentage for the generation task.
-
prompt: Optional[str]The prompt that was used to generate the video.
-
remixed_from_video_id: Optional[str]Identifier of the source video if this video is a remix.
-
seconds: Union[str, VideoSeconds]Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
-
str -
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
-
-
size: VideoSizeThe resolution of the generated video.
-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
-
status: Literal["queued", "in_progress", "completed", "failed"]Current lifecycle status of the video job.
-
"queued" -
"in_progress" -
"completed" -
"failed"
-
-
Video Create Error
-
class VideoCreateError: …An error that occurred while generating the response.
-
code: strA machine-readable error code that was returned.
-
message: strA human-readable description of the error that was returned.
-
Video Model
-
Union[str, Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]]-
str -
Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", 2 more]-
"sora-2" -
"sora-2-pro" -
"sora-2-2025-10-06" -
"sora-2-pro-2025-10-06" -
"sora-2-2025-12-08"
-
-
Video Seconds
-
Literal["4", "8", "12"]-
"4" -
"8" -
"12"
-
Video Size
-
Literal["720x1280", "1280x720", "1024x1792", "1792x1024"]-
"720x1280" -
"1280x720" -
"1024x1792" -
"1792x1024"
-
Video Create Character Response
-
class VideoCreateCharacterResponse: …-
id: Optional[str]Identifier for the character creation cameo.
-
created_at: intUnix timestamp (in seconds) when the character was created.
-
name: Optional[str]Display name for the character.
-
Video Get Character Response
-
class VideoGetCharacterResponse: …-
id: Optional[str]Identifier for the character creation cameo.
-
created_at: intUnix timestamp (in seconds) when the character was created.
-
name: Optional[str]Display name for the character.
-
Video Delete Response
-
class VideoDeleteResponse: …Confirmation payload returned after deleting a video.
-
id: strIdentifier of the deleted video.
-
deleted: boolIndicates that the video resource was deleted.
-
object: Literal["video.deleted"]The object type that signals the deletion response.
"video.deleted"
-