---
title: "Failover"
description: "How same-model failover behaves before and after the first byte."
canonical_url: "https://minirouter.sh/docs/failover"
markdown_url: "https://minirouter.sh/docs/failover.md"
last_updated: "2026-09-26"
---

# Failover and the first byte

For a named model, MiniRouter can retry another provider before output begins.
To allow a different model, choose Auto or send an explicit fallback list:
https://minirouter.sh/docs/models. The x-minirouter-provider header names the
provider that served the request; x-minirouter-model names the model.

## Once output begins

Before the first content byte reaches you, MiniRouter can try another provider.
Once output starts, the stream stays with that provider. An upstream failure
ends it with an error instead of switching providers partway through the answer.

| Event | Before first byte | After first byte |
|---|---|---|
| Time to first token timeout | End with request_timeout; check Request logs before retrying | First token already received |
| Provider error | Retry; you pay only the successful attempt | End the stream with an error |
| Provider switching | Available | No further switching |

If a provider ends a stream with an error before 50 output tokens, the charge
is written off. A timeout may still incur a charge; check Request logs before retrying.

## Errors on this path

https://minirouter.sh/docs/errors#request_timeout: the first-token or complete-response deadline expired
https://minirouter.sh/docs/errors#upstream_error: failure after streaming began
https://minirouter.sh/docs/errors#upstream_response_invalid: the provider answered but its body failed our validation; the message names the check
https://minirouter.sh/docs/errors#model_unavailable: every upstream failed; the response names live alternatives
