Skip to main content
Use the AntiRouter video API to submit a generation request, then retrieve the result with its task ID. This example creates a five-second, 720p video with w3.0-video. Check the model list and console for current availability and pricing.

1. Prepare your account and key

  1. Open Sign in, select Create account, and register with the verification code sent to your email.
  2. Open API Keys, select Create key under Inference keys, and copy the new key.
  3. Add credits so your available balance covers the generation request.
Set your key in your server-side environment. The value below is a placeholder:

2. Submit a video task

cURL
A successful submission returns HTTP 200. The IDs below are illustrative. Save the actual output.task_id from your response:
200

3. Retrieve the result

Replace the task ID with the value from your response and use your inference key:
Poll every three seconds as a starting point. PENDING and RUNNING mean the task is still in progress. Read output.video_url when the state is SUCCEEDED, and stop polling on FAILED or CANCELED. Querying a task does not create another generation.

Troubleshooting

See Generation for all fields and Query Task for statuses and a Python polling example.