ApiframeApiframe Docs
Video GenerationSora

Sora 2

OpenAI Sora 2 video generation with normalized duration and aspect ratio controls.

Use in Apiframe Studio

POST /v2/videos/generatemodel: "sora-2"

Sora 2 supports both text-to-video and image-to-video generation through a single normalized API.

See Video Generation overview for common request fields, response format, and error codes.

Model-specific parameters

ParameterTypeDefaultDescription
soraParams.durationinteger4Video duration in seconds: 4, 8, 10, 12, or 15
soraParams.aspect_ratiostring"16:9"Output aspect ratio: "16:9" or "9:16"
soraParams.resolutionstring"standard"Exposed for consistency; unsupported providers may ignore it for sora-2
soraParams.start_imagestringURL of an image to use as the first frame

Credit cost

VariantCredits
4s4
8s8
10s10
12s12
15s15

Code examples

curl -X POST https://api.apiframe.ai/v2/videos/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a cinematic dolly shot of neon-lit Tokyo streets in the rain",
    "model": "sora-2",
    "soraParams": {
      "duration": 12,
      "aspect_ratio": "16:9"
    }
  }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/videos/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a cinematic dolly shot of neon-lit Tokyo streets in the rain",
        "model": "sora-2",
        "soraParams": {
            "duration": 12,
            "aspect_ratio": "16:9",
        },
    },
)
print(response.json())
const response = await fetch("https://api.apiframe.ai/v2/videos/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "a cinematic dolly shot of neon-lit Tokyo streets in the rain",
    model: "sora-2",
    soraParams: {
      duration: 12,
      aspect_ratio: "16:9",
    },
  }),
});
console.log(await response.json());

Try it

POST/v2/videos/generateTry it

On this page