YepAPI
AI Models

Sora 2

AI video generation with synced audio from text prompts or images. 720p resolution, 4-20 second durations.

POST/v1/media/queue
$0.20/sec

Overview

Video generation with synced audio from text prompts or images. Async operation — submit a job, poll for completion.

PropertyValue
Model IDopenai/sora-2
Upstream Modelsora-2
ProviderOpenAI (direct)
Resolutions720p
Aspect Ratios16:9 (landscape), 9:16 (portrait)
Duration4, 8, 12, 16, or 20 seconds
BillingPer-second (dynamic)
Pricing$0.20/sec (720p)

Usage

All media models use the async job queue. Submit a job, then poll for the result.

Step 1: Submit Job

Text-to-Video

const res = await fetch('https://api.yepapi.com/v1/media/queue', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'openai/sora-2',
    prompt: 'A cinematic tracking shot of a teal vintage coupe driving through a desert highway at golden hour',
    options: {
      aspectRatio: '16:9',
      resolution: '720p',
      duration: '8',
    },
  }),
});
const { data } = await res.json();
// data.jobId — use this to poll for results
curl -X POST https://api.yepapi.com/v1/media/queue \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/sora-2", "prompt": "A cinematic tracking shot of a teal vintage coupe driving through a desert highway", "options": {"aspectRatio": "16:9", "resolution": "720p", "duration": "8"}}'

Image-to-Video

Pass a reference image via imageData to generate a video from a still image.

const res = await fetch('https://api.yepapi.com/v1/media/queue', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'openai/sora-2',
    prompt: 'Animate this scene — camera slowly zooms in, light particles drift through the air',
    options: { aspectRatio: '16:9', duration: '8' },
    imageData: {
      mimeType: 'image/jpeg',
      base64: '...', // Base64-encoded image
    },
  }),
});

Step 2: Poll for Result

const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, {
  headers: { 'x-api-key': 'YOUR_API_KEY' },
});
const { data: job } = await status.json();
// job.status — "pending" | "processing" | "completed" | "failed"
// job.result.video — { mimeType, base64 } when completed
curl https://api.yepapi.com/v1/media/status/JOB_ID \
  -H "x-api-key: YOUR_API_KEY"

Request Body

ParameterTypeRequiredDescriptionDefault
modelstringYesopenai/sora-2 or alias sora-2
promptstringYesText description of the video to generate
options.aspectRatiostringNo16:9 or 9:1616:9
options.resolutionstringNo720p720p
options.durationstringNo4, 8, 12, 16, or 20 (seconds)8
imageData.mimeTypestringNoMIME type of input image (image/png, image/jpeg, image/webp)
imageData.base64stringNoBase64-encoded input image for image-to-video generation

Pricing

ResolutionCost/sec
720p$0.20

Example: 8-second 720p video = 8 x $0.20 = $1.60. A 20-second video = 20 x $0.20 = $4.00.

Info

Videos can take up to 10 minutes to generate. Results retained for 1 hour.

Under the Hood

Powered by OpenAI's Sora 2 directly. 100% margin on upstream costs.

On this page