Prereqs: Python 3.9+, macOS. This project uses a virtual environment and avoids global installs.
Setup
- Create venv and install deps
cd /Users/kylemathewson/Sora
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt- Configure API key and verify organization
Copy .env.example to .env and set OPENAI_API_KEY:
cp .env.example .env
echo "OPENAI_API_KEY=sk-..." >> .envImportant: Your OpenAI organization must be verified to use Sora models. Visit https://platform.openai.com/settings/organization/general and click "Verify Organization". Access propagates within 15 minutes after verification.
- Discover Sora-capable models (optional)
source .venv/bin/activate
python scripts/list_models.py- Generate a video
source .venv/bin/activate
python scripts/generate_video.py \
--prompt "A macro cinematic shot of ocean waves at sunrise, 4K film look" \
--duration 8 \
--resolution 1920x1080 \
--out videos/ocean_sunrise.mp4Notes
- This starter attempts the official Python SDK video method first and falls back to a raw HTTPS call if necessary. If you see a 404/unsupported error, upgrade the
openaipackage and re-run. - Refer to the official guide for parameter details:
https://platform.openai.com/docs/guides/video-generation.