Sora 2 video generation API
Call sora-2 and sora-2-pro on APIMaster.ai for text-to-video and image-to-video. Polling and downloads use APIMaster URLs.
Sora 2 video generation
Generate videos with Sora 2 through APIMaster. Supported models: sora-2, sora-2-pro. The name sora maps to sora-2.
Base URL:
https://apimaster.ai/v1ishttps://apimaster.ai/v1. Usehttps://apimaster.ai/v1/videos/...— do not add another/v1.
Pricing (20% off official, per second)
Billing is duration (seconds) × rate per second.
| Model | Resolution | Official | APIMaster |
|---|---|---|---|
sora-2 |
720p | $0.10 / sec | $0.08 / sec |
sora-2-pro |
720p | $0.30 / sec | $0.24 / sec |
sora-2-pro |
1024p | $0.50 / sec | $0.40 / sec |
sora-2-pro |
1080p | $0.70 / sec | $0.56 / sec |
Example: 4 seconds of sora-2 at 720p ≈ $0.32 ($0.08 × 4).
Submit a task
Two entry points — use either.
Option A (recommended): native JSON
POST https://apimaster.ai/v1/videos/generations
| Field | Type | Required | Description |
|---|---|---|---|
model |
string | yes | sora-2 / sora-2-pro (or sora) |
prompt |
string | yes | Video description |
duration |
integer | no | Common: 4 / 8 / 12 / 16 / 20, default 4 |
resolution |
string | no | sora-2: 720p; sora-2-pro: also 1024p / 1080p, default 720p |
aspect_ratio |
string | no | 16:9 / landscape or 9:16 / portrait, default 16:9 |
image_urls |
string[] | no | Image-to-video; 1 public URL recommended |
curl -s "https://apimaster.ai/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A waterfall forming a rainbow, cinematic",
"duration": 4,
"resolution": "720p",
"aspect_ratio": "16:9"
}'
Submit response
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_xxxxxxxx"
}
]
}
Set aspect_ratio explicitly for image-to-video (portrait → 9:16). Default is 16:9.
Option B: OpenAI Video compatible
POST https://apimaster.ai/v1/videos (JSON or multipart)
| Field | Type | Required | Description |
|---|---|---|---|
model |
string | yes | sora-2 / sora-2-pro (or sora) |
prompt |
string | yes | Video description |
seconds |
string | no | Duration, e.g. "4"; integer duration also works, default 4 |
size |
string | no | Pixel size — resolution + orientation (table below), default 720x1280 |
images |
string[] | no | Image-to-video; at most 1 URL. input_reference (single) also works |
size values
| Model | Landscape (16:9) | Portrait (9:16) |
|---|---|---|
sora-2 |
1280x720 (720p) |
720x1280 (720p) |
sora-2-pro |
1280x720 (720p) / 1792x1024 (1024p) |
720x1280 (720p) / 1024x1792 (1024p) |
Invalid
size(e.g.1920x1080) returns400 invalid_size. OpenAI path max is 1024p; use Option A withresolution: "1080p"for 1080p.
curl -s "https://apimaster.ai/v1/videos" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A waterfall forming a rainbow, cinematic",
"seconds": "4",
"size": "1280x720"
}'
Submit response
{
"id": "task_xxxxxxxx",
"object": "video",
"model": "sora-2",
"status": "queued"
}
Use task_id / id from either endpoint for polling and download.
Poll task status
GET https://apimaster.ai/v1/videos/{task_id}
curl -s "https://apimaster.ai/v1/videos/task_xxxxxxxx" \
-H "Authorization: Bearer YOUR_API_KEY"
Completed example:
{
"id": "task_xxxxxxxx",
"status": "completed",
"url": "https://apimaster.ai/v1/videos/task_xxxxxxxx/content"
}
Download MP4 via
https://apimaster.ai/v1/videos/{task_id}/content.
Download video
curl -L "https://apimaster.ai/v1/videos/task_xxxxxxxx/content" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o output.mp4
Image-to-video examples
Option A:
curl -s "https://apimaster.ai/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "Slow push-in, gentle breeze in the hair",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "9:16",
"image_urls": ["https://example.com/reference.jpg"]
}'
Option B (images field):
curl -s "https://apimaster.ai/v1/videos" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "Slow push-in, gentle breeze in the hair",
"seconds": "8",
"images": ["https://example.com/reference.jpg"]
}'
Polling tips
- Wait 10–20 seconds after submit; then poll every 3–5 seconds
- Typical time: 1–3 minutes
- Save the MP4 promptly after completion
Error codes
| code | Meaning |
|---|---|
| 400 | Invalid parameters (e.g. invalid_size) |
| 401 | Invalid API key |
| 402 | Insufficient balance |
| 429 | Rate limited |
| 500 / 502 | Temporary error, retry |