Skip to content

UlazAI developer docs

Sora 2 API: video generation, pricing and access

Sora 2 API: video generation, pricing and access

Legacy reference: this page documents the Sora 2 API route through UlazAI - endpoints, credit pricing, prompt rules, status polling and CDN output handling - as it worked before OpenAI discontinued Sora. For new integrations, use the current models in the Video Studio API docs.

Status: OpenAI discontinued the Sora web and app experiences on April 26, 2026, and shut down its own Sora API on September 24, 2026 (source: OpenAI Help Center). UlazAI's Sora routes have had no completed generation on either path since April 2026 (production job tables checked October 27, 2026: the Video Studio route and the legacy API task queue, last completions on April 8, 2026). Treat Sora availability as provider-specific and verify the model picker before planning production.

✨ Sora 2 Features

✅ Text-to-video generation

✅ Image-to-video animation

✅ Duration options shown by the current API route

✅ Output settings shown in the current API documentation

✅ Supported aspect ratios depend on the selected route

✅ Asynchronous processing with status polling

✅ Automatic R2 storage with CDN

✅ Email notifications when complete

POST /api/v1/sora/generate/text-to-video/

Generate Video from Text

Create a 10-second video from a text prompt using Sora 2.

Request Body

{
  "prompt": "A serene mountain landscape at sunrise with birds flying",
  "aspect_ratio": "landscape",  // Options: "landscape", "portrait", "square"
  "quality": "standard"          // Options: "standard", "high"
}

Parameters

prompt * (string)

Text description of the video to generate. Max 5000 characters. Be descriptive for best results.

aspect_ratio (string)

Video aspect ratio. Options: landscape (16:9), portrait (9:16), square (1:1). Default: landscape

quality (string)

Quality preset. Options: standard, high. High quality uses more processing time. Default: standard

prompt_directory_optin (boolean) 💰 -10 CREDITS

Share your video to our public Prompt Directory and get 10 credits discount! Default: true

Success Response (201)

{
  "success": true,
  "data": {
    "task_id": "sra_2_1234567890abcdef",
    "status": "processing",
    "estimated_completion": "varies by queue",
    "credits_charged": 80,
    "credits_remaining": 920,
    "webhook_url": "https://ulazai.com/api/v1/sora/status/sra_2_1234567890abcdef/",
    "message": "Sora 2 video generation started successfully"
  }
}

cURL Example

curl -X POST https://ulazai.com/api/v1/sora/generate/text-to-video/ \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A serene mountain landscape at sunrise with birds flying across the sky",
    "aspect_ratio": "landscape",
    "quality": "standard"
  }'
POST /api/v1/sora/generate/image-to-video/

Generate Video from Image

Animate a static image into a 10-second video using Sora 2.

Request Body

{
  "image_url": "https://example.com/your-image.jpg",
  "prompt": "Camera slowly zooms in as the character turns and smiles",
  "aspect_ratio": "landscape",
  "quality": "standard"
}

Parameters

image_url * (string)

URL of the source image to animate. Must be publicly accessible. Supported formats: JPG, PNG, WebP.

prompt * (string)

Description of how to animate the image. Max 5000 characters.

aspect_ratio (string)

Must match the source image aspect ratio for best results.

quality (string)

Quality preset. Default: standard

prompt_directory_optin (boolean) 💰 -10 CREDITS

Share your video to our public Prompt Directory and get 10 credits discount! Default: true

GET /api/v1/sora/status/{task_id}/

Check Generation Status

Get the current status and result of a Sora video generation task.

Response States

Processing

{
  "success": true,
  "data": {
    "task_id": "sra_2_1234567890abcdef",
    "status": "processing",
    "progress": 45,
    "estimated_completion": "varies by queue"
  }
}

Success

{
  "success": true,
  "data": {
    "task_id": "sra_2_1234567890abcdef",
    "status": "success",
    "video_url": "https://cdn.ulazai.com/sora/videos/sra_2_1234567890abcdef.mp4",
    "thumbnail_url": "https://cdn.ulazai.com/sora/thumbnails/sra_2_1234567890abcdef.jpg",
    "duration": 10,
    "resolution": "1920x1080",
    "file_size": "15.2 MB",
    "created_at": "2025-01-03T10:15:30Z"
  }
}

Failed

{
  "success": false,
  "error": "Video generation failed",
  "error_details": "Content policy violation detected in prompt",
  "credits_refunded": 80
}

cURL Example

curl -X GET https://ulazai.com/api/v1/sora/status/sra_2_1234567890abcdef/ \
  -H "Authorization: Token YOUR_API_KEY"

🔑 Sora 2 API access: official vs UlazAI (historical)

Sora 2 API access depends on the provider, organization verification and account tier. Verify current access and pricing before integration.

Official OpenAI API

  • Invite / organization-verification gated
  • Billed per second of video
  • You manage your own OpenAI key and quotas

Sora 2 on UlazAI

  • Was callable with one UlazAI API key - no separate invite (legacy route, no completed generations since April 2026)
  • Priced in shared credits, refunded on failed jobs
  • Same key also calls Veo 3, Seedance and Kling - compare cost and latency from one balance

