/APIXO Docs

Sora 2 Pro

OpenAI Sora 2 Pro high-quality video generation with text-to-video and image-to-video

Endpoints

MethodEndpointDescription
POST/api/v1/generateTask/sora-2-proCreate generation task
GET/api/v1/statusTask/sora-2-proQuery task status

Authentication

All requests require an API Key in the header:

Authorization: Bearer YOUR_API_KEY

Request Body

{
  "request_type": "async",
  "callback_url": "https://...",
  "provider": "auto",
  "input": {
    "mode": "text-to-video",
    "prompt": "...",
    "duration": 10,
    "size": "720*1280"
  }
}

Parameters

Parameter
Required
Default
Description
request_typestring
async
async (polling) or callback (webhook)
callback_urlstring
Callback URL, required when request_type=callback
providerstring
auto
Routing strategy: auto, value, or official
inputobject
Model input parameters

Mode Options:

  • text-to-video — Generate video from text prompt
  • image-to-video — Generate video from reference image

Example

Text-to-Video

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": 10,
      "size": "1280*720"
    }
  }'

Image-to-Video

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/callback",
    "input": {
      "mode": "image-to-video",
      "prompt": "make this image come alive with subtle motion",
      "duration": 15,
      "resolution": "1080p",
      "image_urls": [
        "https://example.com/reference_image.jpg"
      ]
    }
  }'

Response

POST /api/v1/generateTask/sora-2-pro

Returns taskId on success for subsequent status queries.

Success:

{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}

Error:

{
  "code": 400,
  "message": "Insufficient credits",
  "data": null
}
{
  "code": 400,
  "message": "Content violates provider policy, please adjust the prompt",
  "data": null
}

GET /api/v1/statusTask/sora-2-pro

Query task execution status and results via taskId.

curl -X GET "https://api.apixo.ai/api/v1/statusTask/sora-2-pro?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"

Success:

{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965730929,
    "costTime": 120000
  }
}

Failed:

{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "CONTENT_VIOLATION",
    "failMsg": "Content does not meet safety guidelines"
  }
}

Status Response Fields

FieldTypeDescription
taskIdstringUnique task identifier
statestringpending processing success failed
resultJsonstringJSON containing resultUrls array (on success)
failCodestringError code (on failure)
failMsgstringError message (on failure)
createTimeintegerTask creation timestamp (ms)
completeTimeintegerTask completion timestamp (ms)
costTimeintegerProcessing duration (ms)

Error Codes

CodeDescription
400Invalid parameters or request error
401Invalid or missing API Key
429Rate limit exceeded
Fail CodeDescription
CONTENT_VIOLATIONContent violates safety guidelines
INVALID_IMAGE_URLCannot access provided image URL

Rate Limits

LimitValue
Requests60 / minute
Concurrent tasks10

Exceeding limits returns 429 error. Wait and retry.


Tips

  • Generation time: Average ~3 minutes per video. Submit task, wait 120 seconds, then poll every 5 seconds.
  • Callback mode: Due to long generation times, strongly recommend using callback mode.
  • Video expiration: Result URLs are valid for 15 days. Download promptly.
  • Content moderation: Prompts must comply with content safety guidelines. Violations return CONTENT_VIOLATION.
  • Image formats: image_urls supports JPG, PNG, WebP, max 10MB per image.
  • Duration options: 10s for standard clips, 15s for extended narratives.
  • Official route durations: When using provider=official, only 12-second output is supported. Regardless of the duration value passed (10 or 15), the generated video will always be 12 seconds. Billing is calculated as the official per-second rate multiplied by 12.
  • Size vs Resolution:
    • size is used in text-to-video mode: 720*1280 (portrait), 1280*720 (landscape), 1024*1792, 1792*1024
    • resolution is used in image-to-video mode: 720p or 1080p

On this page