Prerequisites
1 Get API Key Login to YeLIn AI console to get your API key 2 Configure Billing Mode Edit token settings, choose either billing mode (both have same price):- Pay-as-you-go (Recommended): Uses balance first, auto-switches when low. Suitable for most users
- Pay-per-call: Direct charge per call. Suitable for strict budget control
请在 Console 查看对应界面截图。
Text-to-Video Example
About@sama in ExamplesYou may notice @sama used in examples. This is OpenAI CEO Sam Altman’s authorized ID, allowing his likeness to appear in videos.This is optional:
- ✓ Can use
@samaor other verified IDs - ✓ Can skip it and use normal scene descriptions (e.g., “a cat in a garden”)
- ✗ Cannot upload real person photos (will be rejected and charged)
Image-to-Video Example
Supports uploading reference images (up to 1 image), supports both URL and Base64 methods. cURL (URL) Python (URL) cURL (Base64)Streaming Output Example
Enable streaming output to view generation progress in real-time. Python (Streaming) JavaScript (Streaming)Output Interpretation
Streaming Output Format
When"stream": true is enabled, API returns SSE (Server-Sent Events) format:
Key Field Descriptions
choices[0].delta.content: Contains progress information or final video linkfinish_reason: When"stop", generation is completeusage: Last message contains token usage- Video link: Provided as Markdown link in success message
Generation Time
- Queue Wait: Depends on peak hours
- Video Generation: About 2-3 minutes (for 10-second video)
- Total: 2-5 minutes on average
Next Steps
API Reference
View detailed API documentationCode Examples
View more usage examplesBest Practices
Learn how to write better promptsFAQ
Common issues and solutionsImportant Notes
**Remember to download videos immediately!**Generated video URLs are valid for only 1 day. Please download to local storage after generation to avoid losing videos. Model Selectionsora_video2: Vertical screen (704×1280), suitable for mobile viewingsora_video2-landscape: Horizontal screen (1280×704), suitable for widescreen displays