#help

1 messages · Page 1 of 1 (latest)

lone bisonBOT
#

Hi @graceful stump. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

To get started with Sora 2 and generate videos programmatically, you need access to the OpenAI API and use the appropriate endpoint. Here’s a basic example of how to generate a video using Sora 2 with code:

Example: Generate a Video with Sora 2 (Python)

from openai import OpenAI

openai = OpenAI()

video = openai.videos.create(
    model="sora-2",
    prompt="A video of a cool cat on a motorcycle in the night",
)

print("Video generation started:", video)

You can also use curl:

curl -X POST "<https://api.openai.com/v1/videos"> \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F prompt="Wide tracking shot of a teal coupe driving through a desert highway, heat ripples visible, hard sun overhead." \
  -F model="sora-2" \
  -F size="1280x720" \
  -F seconds="8"
  • Replace $OPENAI_API_KEY with your actual API key.
  • The prompt describes the video you want to generate.
  • The model should be set to "sora-2" for Sora 2.
  • You can specify size and seconds for resolution and duration.

Note: You need to have API access to Sora 2. Access is available to API users on tiers 1–5, but your organization must be verified. See API Organization Verification for details. If you don’t have access, you can request it through your OpenAI account or organization admin source.

For more details and advanced usage, see the official Sora video generation guide.

#

If you need help with the Sora app (not the API), you can download it on iOS and sign in with your OpenAI account. Access is being rolled out gradually and may require an invite source.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: