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.

Request pattern

Create first, then query for results

Common use cases

Text-to-video, creative clips, ad assets, cinematic scene generation

Recommended first test

Create a short task first and confirm that you receive a task_id and status updates

Recommended first-test flow

01
Create the task

Submit the prompt, duration, ratio, and other parameters to receive a task_id.

02
Store the task ID

You will need the task ID for later get, list, or cancel operations.

03
Check task status

Poll the task detail or task list endpoint to see whether processing is still ongoing.

04
Read the final result

Once the task reaches a success state, read the returned video result or output URL.

POST/v1/videos/generations

Create task

GET/v1/videos/generations

List tasks

GET/v1/videos/generations/:task_id

Get task

DELETE/v1/videos/generations/:task_id

Cancel task

Create video task example

bash
curl 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.