Basic Information
Endpoint:https://api.yelinai.com/v1/chat/completionsWith Watermark Endpoint: https://api.yelinai.com/v1/chat/completions?watermark=trueMethod: POSTAuthentication: Bearer Token (API Key)Content Type: application/json
10/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 Documentation
Response 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
cURL Python JavaScriptImage-to-Video (URL)
cURL PythonImage-to-Video (Base64)
PythonStreaming Output
Python JavaScriptError 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 Video generation takes 2-4 minutes, recommend setting timeout to 5-10 minutes.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.