---
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-08-04"
---

# Failover and the first byte

minirouter routes between hosts of the same model, never between models. When
an upstream degrades before a response starts, the request moves to the next
healthy host. The x-minirouter-provider response header names the host that
served the request.

## The first-byte boundary

Before the first content byte reaches you, minirouter can abort and try the
next route. After the first byte, provider switching is impossible because an
SSE stream is one logical response. Splicing another provider's tokens into it
would corrupt output, tool-call framing and client parser state.

| Event | Before first byte | After first byte |
|---|---|---|
| TTFT timeout | Abort and retry the next route | Cannot occur |
| Upstream 500 | Retry; you pay only the successful attempt | Terminal error; settle what was produced |
| Fallback chain | Full route list remains available | Route is committed |

TTFT (time to first token) is the primary health signal because it is measured
while the gateway can still act.

## Errors on this path

https://minirouter.sh/docs/errors#request_timeout: no first token from any upstream
https://minirouter.sh/docs/errors#upstream_error: failure after streaming began
https://minirouter.sh/docs/errors#model_unavailable: every upstream failed; the response names live alternatives
