https://api.yelinai.com
Required endpoints: 2
POST /v1/video/generations: create a video generation taskGET /v1/video/generations/{task_id}: query task status and get the result URL
API Flow
SD2.0 video generation is an asynchronous task API. Create a task first, poll the task bytask_id, then download the video after the task completes.
- Create task
POST /v1/video/generations with the model, prompt, video parameters, and optional reference files.
- Poll status
GET /v1/video/generations/{task_id} and check status.
- Download video
status=completed, read the video URL from the response and download the mp4.
Common status progression:
failed with an error field.
Models
| Model | Description | Recommended use |
|---|---|---|
seedance-2.0 | SD2.0 Video Generation | Video generation, image reference, video reference |
Create Task
POST /v1/video/generations
Create an SD2.0 video generation task.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer $API_KEY |
Content-Type | Yes | multipart/form-data |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID, fixed as seedance-2.0 |
prompt | string | Yes | Video generation prompt, supports referencing uploaded files |
duration | integer | No | Output duration in seconds, default 5 seconds |
aspect_ratio | string | No | Output aspect ratio, e.g., 16:9, 9:16, 1:1, default 16:9 |
files | file | No | Reference files, supports images (jpg/png) and videos (mp4) |
first_frame_image | file | No | First frame image file, specifies the opening scene |
last_frame_image | file | No | Last frame image file, specifies the ending scene |
File Reference Syntax
Reference files by upload order in theprompt:
| Reference | Meaning |
|---|---|
@IMG_1 | First uploaded image file |
@IMG_2 | Second uploaded image file |
@VID_1 | First uploaded video file |
@VID_2 | Second uploaded video file |
Text-to-video Example
Image Reference Example
Multi-asset Reference Example
First/Last Frame Control Example
Create Response
| Field | Type | Description |
|---|---|---|
task_id | string | Task ID used for status polling |
status | string | Initial status, commonly pending |
created_at | string | Creation time (ISO format) |
Query Task
GET /v1/video/generations/{task_id}
Query the status of a video generation task.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | The task_id returned by the create task response |
Query Response
In progress:| Field | Type | Description |
|---|---|---|
task_id | string | Task ID |
status | string | pending, running, succeeded, completed, failed |
progress | integer | Task progress (0-100) |
video_url | string | Video URL returned after completion |
created_at | string | Creation time |
updated_at | string | Update time |
error | object | Error details for failed tasks |
Download Video
After the query response returnscompleted, read video_url and download it directly:
video_url is usually a temporary signed URL. Download it immediately or copy it to your own object storage.
Full Python Example
FAQ
What are the file upload limitations? Currently supports jpg, png image formats and mp4 video format. Individual file size should not exceed 50MB. How to correctly reference uploaded files? By upload order, use@IMG_1, @IMG_2 for images, and @VID_1, @VID_2 for videos.
How long does a task take to complete?
Typically 30-120 seconds depending on video duration and server load. Recommended polling interval is 20-30 seconds.