Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Video Create Params

From Leeroopedia
Knowledge Sources
Domains API_Types, Python
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete tool for specifying parameters when creating a Video generation job via the OpenAI API, provided by the openai-python SDK.

Description

VideoCreateParams is a TypedDict that defines the required and optional parameters for creating a video generation job. The only required field is prompt (the text description for the video). Optional fields include input_reference (an image file to guide generation), model (defaults to sora-2), seconds (clip duration: 4, 8, or 12), and size (output resolution such as 720x1280, 1280x720, 1024x1792, or 1792x1024).

Usage

Import this type when you need to type-annotate keyword arguments for client.videos.create() or when building parameter dictionaries programmatically for video generation requests.

Code Reference

Source Location

Signature

class VideoCreateParams(TypedDict, total=False):
    prompt: Required[str]
    input_reference: FileTypes
    model: VideoModelParam
    seconds: VideoSeconds
    size: VideoSize

Import

from openai.types import VideoCreateParams

I/O Contract

Fields

Name Type Required Description
prompt str Yes Text prompt that describes the video to generate.
input_reference FileTypes No Optional image reference that guides generation.
model VideoModelParam No The video generation model to use (sora-2, sora-2-pro). Defaults to sora-2.
seconds VideoSeconds No Clip duration in seconds (4, 8, or 12). Defaults to 4 seconds.
size VideoSize No Output resolution (720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.

Usage Examples

from openai import OpenAI
from openai.types import VideoCreateParams

client = OpenAI()

params: VideoCreateParams = {
    "prompt": "A cat playing piano in a jazz club",
    "model": "sora-2",
    "seconds": 8,
    "size": "1280x720",
}

video = client.videos.create(**params)
print(video.id, video.status)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment