Sora 2 API

Build on top of the Sora 2 API

Ship text-to-video experiences backed by OpenAI Sora 2 and Sora Pro. Authenticate with API keys, poll task status, and deliver final videos in minutes.

Why teams rely on the Sora 2 API

Deliver resilient video generation workflows with predictable polling, optional webhooks, and automatic storage uploads.

Sora 2 + Sora Pro

Pick the model string that matches your quality and cost needs: sora-2 or sora-2-pro.

Predictable polling

Create a task, then poll the check-result endpoint to keep status and progress in sync without SSE.

Async webhook support

Provide a webhook endpoint to receive completion payloads without maintaining a connection or polling loop.

Authentication & Base URL

All endpoints live under https://FreeSoraGenerator.com/api. Supply the API key created in the console via the Authorization header.

  • Send the header Authorization: Bearer YOUR_API_KEY with every request.
  • Use Content-Type: application/json when posting payloads.
  • Each generation request deducts 20 credits (sora-2) or 30 credits (sora-2-pro); failed jobs are refunded automatically.

Core endpoints

Start by creating a generation task, then poll or listen for the result.

Create Sora 2 video

Kick off a Sora 2 or Sora Pro generation job with text-to-video or optional image-to-video prompts.

Method: POSTPath: /api/v1/video/sora-video

Payload parameters

  • Required. Use "sora-2" or "sora-2-pro" to target the model variant you need.
  • Required. Natural language description of the scene you want Sora to create.
  • Optional. Base64 data URL for image-to-video mode; uploaded to storage automatically.
  • Optional. Supported values: "9:16" (default) or "16:9".
  • Optional. HTTPS endpoint that receives the final result payload when the task succeeds.

Notes

  • Responses return immediately with a taskId; poll check-result until status is succeeded or failed.
  • Provide webHook to receive the final payload asynchronously without running a polling loop.

Sample request

curl -X POST https://FreeSoraGenerator.com/api/v1/video/sora-video \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2-pro",
    "prompt": "A cinematic shot of a futuristic city at sunset, captured in 4K.",
    "aspectRatio": "9:16"
  }'

Sample response

{
  "code": 0,
  "message": "Success",
  "data": {
    "taskId": "task-123",
    "status": "pending",
    "progress": 0,
    "estimate_seconds": 180
  }
}

Check generation result

Poll the latest status for a generation task to track progress and retrieve results.

Method: POSTPath: /api/video-generations/check-result

Payload parameters

  • Required. The identifier returned when you created the generation task.

Notes

  • The endpoint verifies the task belongs to your account before returning data.
  • Failed jobs return credits automatically and expose refund metadata in the response.

Sample request

curl -X POST https://FreeSoraGenerator.com/api/video-generations/check-result \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "task-123"
  }'

Sample response

{
  "code": 0,
  "message": "Success",
  "data": {
    "status": "running",
    "progress": 45,
    "result_url": null,
    "result_urls": [],
    "failure_reason": null,
    "error_message": null,
    "credits_refunded": false
  }
}

1. Create the task

Send the Sora2 API request with your prompt and optional webhook URL, then store the returned taskId.

2. Track progress

Subscribe to the streaming events or call the check-result endpoint until the status becomes succeeded or failed.

3. Deliver the video

Use the storage-backed URLs in result_url/result_urls to serve or download the generated video.

Frequently asked questions

How do I authenticate my requests?

Create an API key in the console, then include it as Authorization: Bearer YOUR_API_KEY. Keys can be rotated at any time.

How should I poll for results?

After calling create, store the taskId. Call /api/video-generations/check-result every 3-5 seconds until status is succeeded or failed, then use result_url/result_urls.

How are credits handled for failures?

We automatically refund credits when a task fails and return refund_trans_no plus credits_refunded=true in the check-result payload for audit trails.

Helpful resources

Launch with Sora2 API today

Create your API key and start generating cinematic AI videos in minutes.