Sora2 API

Build on top of the Sora2 API

Ship text-to-video experiences backed by OpenAI Sora 2. Authenticate with API keys, stream progress events, and deliver final videos in minutes.

Why teams rely on the Sora2 API

Deliver resilient video generation workflows with streaming progress, optional webhooks, and automatic storage uploads.

Developer-friendly streaming

Receive server-sent events with live status, progress, and final video URLs to keep your UI in sync.

Async webhook support

Provide a webhook endpoint to receive completion payloads without maintaining a long-lived connection.

Transparent billing

Each call costs 10 credits with automatic refunds when a generation fails, so you stay in control.

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 10 credits; failed jobs are refunded automatically.

Core endpoints

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

Create Sora2 video

Kick off a Sora2 generation job with text-to-video or optional image-to-video prompts.

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

Payload parameters

  • Required. Must be "sora-2" to target the latest model.
  • 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.
  • Optional. Set true in webhook mode to suppress intermediate SSE progress events.

Notes

  • Responses are streamed over Server-Sent Events; keep the connection open and parse progress updates until completion.
  • Provide webHook to receive the final payload asynchronously without polling.

Sample request

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

SSE

data: {"id":"task-123","status":"running","progress":45}

data: {"id":"task-123","status":"succeeded","progress":100,"results":[{"url":"https://cdn.example.com/videos/task-123.mp4"}]}

Check generation result

Poll the latest status for a generation task if you are not listening to the stream or webhook.

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.

What does the streaming response look like?

The endpoint sends Server-Sent Events where each data line is a JSON object containing id, status, progress, and optional results. Parse the event stream until you receive status "succeeded" or "failed".

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.