Limited-time Thanksgiving offer · 50% off platform fees for new users’ first 7 days (1.25% instead of 2.5%). Sign up by Dec 1. Sign up now → Details
Discord

Multimodal

Async, job-based — create a job with a webhook_url and we POST you the finished video, so there's nothing to poll (polling GET /v1/videos/{id} still works as a fallback).

You pay per video, priced mostly by the second; polling for status is free (see Billing). The same API is served at https://videorouter.sh/v1 and https://videorouter.sh/api/v1.

Three generation modes share this one endpoint — which one you get depends only on which model you pass:

Text-to-video

import hashlib, hmac, requests
from flask import Flask, request, abort

# 1. create the job -- returns immediately with an id; webhook_url is where we send the result
requests.post(
    "https://videorouter.sh/api/v1/videos",
    headers={"Authorization": "Bearer llmr_sk_live_..."},
    json={
        "model": "minimax/h3/fal",
        "prompt": "a paper airplane gliding over a city",
        "duration_secs": 8,
        "webhook_url": "https://your-app.com/hooks/video",
    },
)

# 2. when the job finishes we POST it to that URL (the same object GET /v1/videos/{id} returns)
app = Flask(__name__)
SECRET = "whsec_..."  # Org admin > Webhooks

@app.post("/hooks/video")
def video_done():
    body = request.get_data()
    expected = hmac.new(SECRET.encode(), body, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(expected, request.headers["X-VideoRouter-Signature"]):
        abort(401)
    job = request.get_json()
    if request.headers["X-VideoRouter-Event"] == "video.completed":
        video_url = job["data"][0]["url"]  # the finished video
        cost = job["cost_usd"]
    else:
        print(job["error"])
    return "", 204  # any 2xx acknowledges the delivery

The sample above uses a webhook (recommended): the job id comes back immediately and your server is called when the video is ready, signed so you can verify it. See Webhooks for the payload, signature, and retry rules.

Or poll instead

No public URL to receive a webhook (a script, a notebook, a local app)? Poll GET /v1/videos/{id} until status leaves the queue. Same job object, same cost_usd on the finished job — some hosts report the final price a few seconds after the clip is ready, so on a completed job without it, poll again.

import time
import requests

# create
resp = requests.post(
    "https://videorouter.sh/api/v1/videos",
    headers={"Authorization": "Bearer llmr_sk_live_...", "Content-Type": "application/json"},
    json={
        "model": "minimax/h3/fal",
        "prompt": "a paper airplane gliding over a city",
        "duration_secs": 8,
    },
)
job = resp.json()

# poll until it leaves the queue ("queued" -> "in_progress" -> "completed"/"failed")
while job["status"] not in ("completed", "failed"):
    time.sleep(5)
    job = requests.get(
        f"https://videorouter.sh/api/v1/videos/{job['id']}",
        headers={"Authorization": "Bearer llmr_sk_live_..."},
    ).json()

if job["status"] == "completed":
    video_url = job["data"][0]["url"]  # the finished video
else:
    raise RuntimeError(job["error"])

The OpenAI SDK doesn't have first-class video methods yet — use its low-level client.post/client.get, or plain requests, against the same base_url.

model is "<creator>/<model>/<host>".

  • Soft preference. "minimax/h3/fal" above is a soft preference for Fal, not a hard pin: it still falls back across every other host confirmed to serve that checkpoint if Fal itself errors.
  • Cheapest automatically. Drop the host segment (just "minimax/h3") to route automatically to whichever host is cheapest right now instead.
  • Hard pin. For a hard pin (no fallback at all), use "provider": {"only": ["fal"], "allow_fallbacks": false}.

Full mechanics: Provider selection.

Resolution & aspect ratio

Pass resolution (a tier the model supports, e.g. "720p") and aspect_ratio to request a size — the same shape as /v1/images. aspect_ratio is one of 16:9 9:16 1:1 4:3 3:4 21:9.

  • Shape of the output. A ratio listed in the model’s capabilities.aspect_ratios (or reference_aspect_ratios) is sent to the host as you wrote it. With a first frame or a source clip, the output follows your input. So can a Seedance call with a reference video, unless you send task_type: reference. Explicit width and height take precedence. With fallbacks on, another host of the same model may not take the same ratios.
  • Most unsupported combinations are ignored, not rejected. Each model supports only some combinations; one it doesn’t have usually doesn’t return a 400 (4k and 21:9 are exceptions: they are routed only to hosts that offer them) — the model's default resolution/orientation is used, same as omitting both.
  • Seedance 2.5 and 21:9. It renders a true ultrawide clip at 480p/720p/1080p, and a 21:9 request is only routed to hosts that support it (or returns a 400 if you pin one that doesn't). 21:9 applies to text-to-video and reference-to-video; image-to-video and video-edit keep the input media's own ratio, so combining them with 21:9 returns a 400.
  • Exact pixels. height / width integers are still accepted and override resolution / aspect_ratio when given — but for most callers resolution / aspect_ratio is simpler than computing exact dimensions by hand.
import requests

job = requests.post(
    "https://videorouter.sh/api/v1/videos",
    headers={"Authorization": "Bearer llmr_sk_live_...", "Content-Type": "application/json"},
    json={
        "model": "minimax/h3/fal",
        "prompt": "a paper airplane gliding over a city",
        "resolution": "720p",
        "aspect_ratio": "16:9",
        "duration_secs": 8,
    },
).json()

For google/veo-3.1/google/veo-3.1-fast resolution/aspect_ratio select one of a small set of confirmed tiers — the DeepInfra and SiliconFlow rows ignore both. For google/veo-3.1-fast, the tier also changes the price.

Duration

Send duration_secs (default 4). Each model renders its own set of lengths. By default a length it can’t render is changed to one it can, usually the nearest, and you are charged for the length that is generated. On MAGI-2 (4–30 s), asking for 3 s gives a 4 s clip, and asking for 61 s gives a 30 s clip. When other hosts of the same model can render the full length, they are preferred over one that would cut it short, unless you named that host.

To get an error instead, send strict_duration: true:

curl https://videorouter.sh/v1/videos \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "sand-ai/magi-2", "prompt": "A paper boat drifting down a rainy street", "duration_secs": 31, "strict_duration": true}'
# 400 {"error": {"code": "unsupported_duration", "type": "invalid_request_error", "message": "strict_duration: no host ... Nothing was charged."}}
  • Only hosts that render exactly duration_secs are used, including fallbacks. If none can, the call is a 400 unsupported_duration and nothing is charged.
  • It needs an explicit duration_secs. A non-boolean value, or no duration_secs, returns invalid_strict_duration.
  • It does not apply to video editing or upscaling, where the length follows your source clip.
  • If a model declares no length limits (capabilities.duration_secs is null), your number is passed to the host as it is.

Request parameters

The fields of POST /v1/videos you will use most. Not every model takes every field; check what the model accepts. The Video API reference lists them all.

FieldTypeWhat it does
modelstringRequired. See the model ID forms above.
promptstringWhat to generate. A few image-driven and editing models allow leaving it out. Some hosts cap its length.
duration_secsnumberLength in seconds, default 4. The name is duration_secs, not duration. See Duration.
strict_durationbooleanReturn an error instead of changing the length. Default false.
resolution, aspect_ratiostringOutput tier and shape. See Resolution & aspect ratio.
width, heightintegerExact pixels; override the two fields above.
start_image_url, end_image_urlstringFirst and last frame. See Image-to-video.
keyframesarrayImages pinned to chosen frames. See Keyframes.
input_referencesarrayReference images, videos and audio. See Reference-to-video.
input_video_urlstringA clip to edit. See Video editing.
generate_audiobooleanSoundtrack on or off. See Sound and prompt rewriting.
prompt_extendbooleanWhether the model may rewrite your prompt (supported models only).
seedintegerFor similar results across runs (supported models only). See Seed.
providerobjectWhich hosts may serve the job. See Provider selection.
webhook_urlstringWhere to send the finished job. See Webhooks.
store, output_ttl_secsboolean, integerHow long the output is kept. See Retention.

Check what a model accepts

Hosts of the same model don’t all take the same inputs, and finding out with a real job costs money. Each type=video row of GET /v1/models carries a capabilities object, so you can check first. This request is free:

curl -s "https://videorouter.sh/v1/models?type=video" -H "Authorization: Bearer $VIDEOROUTER_API_KEY" \
  | jq '.data[] | select(.id == "wavespeed/magi-2") | .capabilities'
{
  "start_image_url": true,
  "end_image_url": true,
  "keyframes": false,
  "input_references": {"images": 10, "videos": 5, "audio": 5, "combined": 20},
  "generate_audio": true,
  "duration_secs": {"min": 4, "max": 30, "step": 1},
  "aspect_ratios": ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"],
  "reference_aspect_ratios": ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"]
}
FieldMeaning
start_image_url, end_image_url, keyframesWhether the row takes a first frame, a last frame, or keyframes.
input_referencesThe most files per type, plus combined. null means no reference mode.
generate_audiotrue: your on/off choice is sent to this host. false: we haven’t verified a switch for it.
duration_secs{min, max, step} or {values}. null means none are declared.
aspect_ratios, reference_aspect_ratiosThe aspect_ratio values the row takes for text-to-video and for reference-to-video, checked against the host’s own schema or docs. []: you can’t choose the shape (the row doesn’t have that mode, the endpoint has no ratio control, or the output follows your input). null: not verified yet, which does not mean unsupported.

The id of a row (here wavespeed/magi-2) names one host and also works as model. POST /v1/pricing/estimate is free and checks your actual request, as shown below.

Check a request before you pay

Send the body you plan to submit, plus type. The estimate runs the same checks and host selection as a real submit. A request that would be refused gets the same status and error code, and nothing is sent to any provider.

curl https://videorouter.sh/v1/pricing/estimate \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" -H "Content-Type: application/json" \
  -d '{"type": "video", "model": "wavespeed/magi-2", "duration_secs": 3, "aspect_ratio": "1:1", "negative_prompt": "blur"}'
# 200, trimmed to the parts that matter here:
"request_check": {
  "accepted": true,
  "hosts": [{"id": "wavespeed/magi-2", "duration_secs": 4.0, "resolution": "1080p"}, ...],
  "adjusted": {"duration_secs": {"requested": 3.0, "used": 4.0}},
  "ignored_fields": [{"field": "negative_prompt", "reason": "not a field of POST /v1/videos"}]
}
  • ignored_fields would have no effect on a real submit. unverified lists fields we can’t confirm for some hosts, such as an aspect ratio on a host whose list isn’t verified yet.
  • You can leave files out. Anything the model needs is listed in assumed_inputs, and your real request must include it.
  • Not checked: your balance and rate limits, content moderation, and your files (whether they can be fetched, their format and size, and their length unless you state it). A request that passes here can still be refused or fail for those reasons.

Image-to-video

Pass start_image_url — a public https:// URL or an inline data:image/...;base64,... URI — to animate a starting frame. Add end_image_url (same formats) to pin the last frame too — first-and-last-frame / keyframe generation, supported on a subset of models (see Pinning the last frame).

On most models this is the same public model id you'd use for text-to-video: omit start_image_url and it's plain text-to-video, pass it and the model animates that frame instead. Examples:

HostModels
Falbytedance/seedance-2.0/fal
minimax/h3/fal
Atlas Cloudminimax/h3/atlas-cloud
WaveSpeedAIminimax/h3/wavespeed-resell
MachGenminimax/h3/machgen

Two exceptions:

  • No text-to-video mode — these require start_image_url (400 without it): alibaba/happy-horse/fal, shengshu/vidu-q3-pro-fast/machgen, xai/grok-imagine-video-1.5/machgen.
  • No image-to-video mode — models without one reject start_image_url with a 400.
import requests

job = requests.post(
    "https://videorouter.sh/api/v1/videos",
    headers={"Authorization": "Bearer llmr_sk_live_...", "Content-Type": "application/json"},
    json={
        "model": "bytedance/seedance-2.0/fal",
        "prompt": "the subject turns and smiles, gentle camera push-in",
        "start_image_url": "https://example.com/photo.jpg",
        "end_image_url": "https://example.com/photo-end.jpg",  # optional: pin the last frame too
        "duration_secs": 5,
        "resolution": "720p",
        "aspect_ratio": "16:9",
    },
).json()

alibaba/happy-horse/fal's prompt is optional — omit it and the image is animated with no text guidance at all.

Pinning the last frame

Add end_image_url next to start_image_url to pin the final frame as well. Not every model takes it — these are examples of rows that do:

HostModels
Falbytedance/seedance-2.0/fal
bytedance/seedance-2.5/fal
alibaba/wan-3.0/fal
minimax/h3/fal
OpenSandbytedance/seedance-2.0-unrestricted/opensand
bytedance/seedance-2.5-unrestricted/opensand
bytedance/seedance-2.5/opensand
MuleRouteralibaba/wan-3.0/mulerouter
SoCheapbytedance/seedance-2.5/socheap
WaveSpeedkuaishou/kling-v4.0/wavespeedai

Beyond these, most image-to-video rows accept a last frame, across Fal, Atlas Cloud, WaveSpeed, SandBase, OpenRouter, ToAPIs, MachGen, Kie, Novita, DashScope, Pika and the direct MiniMax / LTX / Together / BFL / Runware / SoCheap hosts. Some models have no last-frame input on most or all of their rows, including Veo 3, HappyHorse, HeyGen, and most PixVerse and Grok Imagine rows.

  • If a model’s default host has no last-frame input, the call fails over to one that does.
  • Pinning a host that lacks it, or setting allow_fallbacks: false on one, is rejected with a 400 that names the hosts that do take it.
  • Check before you submit: each type=video row of GET /v1/models carries capabilities.end_image_url, and POST /v1/pricing/estimate applies the same rules.

Keyframes at specific frames

start_image_url / end_image_url pin the first and last frame. To pin several images at chosen moments of the clip, send keyframes: 1–10 objects of {"image_url", "frame_index"}. The prompt describes how the video moves between them.

  • Frame numbering. frame_index counts frames of the generated 24 fps clip.
  • Unique, within the clip. Each frame_index must be unique and can be at most duration_secs × 24 (frame 120 of a 5 s clip is the 5 s mark).
  • Their own mode. Don't combine keyframes with start_image_url, end_image_url, references, input_video_url or draft.

Supported on:

  • fal/flux-3-max (same model id as its text-to-video; sending keyframes switches it to Fal’s keyframes endpoint)
  • fal/flux-3-keyframes (FLUX.3, keyframes-only)

Limits and behavior:

  • 5–20 s, 720p or 1080p, billed per second at the same rate as text-to-video.
  • aspect_ratio defaults to the first image’s.
  • A host that can’t pin frames is never used as a fallback for a keyframes call; each row of GET /v1/models carries capabilities.keyframes.
curl https://videorouter.sh/v1/videos \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "fal/flux-3-max",
    "prompt": "She lifts a brown felt fedora onto her head and smiles at the camera.",
    "duration_secs": 5,
    "keyframes": [
      {"image_url": "https://example.com/start.jpg", "frame_index": 0},
      {"image_url": "https://example.com/end.jpg", "frame_index": 120}
    ]
  }'

Uploading a file

Every image/video/audio field above — start_image_url and every input_references entry (image_url / video_url / audio_url) below — takes either of these:

  • a public https:// URL, or
  • an inline data:image/...;base64,... URI.

So if you already have the file hosted somewhere, or you're fine base64-encoding it inline, you don't need anything below this point.

If you'd rather not do either — the file is only local, or base64 would inflate a large image/video past a reasonable request size — POST /v1/uploads stages it in storage for you and hands back a URL to pass into the field instead.

import requests

# 1. upload the file, get back a URL
with open("photo.jpg", "rb") as f:
    upload = requests.post(
        "https://videorouter.sh/api/v1/uploads",
        headers={"Authorization": "Bearer llmr_sk_live_..."},
        files={"file": f},
    ).json()
# -> {"url": "https://...", "expires_in": 1800}

# 2. use that URL right away as start_image_url (or an input_references entry)
job = requests.post(
    "https://videorouter.sh/api/v1/videos",
    headers={"Authorization": "Bearer llmr_sk_live_...", "Content-Type": "application/json"},
    json={
        "model": "bytedance/seedance-2.0/fal",
        "prompt": "the subject turns and smiles, gentle camera push-in",
        "start_image_url": upload["url"],
    },
).json()

file is a multipart/form-data field — any image/*, video/*, or audio/* content type, up to 50 MB. The returned URL is presigned and expires in 30 minutes — plenty of time to pass it straight into your very next /v1/videos or /v1/images call, but it's scratch space for that one call, not somewhere to keep a file — upload again for each new job.

Reference-to-video

Reference-to-video guides a new clip with several files of up to three kinds in one call: images, videos and audio. It is not the same as image-to-video: a reference shows the model a subject, style, motion or sound, while start_image_url is literally the first frame.

You use the same model ID as for text-to-video; sending input_references switches the mode, so there is no separate “-reference” ID to look up. How many files you can send depends on the model and host. Some examples:

ModelImagesVideosAudioTotal
bytedance/seedance-2.5/fal30101050
sand-ai/magi-2/wavespeedai105520
alibaba/wan-3.0/fal105520
bytedance/seedance-2.0/fal93312
minimax/h3/fal93312
shengshu/vidu-q3/machgen7007

For any other row, read capabilities.input_references. Clip length and file size limits vary by host.

Every file goes into one input_references array. Each entry has a type and a matching <type> object holding the url:

import requests

job = requests.post(
    "https://videorouter.sh/api/v1/videos",
    headers={"Authorization": "Bearer llmr_sk_live_...", "Content-Type": "application/json"},
    json={
        "model": "bytedance/seedance-2.0/fal",
        "prompt": "the cat from the reference image walks across the scene",
        "input_references": [
            {"type": "image_url", "image_url": {"url": "https://example.com/cat.jpg"}},
            {"type": "video_url", "video_url": {"url": "https://example.com/motion-ref.mp4"}},
            {"type": "audio_url", "audio_url": {"url": "https://example.com/ambience.mp3"}}
        ],
        "duration_secs": 5,
    },
).json()
  • At least one reference. Every kind is optional individually, but at least one reference of any kind is required — a call with none is rejected with a 400 (pass a plain prompt with no references to bytedance/seedance-2.0/fal instead for text-to-video).
  • Caps. Exceeding a per-type cap, or the model’s combined cap, is rejected with a 400.
  • Deprecated aliases. The older separate input_video_references / input_audio_references fields still work as deprecated aliases.

References can’t be combined with start_image_url, end_image_url or keyframes (motion-control models, which need a character image plus a motion video, are the exception). Rows with 0 for a kind reject that kind with a 400.

Referring to references in the prompt

Each reference is named by its 1-based position among entries of its own type in input_references — the first image_url entry is image 1, the first video_url entry is video 1, and so on. Write that name in the prompt in the syntax the model family reads:

Model familyTag in the prompt
Seedance 2.x (seedance-2.0, -fast, -mini, seedance-2.5)@Image1 @Video1 @Audio1
MiniMax H3@image1 @video1 @audio1
Wan 3.0Image 1 Video 1 (no @)
HappyHorse[Image 1] [Video 1]

Example: "@Image1 walks into the room from @Image2, to the music of @Audio1" with two image_url entries and one audio_url entry in input_references. Other model families read plain prose ("the cat from the reference image") and need no tag.

MachGen's Seedance 2.x rows treat an @ in the prompt as a directive that must point at a named reference, so for those rows VideoRouter binds the positional tags above to the matching array entry for you — you don't send any name fields.

Any other @ has no reference to point at, so it is sent as plain text with the @ removed. That covers:

  • a custom handle such as @Alice,
  • a tag beyond the number of references you sent (such as @Image9), or
  • a lone @.

Custom names are not supported; use the positional tags.

Video editing

Different from reference-to-video above — this modifies an existing clip instead of guiding a new generation. Pass the clip as input_video_url (a single URL, not an array) alongside a prompt describing the edit — it's mutually exclusive with start_image_url/input_references in the same call.

import requests

job = requests.post(
    "https://videorouter.sh/api/v1/videos",
    headers={"Authorization": "Bearer llmr_sk_live_...", "Content-Type": "application/json"},
    json={
        "model": "xai/grok-imagine-video-edit/atlas-cloud",
        "prompt": "Adjust the video style to an American comic book style.",
        "input_video_url": "https://example.com/source-clip.mp4",
    },
).json()

There are more than 30 edit models (Kling, Seedance, Wan, Gemini Omni, Grok Imagine, Runway Aleph, Pika, FLUX) — see Video edit for the full list, prices, limits and errors. To continue a clip instead of modifying it, see Video extension.

Seedance 2.5

Everything specific to Seedance 2.5 now lives on its own page: Seedance 2.5.

Reproducible output: seed

A seed is the number that fixes the random starting noise a video model denoises into a clip. Send the same seed with the same prompt and parameters and you get a similar clip back; change only a word of the prompt and keep the seed, and the composition mostly stays put. Without a seed, every call is random. Pass seed as an integer from 0 to 2147483647 on Wan or MAGI-2 text-, image- or reference-to-video calls:

curl https://videorouter.sh/v1/videos \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "alibaba/wan-3.0", "prompt": "A paper boat drifting down a rainy street", "seed": 42}'

Seeds are best-effort, not bit-exact: the same seed gives a similar clip, not a guaranteed identical one, because the hosts say so themselves. A seed is also only meaningful against the same model, prompt, resolution, duration and inputs.

Which models and providers support it

Wan and MAGI-2. We ran the same seed twice on each model and compared the clips: Seedance 2.0 and 2.5 returned unrelated clips on every host we tried (including Atlas Cloud and OpenRouter) even though those hosts accept the field. Seedance is therefore not listed, and a request with seed for a Seedance model is refused instead of being accepted and silently ignored. Wan on OpenRouter also ignored the seed, so OpenRouter is excluded.

ModelProviders that carry a seed
Wan 3.0 / 3.0 PrimeAtlas Cloud, Fal, WaveSpeed, SandBase, MuleRouter, Pika, DashScope
Wan 2.7WaveSpeed, MuleRouter, DashScope
MAGI-2Higgsfield, WaveSpeed, ToAPIs, Kie, SandBase (accepted by each host’s schema; repeatability not compared)

The Wan hosts take the field in their schema, but we have not compared their output.

  • Fallback. If the model you named lives on a host without seed support, the call is rerouted to a host that has it. With "provider": {"allow_fallbacks": false} on such a host, you get a 400 with code seed_not_supported instead.
  • Never silently dropped. A seed is never sent to a host that would ignore it, so a request that succeeds really did use your seed. If no host of the model supports one, the call is rejected with seed_not_supported rather than run unseeded.
  • Invalid value. A seed that is not an integer in range returns 400 with code invalid_seed.
  • Generation only. seed does not apply to video editing, upscaling or Seedance draft mode (those return seed_not_supported).

Sound and prompt rewriting

Two optional booleans control what a model does beyond your prompt: whether the video has a soundtrack, and whether your prompt may be rewritten.

Sound: generate_audio

Send generate_audio: false for a silent video, or true for sound. It works on rows whose capabilities.generate_audio is true, including all MAGI-2 hosts.

  • If you leave it out, most of those rows generate sound. Wan 3.0 on SandBase and MuleRouter gets the field only when you send it, and otherwise uses the host’s own default.
  • Price depends on the model. On some, including MAGI-2 and Wan 3.0, sound doesn’t change the price. On others, including certain Veo, Kling and PixVerse hosts, sound costs more, so send false if you don’t need it.
  • Rows marked false have no verified switch, so don’t rely on the field there. Some of them always produce a silent video, and others use the host’s default.
  • With fallbacks on, the field alone doesn’t keep a job on hosts that support it. If silence or sound matters, choose a host marked true and limit fallbacks with provider.only.
  • It only controls the output soundtrack. To guide a video with audio, add an audio_url entry to input_references on a model that takes reference audio. References can’t be combined with first or last frames.
  • A non-boolean returns 400 invalid_generate_audio.

Prompt rewriting: prompt_extend

prompt_extend is the model’s own prompt rewriting (expansion) switch, one name for every host. Send true to let the model enrich your prompt, or false to use it exactly as written. Each host names the field differently; we translate. Supported on some hosts of:

  • Wan 2.5, 2.6, 2.7 and 3.0
  • MiniMax H3
  • HeyGen Video 1
  • P-Video and P-Video 2
  • Hailuo 2.3 on OpenRouter
  • Never silently dropped. A request with prompt_extend goes only to a host that carries it. If you pinned a host without it using "provider": {"allow_fallbacks": false}, or no host of the model has it, you get 400 prompt_extend_not_supported.
  • Default. If you leave it out, each host keeps its own default (Wan 3.0 rewrites by default on most hosts; P-Video keeps your prompt as written). Send false if you need your prompt left alone.
  • A non-boolean returns 400 invalid_prompt_extend.
curl https://videorouter.sh/v1/videos \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "alibaba/wan-3.0-unrestricted/mulerouter", "prompt": "A paper boat drifting down a rainy street", "start_image_url": "https://example.com/first.png", "end_image_url": "https://example.com/last.png", "prompt_extend": false, "generate_audio": false}'

Retention & deleting videos

A finished video is copied into our storage and served from a stable link, then deleted automatically after 30 days. You can end that sooner, per video or per request:

  • DELETE /v1/videos/{id} removes the stored file now. The job then answers 404. It returns 409 while the video is still rendering, and 403 (delete_not_allowed_yet) during the first 24 hours after generation.
  • "store": false on the create request deletes the output 24 hours after the job completes. It is a short lifetime, not "never stored": the result has to be stored to be delivered to you.
  • "output_ttl_secs" sets that lifetime explicitly: 86400 (24 hours) to 2592000 (30 days). A smaller value is raised to 24 hours.
# keep the output for 2 days after it completes
curl https://videorouter.sh/v1/videos \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "bytedance/seedance-2.0/fal", "prompt": "A paper boat drifting down a rainy street", "output_ttl_secs": 172800}'

# delete one now (needs to be at least 24h old)
curl -X DELETE https://videorouter.sh/v1/videos/$VIDEO_ID \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY"

Once the job has completed it reports output_expires_at (Unix seconds), and after that time GET /v1/videos/{id} answers 410 output_expired. Deleting never changes what you were charged, and the request-log entry is kept for billing. Every lifetime, status code and what deletion does not reach (the model provider’s own copy) is on Data retention.

Job status & errors

POST /v1/videos, GET /v1/videos/{id} and the webhook all describe a job with the same core fields:

FieldMeaning
idThe job ID. Pass it back to GET /v1/videos/{id} exactly as returned.
statusqueued or in_progress while running; completed or failed when done.
data[0].urlThe finished video.
errorWhy the job failed.
cost_usdWhat the job was charged. Present on finished jobs; it can arrive a few seconds after the video.
output_expires_atWhen the stored file will be deleted. See Retention.

A request can be rejected when you create it, with an HTTP error and an error object (message, type, and often code). A job that was accepted can still end as failed later, for example when the host’s content moderation rejects it, so always check status.

StatusCodeWhat to do
400unsupported_duration, invalid_strict_durationChange duration_secs, or drop strict_duration.
400invalid_generate_audio, invalid_prompt_extend, invalid_seedFix the value’s type or range.
400seed_not_supported, prompt_extend_not_supportedDrop the field, or allow a host that supports it.
400aspect_ratio_not_supported, resolution_not_supportedPick another shape or tier, or another host.
400invalid_keyframes, reference_video_too_longFix the input; the message says how.
400invalid_webhook_urlUse a public https URL.
402insufficient_creditsAdd credits. Jobs already running may be holding part of your balance.
422no_compatible_providerNo allowed host can serve this request. Read the message and loosen your provider settings or inputs.

Other errors are covered in Errors & rate limits.

Webhooks

Add webhook_url to POST /v1/videos (or save it once as your default in Org admin → Webhooks) and we POST the finished job to that URL the moment it completes or fails — the identical object GET /v1/videos/{id} would return at that point (status, data, error, cost_usd). It works the same on POST /v1/lipsync and POST /v1/face-swap. Polling is never switched off: a webhook is a push on top of it, so a missed delivery never strands a job.

X-VideoRouter-Eventvideo.completed or video.failed. Sent once, when the job reaches that state.
X-VideoRouter-SignatureHex HMAC-SHA256 of the raw request body, keyed with your organization's webhook secret (Org admin → Webhooks, the same secret as Async Jobs). Verify it before trusting the payload, against the raw bytes — not re-serialized JSON.
X-VideoRouter-DeliveryThe job id. Use it to de-duplicate: delivery is at-least-once.
  • Acknowledge with any 2xx. Anything else (or a timeout after 10s) is retried with exponential backoff, 6 attempts in total, up to about 30 minutes apart. Every retry carries identical bytes and an identical signature.
  • cost_usd is what the job was charged (0 for a failed, refunded job). A completed job is held back for up to two minutes if the host's final price hasn't landed yet, then sent without it — poll for it afterwards.
  • The URL must be https:// and resolve to a public address. Private, loopback, and link-local targets are rejected with 400 invalid_webhook_url before anything is billed, and checked again before every delivery. Redirects are not followed.
  • Set it once. Save a default URL under Org admin → Webhooks and every video, lip-sync and face-swap job made with an API key uses it, so you can leave webhook_url out of the request. A webhook_url on the request wins over the default; "webhook_url": null skips webhooks for that one request. Creator Studio generations never use it.
  • One endpoint for everything. The same default is used by Async Jobs. Route on the X-VideoRouter-Event header: video.completed / video.failed here, job.* for Jobs.
  • See what happened. The last 25 deliveries, with their status and failure reason, are listed on the same Org admin → Webhooks page.
  • If a job's output is deleted (store: false, output_ttl_secs, or an explicit delete) before it finishes, no webhook is sent.

Billing

  • At creation, the job’s price is held or charged, so you need enough available balance.
  • At completion, many hosts settle to the job’s actual cost, which can differ from the amount at creation. cost_usd on the finished job (and in the webhook) is what you paid.
  • A failed job is refunded, or its hold released, and shows cost_usd 0. One exception: if we close a job as failed only because it ran too long, and the host finishes it afterwards, we may deliver the video and charge for it.
  • Polling is free.
  • Platform fee. A fee is added on top of the host’s cost: 2.5% on most video rows, and 5.5% on some, including unrestricted ones. Each row’s rate is pricing.platform_fee_rate on GET /v1/models. See Pricing & billing.

Exception: SiliconFlow's two siliconflow/-prefixed models bill a flat $0.29 per clip regardless of any duration_secs you request — SiliconFlow's own API ignores duration and always renders a fixed ~5s clip, so any duration_secs in the request body for these two models is ignored on our side too.

Fallback & failover

A rejected submission automatically fails over to the next-cheapest host still serving the same checkpoint — free, on by default, no parameter needed. For a job that's already been accepted and then stalls or fails mid-generation, pass failover.on_timeout_sec to hedge to a second attempt (both attempts get billed). Full details, triggers, and request examples: Provider selection. Falling back to a genuinely different model instead of another host of the same one: Model fallbacks.

Not yet supported

Video as chat input isn’t supported. For other video work, see Video edit, Video extension and Video upscaling.

Support for image, reference, audio and keyframe inputs differs by model and host. Rather than relying on a list here, check what a model accepts.