API Documentation
Quick integration guide and complete API reference
Video Generation
Video generation is asynchronous and does not return the final output immediately
Video generation is asynchronous. After task creation, get, list, and cancel operations return to the original channel. Final settlement happens when the task reaches a terminal state: successful tasks are corrected with final usage, while failed or cancelled tasks are refunded.
Unlike text or images, video usually requires a create-task step first, then polling, and finally reading the result. For a first integration, the real goal is to verify that the task flow works end to end.
Create first, then query for results
Text-to-video, creative clips, ad assets, cinematic scene generation
Create a short task first and confirm that you receive a task_id and status updates
Recommended first-test flow
Submit the prompt, duration, ratio, and other parameters to receive a task_id.
You will need the task ID for later get, list, or cancel operations.
Poll the task detail or task list endpoint to see whether processing is still ongoing.
Once the task reaches a success state, read the returned video result or output URL.
/v1/videos/generationsCreate task
/v1/videos/generationsList tasks
/v1/videos/generations/:task_idGet task
/v1/videos/generations/:task_idCancel task
Create video task example
bashcurl https://api.weiapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"prompt": "A slow cinematic pan through a rainy neon alley",
"duration": 5,
"ratio": "16:9",
"resolution": "720p"
}'Things to keep in mind
- Video endpoints usually do not return the final media synchronously, so receiving a task_id is the real starting point.
- For your first test, keep the duration short so you can verify the create -> poll -> complete flow faster.
- If the task fails or is cancelled, final settlement or refund will follow the task's terminal state.
- Set resolution to choose the output resolution. Common values are 480p, 720p, 1080p, and 4k. Supported values depend on the model.
