AI Models
Sora 2
AI video generation with synced audio from text prompts or images. 720p resolution, 4-20 second durations.
POST
$0.20/sec/v1/media/queueOverview
Video generation with synced audio from text prompts or images. Async operation — submit a job, poll for completion.
| Property | Value |
|---|---|
| Model ID | openai/sora-2 |
| Upstream Model | sora-2 |
| Provider | OpenAI (direct) |
| Resolutions | 720p |
| Aspect Ratios | 16:9 (landscape), 9:16 (portrait) |
| Duration | 4, 8, 12, 16, or 20 seconds |
| Billing | Per-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 resultscurl -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 completedcurl https://api.yepapi.com/v1/media/status/JOB_ID \
-H "x-api-key: YOUR_API_KEY"Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
model | string | Yes | openai/sora-2 or alias sora-2 | — |
prompt | string | Yes | Text description of the video to generate | — |
options.aspectRatio | string | No | 16:9 or 9:16 | 16:9 |
options.resolution | string | No | 720p | 720p |
options.duration | string | No | 4, 8, 12, 16, or 20 (seconds) | 8 |
imageData.mimeType | string | No | MIME type of input image (image/png, image/jpeg, image/webp) | — |
imageData.base64 | string | No | Base64-encoded input image for image-to-video generation | — |
Pricing
| Resolution | Cost/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.