create_video
Generate a video from a text prompt using Sora. Optionally add a reference image to guide style. Returns a video ID for tracking progress.
Instructions
Create a new Sora video generation job. This starts an async job and returns immediately with a video_id.
The video is NOT ready immediately - use get_video_status(video_id) to poll for completion. Status will be 'queued' -> 'in_progress' -> 'completed' or 'failed'. Once status='completed', use download_video(video_id) to save the video to disk.
Parameters:
prompt: Text description of the video to generate (required)
model: "sora-2" (faster, cheaper) or "sora-2-pro" (higher quality). Default: "sora-2"
seconds: Duration as string "4", "8", or "12" (NOT an integer). Default: varies by model
size: Resolution as "720x1280" (portrait), "1280x720" (landscape), "1024x1792", or "1792x1024". Default: "720x1280"
input_reference_filename: Filename of reference image in IMAGE_PATH (e.g., "cat.png"). Use list_reference_images to find available images. Image must match target size. Supported: JPEG, PNG, WEBP. Optional.
Returns Video object with fields: id, status, progress, model, seconds, size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | ||
| model | No | sora-2 | |
| prompt | Yes | ||
| seconds | No | ||
| input_reference_filename | No |