APIMaster.ai

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 is mapped to sora-2.

Pricing (20% off official, per second)

Video billing is duration (seconds) × rate per second. Rates below are the 720p base; higher sora-2-pro resolutions use the same multipliers as official tiers.

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

POST https://apimaster.ai/v1/v1/videos/generations

Headers

Header Value
Authorization Bearer YOUR_API_KEY
Content-Type application/json

Body

Field Type Required Description
model string yes sora-2 / sora-2-pro (or sora)
prompt string yes Video description
duration integer no 4 / 8 / 12 / 16 / 20, default 4
resolution string no sora-2: 720p; sora-2-pro also 1080p / 1024p, default 720p
aspect_ratio string no Landscape 16:9 / landscape; portrait 9:16 / portrait, default 16:9
image_urls string[] no Image-to-video; at most 1 public image URL

Example (text-to-video)

curl -s "https://apimaster.ai/v1/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"
    }
  ]
}

Use the returned task_id (APIMaster task ID) for polling and download.

Poll task status

GET https://apimaster.ai/v1/v1/videos/{task_id}

Returns OpenAI Video–compatible JSON. Common status values: queued / in_progress / completed / failed.

curl -s "https://apimaster.ai/v1/v1/videos/task_xxxxxxxx" \
  -H "Authorization: Bearer YOUR_API_KEY"

Completed example (fields may vary slightly by version):

{
  "id": "task_xxxxxxxx",
  "status": "completed",
  "url": "https://apimaster.ai/v1/videos/task_xxxxxxxx/content"
}

Note: The url field is always an APIMaster download URL. Use it directly to fetch the MP4.

Download video

After completed:

curl -L "https://apimaster.ai/v1/v1/videos/task_xxxxxxxx/content" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o output.mp4

Image-to-video

curl -s "https://apimaster.ai/v1/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",
    "image_urls": ["https://example.com/reference.jpg"]
  }'

When image_urls is set, orientation is inferred from the reference image; aspect_ratio can be omitted.

OpenAI-compatible submit (optional)

curl -s "https://apimaster.ai/v1/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "prompt": "A calm ocean wave at sunset",
    "seconds": "4",
    "size": "1280x720"
  }'
OpenAI field Maps to
seconds duration
size=1280x720 720p + 16:9
size=720x1280 720p + 9:16
input_reference / reference image image_urls

Polling tips

  • Wait 10–20 seconds after submit before the first poll; then every 3–5 seconds
  • Typical generation time: 1–3 minutes (depends on duration and load)
  • Video links expire in about 24 hours — save to your own storage

Error codes

Common HTTP / code values:

code Meaning
400 Invalid parameters
401 Invalid API key
402 Insufficient balance
429 Rate limited
500 / 502 Temporary error, retry

Related