Home › Guides › Failover vs hedging

Automatic failover versus timeout hedging for video jobs, and what each costs

Updated 2026-10-02

Video generation hosts fail in two different ways, and VideoRouter handles them with two different mechanisms. One is on by default and costs nothing. The other is opt-in, can bill you twice, and is easy to misuse. Knowing which failure each one covers is the difference between a reliable pipeline and a surprising invoice. This page explains both from VideoRouter's documentation, then gives a decision rule.

Failure type one: the submission is rejected

You send POST /videos and the chosen host refuses it: it is down, rate-limited or errors out. This happens before any job id exists. The documented default behaviour is: retry once on the same host, then walk every other host confirmed to serve that exact checkpoint, cheapest first, until one accepts the job. You do not configure anything; omit the provider field and this is what you get. A job that ends up failing because every host failed returns a 5xx and is not billed.

This covers the most common outage shape, a host that is visibly broken. It is also why a soft host preference such as model/host is not a guarantee: if that host rejects the request, the walk continues elsewhere. For a strict pin use provider.only with allow_fallbacks: false, as covered in the pinning article.

Failure type two: the job is accepted, then stalls

The host returned a job id and status queued or in_progress, and then nothing happens. No error, no completion. Automatic failover cannot help, because from the router's point of view the submission succeeded. The documentation says so directly: the default walk only covers the submission call, and a job that is already accepted and then stalls needs the opt-in hedge.

The hedge: failover.on_timeout_sec

The hedge is a separate top-level object, not part of provider:

{
  "model": "kling-v3.0-std",
  "prompt": "a paper airplane gliding over a city",
  "duration_secs": 5,
  "failover": {"on_timeout_sec": 240}
}

If the job has not finished by that deadline, VideoRouter resubmits it to the next-cheapest untried host without cancelling the original. The documentation is explicit about the cost: both attempts are billed if they land. That is the price of insurance: you are buying a second chance at a deadline by being willing to pay for two clips when the first was merely slow rather than dead.

Side by side

Automatic failoverHedge (on_timeout_sec)
Enabled byDefault, always onOpt-in field per request
CoversRejected submissionsAccepted jobs that run past a deadline
Extra costNone; failed submissions are not billedBoth attempts billed if both complete
Cancels the first attemptNot applicableNo
Main riskA fallback host differs in behaviourPaying twice for a clip that was only slow

The cost trade-off, in plain terms

Let p be the share of jobs that run past your deadline, and c the cost of a clip. With the hedge on, expected spend is about c x (1 + p) in the worst case where every late job later completes on both hosts. So the hedge is cheap when p is small and the deadline sits well above your normal completion time. It is expensive when you set the deadline near your median, because then roughly half your jobs trigger a second submission. Measure your own completion-time distribution first; the host table below also shows how much the second host's price can differ from the first, which matters because the hedge goes to the next-cheapest untried host.

ModelCheapest hostPriciest hostCheapest isHosts
bytedance/seedance-2.5 (480p)OpenSand
$0.0525 / second
Fal-US
$0.2646 / second
80% lower9
bytedance/seedance-2.0 (2160p)MachGen
$0.59 / second
Fal
$1.5552 / second
62% lower9
alibaba/wan-3.0 (480p)Replicate
$0.025 / second
Alibaba
$0.05 / second
50% lower10
google/gemini-omni-flashGoogle
$0.1 / second
Fal
$0.13 / second
23% lower4
minimax/h3 (768p)MachGen
$0.04 / second
WaveSpeedAI-resell
$0.1 / second
60% lower14
alibaba/happyhorse-1.1 (720p)Pika
$0.098 / second
Alibaba
$0.14 / second
30% lower4
bytedance/seedance-2.0-fast (480p)Atlas Cloud
$0.027 / second
Fal
$0.2419 / second
89% lower9
bytedance/seedance-2.0-mini (480p)OpenSand
$0.0104 / second
Fal
$0.0721 / second
86% lower8
seedance-2-mini-unrestricted (480p)OpenSand
$0.0114 / second
SandBase
$0.0721 / second
84% lower3
kling-o3 (720p)SandBase
$0.0588 / second
Tencent TokenHub
$0.084 / second
30% lower4
minimax/h3-max (480p)SandBase
$0.01 / second
MiniMax
$0.05 / second
80% lower5
kling-v3 (2160p)SandBase
$0.294 / second
Tencent TokenHub
$0.42 / second
30% lower8

Per second, before VideoRouter's 2% platform fee. For tiered models each row compares the resolution tier with the widest host-to-host gap. Built 2026-10-02 from the live catalog.

When to enable it

When to leave it off

Alternatives that cost less

Before turning on the hedge, consider ordering hosts by measured performance. provider.sort accepts "latency", "reliability" and "queue", and provider.preferences can filter hosts by measured 24-hour p95 latency and success rate. These shift which host is tried first, with no double billing. Treat them as the first lever and the hedge as the second; hosts with no measured data sort last, so they behave best on models with real traffic.

Handling the outcome in code

A hedged request still gives you one job id to poll. Keep your own deadline longer than the hedge deadline plus a normal completion time, and record the provider field from the completed job so you can see how often the hedge actually fires. If it fires often, your deadline is too tight or a host has a real problem; fix that rather than paying for it indefinitely. The surrounding retry rules are in the error cookbook, and the provider selection docs hold the full field list. To try it, create a key and cap it first.

Frequently asked questions

What does automatic failover cover for video jobs?

Rejected submissions. The router retries once on the same host and then walks other hosts serving the same checkpoint, cheapest first. It is on by default and a job that fails after every host is exhausted is not billed.

What does failover.on_timeout_sec do?

If an accepted job has not finished by the deadline, it resubmits to the next-cheapest untried host without cancelling the original. Both attempts are billed if both complete.

Should I combine the hedge with my own resubmit-on-timeout logic?

No. Choose one. Combining them can create more than two paid jobs for a single request.

Keep reading

Using AI video is one part of the job.

VideoRouter puts it next to dozens of other video and image models behind one API key, so you can compare providers, prices and fail over automatically. Compare providers on VideoRouter →