Want to weigh Sora 2 against the alternatives first? See the 2026 AI video models guide.

💰 Sora 2 Pricing

Text-to-Video

Check current API pricing

for the selected duration and model

• Check current output settings

• Check supported aspect ratios

• Processing time varies by queue

Image-to-Video

Check current API pricing

for image-to-video

• Upload a supported image you may use

• Custom motion prompts

• Processing time varies by queue

Calculate your batch from the current model cost and expected retry rate.

📚 Best Practices

Prompt Guidelines

  • Be specific about camera movements (pan, zoom, tilt)
  • Describe lighting and atmosphere
  • Include character actions and expressions
  • Specify timing for key moments
  • Avoid copyrighted characters or brands

Image-to-Video Tips

  • Use high-quality source images (min 1024px)
  • Match aspect ratio to avoid cropping
  • Describe realistic motion for the scene
  • Consider physics and natural movement

Webhook Integration

  • Videos are automatically stored in R2 with CDN delivery
  • Email notifications sent when generation completes
  • Poll the status endpoint every 30 seconds for updates
  • Failed generations automatically refund credits

⚠️ Error Codes

400 Invalid request parameters or prompt too long
401 Invalid or missing API key
402 Insufficient credits
422 Content policy violation
429 Rate limit exceeded (max 10 concurrent)
500 Server error - credits will be refunded

💻 Code Examples

Python

import requests
import time

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://ulazai.com/api/v1"

# Generate video
response = requests.post(
    f"{BASE_URL}/sora/generate/text-to-video/",
    headers={"Authorization": f"Token {API_KEY}"},
    json={
        "prompt": "A beautiful sunset over the ocean with waves",
        "aspect_ratio": "landscape",
        "quality": "standard"
    }
)

if response.status_code == 201:
    task_id = response.json()["data"]["task_id"]

    # Poll for status
    while True:
        status_response = requests.get(
            f"{BASE_URL}/sora/status/{task_id}/",
            headers={"Authorization": f"Token {API_KEY}"}
        )

        status_data = status_response.json()["data"]

        if status_data["status"] == "success":
            print(f"Video ready: {status_data['video_url']}")
            break
        elif status_data["status"] == "failed":
            print("Generation failed")
            break

        time.sleep(30)  # Wait 30 seconds before next check

JavaScript (Node.js)

const axios = require('axios');

const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://ulazai.com/api/v1';

async function generateSoraVideo() {
    try {
        // Generate video
        const response = await axios.post(
            `${BASE_URL}/sora/generate/text-to-video/`,
            {
                prompt: 'A beautiful sunset over the ocean with waves',
                aspect_ratio: 'landscape',
                quality: 'standard'
            },
            {
                headers: { 'Authorization': `Token ${API_KEY}` }
            }
        );

        const taskId = response.data.data.task_id;
        console.log(`Generation started: ${taskId}`);

        // Poll for status
        const checkStatus = async () => {
            const statusResponse = await axios.get(
                `${BASE_URL}/sora/status/${taskId}/`,
                { headers: { 'Authorization': `Token ${API_KEY}` } }
            );

            const status = statusResponse.data.data.status;

            if (status === 'success') {
                console.log(`Video ready: ${statusResponse.data.data.video_url}`);
            } else if (status === 'failed') {
                console.log('Generation failed');
            } else {
                setTimeout(checkStatus, 30000); // Check again in 30 seconds
            }
        };

        setTimeout(checkStatus, 30000);

    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

generateSoraVideo();

❓ Sora 2 API FAQ

Is "sora2" (one word) the same as Sora 2?

Yes - "sora2", "sora2api" and "Sora 2" all refer to OpenAI's Sora 2 video model. This page documents how the Sora 2 API route worked through UlazAI, including endpoints, credit pricing and status polling.

Is the Sora 2 API free?

No, and the question is now historical: OpenAI discontinued the Sora web and app experiences on April 26, 2026 and shut down its own Sora API on September 24, 2026. On UlazAI generations were always credit-based, never free; since April 2026 no Sora generation has completed on that route. Check the model picker for what is currently available.

Is there a Sora 2 Pro?

Sora 2 Pro was OpenAI's higher-quality tier alongside Sora 2. With OpenAI's own Sora API shut down on September 24, 2026, treat any remaining "Sora 2 Pro" offering - including route availability on UlazAI - as provider-specific and verify it in the model picker before generating.

🗄️ Legacy Route: What Still Works

OpenAI discontinued Sora; for new video integrations use the current models in Video Studio. Verify availability in the model picker before planning production.

Sora route (legacy): what these docs described

The Sora route and request fields shown here are historical documentation of how the integration worked before OpenAI discontinued Sora; no completed generation has run on it since April 2026. Do not treat these examples or model names as the contract for a new integration - use the current video models in the API reference.

The documented pattern - submit, store the job identifier, poll until a terminal result and surface failures - still applies to the current video routes. Confirm model availability and credit estimate before submitting each job.

Music Studio Songs, instrumentals and your own lyrics. AI song generator