ExamplescriptIntermediateRunnableguided-flow
Sora 2 Pro: a higher-resolution video request (1024x1792)
Request a 4-second sora-2-pro video at 1024x1792, then fetch and download the latest job. The code notes that Pro jobs could stay in progress.
Key Facts
- Level
- Intermediate
- Runtime
- Python • OpenAI API
- Pattern
- Inspectable flow with visible system boundaries
- Interaction
- Live sandbox • Script
- Code last changed
- 29 October 2025
Navigate this example
Library
Browse examplesReopen the wider library to compare adjacent patterns and linked learning paths.Interaction
Run sandbox nowTry the interaction directly in this example’s guided sandbox surface.Source
Open full sourceRead the real implementation, highlighted checkpoints, and runtime requirements.MCP
Call via MCPUse the same resource inside agents, deterministic exports, and MCP setup flows.
Linked principles
3-sora-pro-model.py
python
from openai import OpenAI
from utils.downloader import download_sora_video
openai = OpenAI()
# --------------------------------------------------------------
# Generate a video with Sora Pro mode
# --------------------------------------------------------------
# Stays stuck in progress right now...
video = openai.videos.create(
model="sora-2-pro",
prompt="The YouTuber leans forward with an excited, intense expression while talking into the Shure SM7B. He says with energy: 'OpenAI just dropped Sora 2 via API... and honestly, this changes EVERYTHING. We're talking hyper-realistic videos with like 10 lines of code. Wild.' Dark background with a soft blue LED light glow. Professional lighting setup with key light and rim light. Shot on Sony FX6, cinematic depth of field, crisp focus, vertical format 9:16.",
size="1024x1792",
seconds="4",
)
print("Video generation started:", video)
# --------------------------------------------------------------
# Get last video
# --------------------------------------------------------------
last_video = openai.videos.list().data[0]
print("Model:", last_video.model)
print("Video status:", last_video.status)
print("Video progress:", last_video.progress)
# --------------------------------------------------------------
# Download the video
# --------------------------------------------------------------
video = download_sora_video(video=video, output_folder="./output")
Related principles
- P2VisibilityEnsure that background work remains perceptibleWhen the system is operating asynchronously or outside the user’s immediate focus, it should provide persistent and proportionate signals that work is continuing.Open principle →
- P4TrustApply progressive disclosure to system agencyProvide the minimum information necessary by default, while enabling users to inspect additional detail when confidence, understanding, or intervention is required.Open principle →
- P5DelegationReplace implied magic with clear mental modelsThe product should help users understand what the system can do, what it is currently doing, what it cannot do, and what conditions govern its behaviour.Open principle →
- P7TrustEstablish trust through inspectabilityUsers should be able to examine how a result was produced when confidence, accountability, or decision quality is important.Open principle →
- P9OrchestrationRepresent delegated work as a system, not merely as a conversationWhere work involves multiple steps, agents, dependencies, or concurrent activities, it should be represented as a structured system rather than solely as a message stream.Open principle →