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.

Complete Python Examples

Basic Text-to-Video

Streaming Output Example

Image-to-Video (URL)

Image-to-Video (Base64)

Automatic Video Download

JavaScript/Node.js Examples

Basic Text-to-Video

Streaming Output

Automatic Video Download

Cherry Studio Use Case

Cherry Studio is an AI chat client. With the legacy route, you could generate videos in it through sora_video2.

Configuration Steps

1

Configure API

Add laozhang.ai API configuration in Cherry Studio
2

Enable Video Feature

Find sora_video2 in model settings and enable video generation featureEnable video feature
3

Text-to-Video

Simply enter text description to generate video
4

Image-to-Video

Upload image + prompt to generate videoImage-to-video

Usage Examples

Text-to-Video

Directly enter in Cherry Studio dialogue box:
System will automatically:
  1. Display prompt optimization results
  2. Show generation progress (queue status, percentage)
  3. Provide video playback link

Image-to-Video

  1. Click upload image button and select reference image
  2. Enter prompt:

Batch Generation Examples

Python Batch Generation

Best Practices

  • Describe specific scenes and actions
  • Include details like lighting and atmosphere
  • Use authorized real person IDs like @sama
  • Avoid describing real human faces (will be rejected)
  • Set reasonable timeout (recommended 5 minutes)
  • Add retry logic
  • Record failure reasons
  • Use streaming output to monitor progress
  • Download immediately after generation (valid for 1 day)
  • Use streaming download for large files
  • Save to local or cloud storage
  • Make backups
  • Control concurrency when batch generating
  • Billing for failed tasks follows the console records
  • Download videos promptly (storage validity 1 day)

Next Steps

FAQ

View frequently asked questions

Model Pricing

Learn detailed model comparison

API Reference

View complete API documentation

Quick Start

Back to quick start guide