Provider failover walkthrough Simulated
Independent demo. Not affiliated with or endorsed by nRouter.

What happens to an LLM request when its provider fails?

Watch one request three ways: normal success, a primary-provider failure with no fallback, and the same failure with a cross-provider fallback set through nrouter_fallbacks. Then see why a stream that has already started is not replayed. Every failure, timing, attempt and cost on this page is simulated in your browser. None of it is a vendor benchmark or a real outage.

Setup

Requested (primary)
Fallback (other provider)
Workload (illustrative)
Endpoint: /v1/chat/completions
Failure injected into the primary attempt:

1. Side by side

All three lanes share one time axis, so waiting time is visible. Playback is sped up; the numbers are not.

Normal no failure

Primary answers.

Press "Run comparison".

Failure, no fallback injected

Primary fails; nothing else is configured.

Press "Run comparison".

Failure + fallback injected

Same failure, with nrouter_fallbacks.

Press "Run comparison".

Legend: grey = gateway, hatched = waiting for a first byte, green = primary output, blue = fallback output, red = failed attempt.

2. When the stream has already started

Same primary and the same fallback list, but with "stream": true. This time the provider fails after the first chunks have reached your app.

Why it is not replayed automatically

  • Your user has already seen the first part of the answer. A silent retry would either repeat it or make text vanish.
  • A second model would write a different continuation, so the user would get one answer stitched from two providers.
  • Partial tool-call arguments could be replaced with different ones, or a tool could run twice.
  • The provider may already have done the work, and a hidden replay could mean paying for it twice.

What the client should do

  • Treat the response as interrupted, not complete, and keep the x-nr-request-id.
  • Decide deliberately: discard and retry, keep the partial text and ask the user, or resume at the workflow level.
  • Never run a tool call from a stream that didn't finish.

Which failures move to a fallback

Upstream outcomeWith a fallback configured
429, 503, Anthropic 529next fallback
401 / 404 from a misconfigured provider deploymentnext fallback
Connection never opened, or no first byte in timenext fallback
500, 502, 504returned as-is
Any error after response bytes arrivereturned as-is

Source: nRouter Router Settings and Smart Routing. Up to 4 fallbacks, at most 3 provider calls per request by default.

What you pay when it fails over

According to nRouter, a request that fails over before any output holds credit once and settles once, at the list price of the model that answered. The attempts it failed over from cost $0.

In the fallback lane above, the modeled cost is the fallback model's list price for the same illustrative token counts. In practice, token counts differ between models (different tokenizers and output lengths), so the real settled cost will differ too. Read it from x-nr-request-cost (non-streamed) or from the request logs.

Sources: Smart Routing FAQ, Response Headers.

3. Configure it for real

Same request as the fallback lane. nrouter_fallbacks replaces your saved fallback list for this one call. Claude models are served on /v1/messages rather than /v1/chat/completions, so on this endpoint the cross-provider fallback is a Gemini model.

Response headers to read

  • x-nr-model: the catalog model that served the request
  • x-nr-routing: direct or fallback:<n>
  • x-nr-attempts: total provider calls attempted
  • x-nr-request-cost and x-nr-cost-status: settled list-price cost (no cost header on streamed responses)
  • x-nr-request-id: to look the request up in logs
  • x-nr-latency-ms: edge arrival until response headers are ready

Reference: nRouter Response Headers.

Next step

Create a key, send a first request, and read the headers above on your own traffic.

Methodology

  • Simulated: every failure, latency, first byte, attempt, header value and cost on this page. A fixed, deterministic model in sim.js computes them in your browser. The same inputs always give the same outputs.
  • Real: model ids and per-token list prices from nRouter's public catalog (). Routing rules, header names and billing statements come from nRouter's public docs, linked on this page.
  • Timings are illustrative constants. They are not measured, not provider benchmarks and not nRouter performance numbers. The first-byte limit (10 s here) is configurable in Router Settings.
  • Cost = illustrative tokens times catalog list price. When nothing answers, it is modeled as $0 because the hold is released. A partially streamed response is not modeled.
  • Out of scope: same-model retries (Router Settings can allow up to 3 attempts within a 20 s wait budget on Direct requests), the error headers sent on failed responses, nrouter/auto and response caching. No traffic is sent to nRouter or any provider to cause failures.

Live healthy-path check

A staff-only server-side smoke test ran once against the real nRouter API on 2026-11-26 with a restricted, low-limit key. It was a healthy request only, with no injected failure. The key is never shown on or sent to this page.

Request/v1/messages, anthropic/claude-haiku-4-5, max 16 tokens
Result200, x-nr-routing: direct, x-nr-attempts: 1
Cost headerx-nr-request-cost: 0.000032, x-nr-cost-status: exact
Endpoint checkAsking for the same Claude model on /v1/chat/completions returned 404 "served on /v1/messages". That is why the demo's cross-provider fallback is Gemini.

The test key did not allow OpenAI models, so the exact OpenAI-to-Gemini pair shown here was checked against the public catalog, not with a live call. One call does not make a benchmark.

How this demo is measured, and how a real funnel would be

This page

This page records first-party aggregate counters only: a daily count per event name (page view, comparison run per failure type, mid-stream run, demo complete, snippet copied, quickstart clicked). It sets no cookies, has no user or session ids, stores no IP or user agent, and sends no third-party tags. There is no prompt input, so no prompt can be collected. Browsers that send Do Not Track or Global Privacy Control send nothing. "Demo complete" means the comparison and the mid-stream scenario were both run in the same page view.

A real activation funnel (proposal)

  1. Demo complete, then quickstart click. The UTM-tagged link carries the source.
  2. Signup. First-touch UTM stored on the new account, server-side.
  3. First API key created.
  4. First successful API call: the gateway's first 2xx request for that account, read from the request logs with its x-nr-request-id, joined to the account's first-touch source. It needs no client-side tracking.
  5. Success measures: activation rate (accounts with a first 2xx divided by signups, by source), median time from signup to first 2xx, and the share of first calls that send nrouter_fallbacks.

Steps 2 to 5 need nRouter's own product data. This demo has no access to it and makes no claims about it.