Skip to main content
Archived page: the Sora 2 video API has been retired. LaoZhang API stopped serving Sora 2 on July 1, 2026, and OpenAI removed the Videos API, sora-2, and sora-2-pro from its API on September 24, 2026. This page keeps the legacy route documentation for existing integrations, and its examples no longer work.For video generation, use Wan 2.7 or Seedance 2.0. To migrate, see Sora 2 API retired: move to Wan or Seedance.
The legacy async endpoint was https://api.laozhang.ai/v1/videos. A call took three steps: create a task, query its status, then download the video. The async flow ran on a task queue and supported long-running tasks.

Image-to-video upload method

Async API differs significantly from Sync API for image-to-video: If you have an image URL: Download it locally first, then upload via Async API. Example Comparison:

Async API characteristics

  • Task queue: Avoids long-connection timeout issues
  • Failure billing: Billing for failed tasks (content violations, queue timeouts, generation failures) follows the console records; abnormal Sync API charges follow the console order status
  • Flexible polling: Query task status and progress anytime
  • Parameterized control: Resolution and duration are set through parameters

Sync vs Async Comparison

The legacy route recommended the Async API for production workloads and batch generation.

Quick Start

Async calling consists of three steps:
1

Create Video Task

POST request to create task, get task ID
2

Query Task Status

Periodically poll to check generation progress
3

Download Video

Retrieve video file after task completes

Complete Example

API Endpoints

1. Create Video Task

POST https://api.laozhang.ai/v1/videosCreate a new video generation task

Request Parameters

Model Selection
  • sora-2: Base model, 720P resolution, $0.15/call (historical price)
  • sora-2-pro: HD model, 1080P resolution, generation time ~10 minutes, $0.8/call (historical price)

Response Fields

2. Query Task Status

GET https://api.laozhang.ai/v1/videos/{video_id}Query current status and progress of video generation task

Path Parameters

Response Fields

Task Status

3. Get Video Content

GET https://api.laozhang.ai/v1/videos/{video_id}/contentDownload completed video file

Path Parameters

Response

Returns binary stream of video file (MP4 format)
Important NoticeVideo files are stored for 24 hours only. Please download and save to local storage promptly!

Complete Code Examples

Python Example (with Polling Logic)

JavaScript/Node.js Example

Best Practices

Recommended polling interval: 3-5 seconds
Reasoning:
  • Video generation typically takes 2-5 minutes
  • 3-5 seconds provides timely progress feedback
  • Avoids excessive requests
Recommended timeout: 10 minutes (600 seconds)
Note:
  • Task timeout doesn’t auto-cancel
  • Can continue querying same video_id later
  • Task validity period is 24 hours
Suggested retry logic:
Retry scenarios:
  • ✓ Network errors → Retry
  • ✓ Service busy (503) → Retry
  • ✗ Content violation → Don’t retry, modify prompt
  • ✗ Insufficient balance → Don’t retry, confirm account credit first
Concurrency control recommendations:
Recommendations:
  • Creating tasks: High concurrency OK (10-30)
  • Querying status: Recommended concurrency ≤ 10
  • Downloading videos: Recommended concurrency ≤ 5

Pricing

Async API has exactly the same pricing as Sync API, billed per call.
The prices below are historical prices from before the legacy route was retired. Billing Rules:
  • Charges follow the console order status
  • Failed, timed-out, cancelled, and content-safety-rejected tasks follow the console records
  • Whether status queries are billed follows the console records
Async API billing: Check any abnormal status against the console order and billing records. If a record looks wrong, contact support for a review.

FAQ

Task validity: 24 hours
  • After creating task, expires_at field shows expiration time
  • Can query task status anytime within 24 hours
  • After video generation completes, file is stored for 24 hours
  • After 24 hours, task and video will be automatically cleaned
Recommendations:
  • Download video immediately after completion
  • Don’t rely on server for long-term storage
The legacy route did not support manual task cancellation
  • Once created, task will auto-queue for execution
  • If no longer needed, simply ignore it
  • Billing for unfinished tasks follows the console records
Alternatives:
  • Wait for task to naturally complete or fail
  • Task auto-expires after 24 hours
Possible reasons:
  1. Incorrect video_id - Check if fully copied
  2. Task expired - Over 24 hours
  3. Network issues - Retry request
Solution:
Yes, they’re completely independentTwo API systems are completely independent:
  • Different endpoints
  • Different calling methods
  • Same pricing
  • Share same API Key and balance
Usage recommendations:
  • Quick testing → Use sync API
  • Production environment → Use async API (more stable)
  • Batch generation → Use async API
Possible reasons:
  1. Normal - Some processing stages update slowly
  2. Queue waiting - May be queued during peak hours
  3. Task stuck - Rare cases where task may get stuck
Handling:
  • Continue waiting 5-10 minutes
  • If no change after 10 minutes, contact support
  • Provide video_id for troubleshooting
No! Only local file upload is supported.Correct approach:
Not supported:
  • ✗ Image URLs
  • ✗ Base64 encoding
  • ✗ Online image links
Reason: Async API uses multipart/form-data format, supporting only local file streams.
Supported formats:
  • ✓ JPG / JPEG
  • ✓ PNG
  • ✓ WebP
Image requirements:
  • File size: < 5MB (recommended)
  • Resolution: Recommended 1280x720 or similar ratio
  • Source: Must be local file
Auto-detect MIME type:
Yes, prompt parameter is required!Even if you just want the image to “naturally animate”, you need to provide a description:Recommended simple prompts:
More specific prompts work better:
Same price.Billing notes:
  • Image-to-video and text-to-video cost the same
  • Charges follow the console order status
  • Billing for failed tasks (including format errors and content violations) follows the console records
Almost no impact.Image-to-video and text-to-video take similar time:
  • Typical time: 2-5 minutes
  • Factors: Video length, queue size, complexity
Image size impact:
  • Recommended < 5MB: Fast upload, fast processing
  • Large images: Only affects upload time (seconds), no significant impact on generation time

Error Handling

Common Error Codes

Error Response Format

Technical Support

Contact us if you have any questions:

Next Steps

Sync API

Check out sync API approach

Examples

View more usage examples

Pricing

Learn about detailed pricing

FAQ

View more Q&A