altrouter.ai
CORE

Video

Video generation through /videos. The one asynchronous surface: the call returns immediately and you poll for the result, because a render takes minutes.

How it works

Creating a render returns a video object in queued with a vid_… id. You then poll GET /videos/{id} until the status is completed (the finished mp4 is in url) or failed (with the reason in error). Credit is reserved at create time and charged only for a completed render — a failed one costs nothing.

PythoncURLJSON
import time, requests

h = {"Authorization": "Bearer ar-..."}

job = requests.post("https://api.altrouter.ai/v1/videos", headers=h, json={
    "model": "veo-3.1-fast",
    "prompt": "a drone shot over a rocky coastline at sunrise",
    "seconds": 8,
}).json()

while job["status"] in ("queued", "in_progress"):
    time.sleep(10)
    job = requests.get(f"https://api.altrouter.ai/v1/videos/{job['id']}", headers=h).json()

print(job["url"])

Image-to-video

Pass a reference frame in the image field (URL or base64; input_reference is accepted for a single frame) — the router selects the model’s image-to-video variant. Some models (Hailuo 2.3) work only this way and return a 400 without a frame.

JSON
{
  "model": "hailuo-2.3",
  "prompt": "the dog turns its head and smiles at the camera",
  "seconds": 6,
  "image": ["https://example.com/dog.jpg"]
}

Length & price

Length is set with seconds (or its alias duration). The allowed values differ per model and are listed on its page; an out-of-range value is clamped to the nearest allowed one. Most models are billed per second; Veo is billed a flat price per clip regardless of length. The other knobs (resolution, aspect ratio, audio) are the model’s own params — see its page in the catalog.

Downloading

The finished file is at the url link; the same file is served by GET /videos/{id}/content as a 302 redirect — handy when you want to hand the id straight to a player or a downloader.

i
Provider links to generated video expire within about a day, so we immediately re-host the result to our own storage and return a permanent URL on api.altrouter.ai/media. It never expires — see Data retention.
NextErrors