Skip to main content

Documentation Index

Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Sora 2 Pro is an OpenAI video generation model for premium text-to-video and image-to-video workflows. Use this page when you are ready to call the API after trying the model in the APIXO playground.
CapabilityValue
Model IDsora-2-pro
Modestext-to-video, image-to-video
Prompt length1-5000 characters
Duration4, 8, or 12 seconds
Text-to-video sizes720*1280, 1280*720, 1024*1792, 1792*1024
Image-to-video resolutions720p, 1080p
Reference images1 URL for image-to-video
Output formatMP4 video URL in resultJson.resultUrls

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/sora-2-proSubmit a generation task
GET/statusTask/sora-2-pro?taskId={taskId}Poll task status and retrieve results
All requests require your APIXO API key:
Authorization: Bearer YOUR_API_KEY
Submit requests also require:
Content-Type: application/json

Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a taskId.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/sora-2-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic tracking shot of a futuristic city with flying cars",
      "duration": 4,
      "size": "1280*720"
    }
  }'
Successful response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Save the taskId; you need it to poll for the final video.

Poll for result

curl -X GET "https://api.apixo.ai/api/v1/statusTask/sora-2-pro?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Processing response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/xxx.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965790929,
    "costTime": 180000
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "PromptInvalid",
    "failMsg": "Prompt is invalid or rejected by upstream service",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;

Request body

Text-to-video

{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a cinematic tracking shot of a futuristic city with flying cars",
    "duration": 8,
    "size": "1280*720"
  }
}

Image-to-video

{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "make this image come alive with subtle camera motion",
    "duration": 4,
    "resolution": "1080p",
    "image_urls": [
      "https://example.com/reference-image.jpg"
    ]
  }
}

Parameters

request_type
string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a public URL that can receive the final task payload. See Webhooks.
input
object
required
Sora 2 Pro input parameters.

Response format

Submit task response

POST /generateTask/sora-2-pro returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing the generated video URLs. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds. Present after successful completion.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/sora-2-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "image-to-video",
      "prompt": "animate the scene with slow cinematic camera movement",
      "duration": 4,
      "resolution": "1080p",
      "image_urls": [
        "https://example.com/reference-image.jpg"
      ]
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

Sora 2 Pro is billed per second. The selected output tier determines the per-second unit price, and the final task cost is:
unit price x duration
Output tierAPIXO price
720p$0.27 / second
1080p$0.45 / second
For text-to-video, 720*1280 and 1280*720 use the 720p tier, while 1024*1792 and 1792*1024 use the 1080p tier. For image-to-video, the resolution value selects the tier directly. For current route and market comparison pricing, see Pricing.

Latency and polling

Video generation usually takes longer than image generation. Actual latency may vary by prompt complexity, selected duration, output tier, route health, and current queue load.
DurationTypical generation timeRecommended first pollPoll interval
4 seconds2-5 minutes120s after task creation5-10s
8 seconds2-5 minutes120s after task creation5-10s
12 seconds3-6 minutes120s after task creation5-10s
For production workloads, use callback mode to avoid frequent polling during long video generations.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

CodeMeaningWhat to do
400Invalid request body, parameter, prompt, or image URL shapeFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or route cannot access the model, or content was rejectedCheck permissions and revise the prompt or input
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server errorRetry with backoff
502Upstream service errorRetry with backoff
504Upstream timeoutRetry or use callback mode for long-running jobs

Task failures

SymptomCommon causeWhat to do
Prompt rejectedPrompt or image content was flagged by safety checksRevise the prompt or use a different input image
Missing parameterRequired fields are absent for the selected modeCheck duration, size, resolution, and image_urls
Invalid imageThe image URL cannot be fetched or decoded by the upstream serviceUse a public direct image URL
Timeout or no progressThe upstream job is slow or temporarily unavailableKeep polling with backoff, retry later, or use callback mode
Insufficient balanceThe account does not have enough balance for the selected duration and tierAdd balance before retrying

Practical checks

  • prompt must be a non-empty string and must not exceed 5000 characters.
  • duration is required and must be 4, 8, or 12.
  • size is required only for text-to-video.
  • resolution and image_urls are required only for image-to-video.
  • image_urls must contain exactly 1 image URL. Use JPG, PNG, or WebP when possible, and keep the image under 10 MB to reduce upstream rejections.
See Error Codes for the full error reference.