Video

Video generation is asynchronous. Create a task, store its ID, poll the task status, and download the result after completion.

The general video endpoints are:

POST /v1/videos
GET  /v1/videos/{task_id}
GET  /v1/videos/{task_id}/content

Create a video task

The /v1/videos endpoint accepts multipart form data:

curl https://getrouter.ai/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=MODEL_ID" \
  -F "prompt=A paper airplane flying through a quiet modern office" \
  -F "seconds=8"

For image-to-video input, include a reference file when supported by the model:

curl https://getrouter.ai/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=MODEL_ID" \
  -F "prompt=Add a slow camera push and subtle movement" \
  -F "seconds=8" \
  -F "[email protected]"

A successful response includes a task identifier such as id, plus task metadata such as status, progress, model, duration, or timestamps when available.

Check task status

curl https://getrouter.ai/v1/videos/TASK_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

Poll at a reasonable interval. Stop polling when the task reaches a terminal success or failure state.

Download the result

After the task completes:

curl -L https://getrouter.ai/v1/videos/TASK_ID/content \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output result.mp4
  1. Validate the model, duration, and input before submission.
  2. Submit the task once.
  3. Persist the returned task ID.
  4. Poll with backoff instead of rapid repeated requests.
  5. Record terminal errors for troubleshooting.
  6. Download completed content promptly.
Warning

Do not automatically create a replacement task when a status request times out. First query the original task ID to avoid duplicate generation and duplicate charges.

Provider-specific video APIs

The API specification also includes provider-compatible video paths, including Kling-style and other task formats. Request fields and status responses differ across these endpoints. Use the general /v1/videos flow for new integrations unless a model or existing client requires a provider-specific path.

See the API Reference for the currently exposed paths and schemas.

Cost controls

Video cost can depend on the model, duration, resolution, quality, or input type. Review Pricing and start with short test jobs before running automated batches.

Next steps