# AI API with failover when a provider is down

URL: https://bridge.wekoya.tech/guides/ai-api-failover
Updated: 2026-12-03
Other companies' prices checked: 2026-12-03 (rechecked every 90 days)

**In short:** Bridge by Wekoya fails over automatically: if a provider fails before it starts answering, the request is retried on another route that serves the same model, with nothing to configure. OpenRouter also switches providers automatically; LiteLLM and Portkey fail over to the models you list in a config you write and run.

## Failover compared

|   | What happens when a provider fails | Set up by | Runs where | How you pay |
| --- | --- | --- | --- | --- |
| [Bridge by Wekoya](https://bridge.wekoya.tech/docs) | Retried on another route that serves the same model, if the failure comes before the first token | Bridge; nothing to configure | Hosted | Naira balance, by bank transfer or card |
| OpenRouter | Tries the next provider for the same model; you can also list fallback models to try in order | OpenRouter for providers; you for fallback models | Hosted | US dollars; 5.5% fee on credit purchases |
| LiteLLM | Falls back to another model group after its retries, as set in your config file | You, in config | Your own servers | Free software; you pay each provider |
| Portkey (now Prisma AIRS AI Gateway) | Tries the next target in a fallback strategy, by default on any non-2xx status | You, in a JSON config | Hosted, or its open-source gateway on your servers | Not published; enterprise sales |
| Helicone | States automatic fallbacks if a provider is down | Helicone | Hosted; on-prem for enterprise | Free tier; Pro $79 a month |

From OpenRouter's [provider routing](https://openrouter.ai/docs/features/provider-routing), [model fallbacks](https://openrouter.ai/docs/guides/routing/model-fallbacks) and [FAQ](https://openrouter.ai/docs/faq); LiteLLM's [reliability docs](https://docs.litellm.ai/docs/proxy/reliability); Portkey's [fallbacks docs](https://portkey.ai/docs/product/ai-gateway/fallbacks) and [home page](https://portkey.ai/); and Helicone's [docs](https://docs.helicone.ai/) and [pricing](https://www.helicone.ai/pricing). Checked on 3 December 2026.

## Same model, or a different one?

There are two kinds of failover. **Same model, another route**: the request still runs on the model you asked for, so answers, prices and limits stay what you expect. **A different model**: the request goes to a backup model you chose, which keeps you running but can answer differently and cost differently. Bridge does the first for you; for the second, catch the error in your code and call again with another model, which is one word in the request.

## What Bridge does, exactly

- If a provider fails **before the first token**, Bridge retries on another route that serves the same model. You see one answer, not an error.
- If it fails **after the answer has started**, the error is returned to you: part of an answer has already reached your app, so there is nothing to retry cleanly.
- If you add **your own provider keys**, you set priority and failover between them; falling back to your Bridge balance when your keys fail is a setting, off by default. See [Bridge for business](https://bridge.wekoya.tech/business).
- The [model status page](https://bridge.wekoya.tech/status) shows whether each model is answering now, and which to use instead when one is withdrawn.

## What to handle in your own code

1. Set a timeout on every request, so a slow answer does not hang your app.
2. On a 5xx error, retry once with a short wait; on a 4xx, fix the request instead.
3. For anything critical, keep a second model in your config and switch to it after a failed retry.
4. Stream long answers, so the user sees progress and a failure shows early.

[Create a free account](https://bridge.wekoya.tech/sign-up)

## Common questions

**Which AI API has automatic failover?**

Bridge by Wekoya retries on another route for the same model when a provider fails before answering, with nothing to set up. OpenRouter also switches providers automatically. LiteLLM and Portkey fail over to models you list in a config you write (checked 3 December 2026).

**Does failover change the price I pay?**

Not on Bridge: a request that fails over still runs on the model you asked for, at that model's naira price. When a gateway falls back to a different model, you pay that model's price; OpenRouter, for one, prices the request at the model that was finally used.

**What if the provider fails halfway through an answer?**

Bridge returns the error, because part of the answer has already reached your app and a retry would repeat it. Retry the request in your code if your app can handle a fresh answer.

**Do I need LiteLLM for failover if I use Bridge?**

No. Bridge fails over for you without a server to run. You can still put LiteLLM in front of Bridge if you already run it.

## Read next

- [Which AI gateway lets you set a budget per user?](https://bridge.wekoya.tech/guides/ai-gateway-budget-per-user)
- [LiteLLM alternative: Bridge compared](https://bridge.wekoya.tech/guides/litellm-alternative)
- [Which AI API gateway should a Nigerian startup use?](https://bridge.wekoya.tech/guides/ai-api-gateway-for-nigerian-startups)
