Basic Information
Endpoint:
https://api2.laozhang.ai/v1/chat/completionsWith Watermark Endpoint: https://api2.laozhang.ai/v1/chat/completions?watermark=trueMethod: POSTAuthentication: Bearer Token (API Key)Content Type: application/json10/18 New Feature: Watermark OptionBy default, generated videos have no watermark. To generate videos with Sora native watermark, add the parameter
?watermark=true to the URL.Authentication
Include your API key in the request header:Request Format
Basic Structure
Request Parameters
Messages Array
Each message object contains:Content Array
Supports two types of content:Text Content
Image Content (Optional)
Image Restrictions
- Maximum 1 image
- Supports URL or Base64 format
- Recommended resolution not exceeding 2048×2048
- Real person photos not supported
Supported Models
Price Update15-second models are now available at $0.15/call, same price as 10-second models!
HD ModelHD model
sora-2-pro (HD 1080P, $0.8/call) is only available via Async API due to longer generation time (~10 minutes).👉 View Async API DocumentationResponse Format
Non-streaming Response
Response Field Description
Streaming Response (SSE)
When"stream": true is enabled, returns Server-Sent Events format:
Streaming Response Fields
Complete Examples
Text-to-Video
Image-to-Video (URL)
Image-to-Video (Base64)
Streaming Output
Error Codes
Error Response Format
Rate Limits
Currently no strict rate limits, but recommended:
- Control concurrency when batch generating (recommended 2-3)
- Avoid large number of requests in short time
- Set reasonable retry intervals
Best Practices
Timeout Settings
Timeout Settings
Video generation takes 2-4 minutes, recommend setting timeout to 5-10 minutes.
Error Handling
Error Handling
Add retry logic to handle temporary errors:
Video Download
Video Download
Download immediately after generation (valid for 1 day):
Streaming Output Monitoring
Streaming Output Monitoring
Use streaming output to view progress in real-time:
SDK Support
Official SDK
- Python:
openai>= 1.0.0 - Node.js:
openai>= 4.0.0
Third-party SDK
Any SDK compatible with OpenAI API format can be used, just modifybase_url.
Technical Specifications
Next Steps
Quick Start
View quick start guide
Usage Examples
View more code examples
Model Pricing
Learn about model comparison and pricing
FAQ
View frequently asked questions