What Is Your Fallback When a Provider Is Down?
A step-by-step plan for keeping an AI app useful when its model provider is overloaded or down, and what to tell the customer, explained for your AI interview.
In short
Retry briefly, then move to a backup only for tasks you have tested on it. Tell users plainly when their work is saved for later, and send the backup real traffic every day so it works when it is needed.
12 min readIntermediateCommon · estimateFacts checked 27 November 2026
Say it out loud
Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.
If my main model provider goes down, the app first sorts the error. For a short overload, it tries the call twice, with a wait between tries. If failures keep coming, a circuit breaker stops calls to that provider. Tasks I've tested on a backup go there. Everything else is saved, and the customer gets a clear call-back time. I also send a small share of real traffic to the backup every day, so I know it works before an outage.
Start with the customer, because that is what the fallback protects. When my main provider fails, the customer should never see a blank screen or a raw error code. They should get either an answer, or a clear message that their request is saved and when someone will reply.
The steps come in order. First I sort the error. An overload or a timeout is often temporary, so I retry briefly, with a wait between tries and a hard limit. A spend-cap or billing error is different. Retrying it won't help, so I alert a person. If the main provider keeps failing, a circuit breaker opens and stops the calls for a while. Tasks I have tested on a backup go there, and anything else is saved for a person.
The part people miss is the backup itself. A fallback that nobody uses can hide a bug for months, and it can make an outage worse. So I send a small share of real traffic to the backup every day, check its answers, and keep its data where our rules require. I also plan for a streamed answer that breaks halfway. The Anthropic SDK doesn't retry that for you, so the app shows what it has and offers a retry.
Nothing removes an outage. A good fallback keeps the service useful while it lasts, and it limits what the customer loses.
What is a fallback, in plain words?
A model provider is the company that runs an AI model and sells you access to it. Sometimes it is busy and returns an overload error. Sometimes it is down, or a spend limit you set has been reached. A fallback is the plan for each of those days.
Think of a bank's call centre on a bad day. When the core system is down, agents don't stop answering. They take details on a paper form, tell the customer when they will be called back, and clear the queue once the system returns. The customer is still served, just more slowly.
Here is a made-up but realistic case. A mid-size insurer runs a claims assistant that reads forms and photos for about 6,000 claims a day. At 14:20 on a Monday, after a storm, the main provider starts returning overload errors. With no plan, every claim fails at the busiest hour. With a plan, most claims still get a first reply, and the rest are saved with a call-back time.
Key words
- Overload error
- A reply saying the model is too busy. Anthropic uses 529, OpenAI uses 503.
- Spend cap
- A limit on what you can spend in a period. Calls are refused until access resumes.
- Circuit breaker
- A switch that stops calls to a failing service for a while, instead of hitting it every time.
- Stream
- The answer arrives in pieces as the model writes it, instead of all at once.
- Retry-After
- A note from the provider saying how long to wait before trying again.
What should the app do, rung by rung?
Each rung runs only when the one before it has failed. The order matters, because each step is cheaper and safer than the next.
- 1
Sort the error
Overload, rate limit, spend cap, bad request or timeout. Each one gets a different answer, so the app never treats them all alike.
- 2
Retry briefly
Wait as long as the provider's Retry-After note asks, or wait a little longer after each try. Two tries at most, so one slow call can't hold the customer's chat open.
- 3
Open the breaker
After repeated failures, stop calling the main provider for a while, then try again later.
- 4
Use the backup for tested tasks
Only the tasks I have tested on the backup go there. The rest don't, because an untested answer is a guess.
- 5
Save what the backup can't take
The work waits with a clear call-back time for a person to follow up.
- 6
Tell the customer plainly
Say what happened and what happens next, with no error codes on the screen.
The fallback ladder for one request
Main provider fails
529 or 503: the provider is busy
Sort the error
overload: retry; billing: a person
Recover on its own
Short retry
wait, then two tries at most
Circuit breaker
stops calls after repeated failures
Move on, with a plan
Backup provider
only for tasks tested on it
Save for a person
saved with a clear call-back time
Customer gets a reply
answered, or told when they'll hear back
- 1The main provider returns an error instead of a reply.
- 2The app sorts the error. An overload goes on to a short retry.
- 3It retries briefly, then the breaker opens after repeated failures.
- 4Tested tasks go to the backup provider.
- 5Other tasks are saved and handed to a person.
- 6The backup's reply reaches the customer.
- 7A saved task reaches the customer with a call-back time.
Billing errors skip the retry path. A spend cap or billing error goes straight to a person, because a retry won't fix it. Overloads are the errors the ladder is built for: Anthropic's errors page says a 529 means the API is temporarily overloaded, and OpenAI's page says a 503 with the server_is_overloaded code means the model lacks capacity right now.
“Retrying billing, spend, or quota errors won't restore API access.”
OpenAI
“529 - overloaded_error: The API is temporarily overloaded.”
Anthropic
Streams need one more rule. If a streamed answer breaks halfway, the customer has already read part of it. The Anthropic SDK doesn't retry an error inside a stream, and other SDKs may differ, so my code decides. I show the partial text, mark it as incomplete, and offer a retry. I don't restart silently, because the customer would read the first half twice.
Why is an untested backup the real risk?
A backup nobody uses is a guess. Amazon's engineers wrote that fallback logic is hard to test, and that a fallback which runs rarely can hide a bug until the day an outage needs it. Amazon's own article is cautious. Its team says it now almost always prefers alternatives to fallback, such as letting the caller retry.
“Distributed fallback strategies often make the outage worse.”
Amazon Builders' Library
“To address the problem of latent failures of the fallback strategy, it's important to exercise it regularly in production.”
Amazon Builders' Library
So I send a small share of real traffic to the backup every day, and compare its answers with the main provider's. The daily check catches a broken key, a changed output format or a data-location rule before an outage does.
Tip
Asked how you would test a fallback? Say you run it on real traffic every day as well as in drills, and that the test checks the answers and whether a reply came back.
What does a bad afternoon look like?
Take the insurer from the start. At 14:20 the main provider returns overload errors on almost every call. The app tries the first claim twice, with a short wait. Those two failed calls in a row open the breaker, so the next claims skip the main provider.
Then the rules decide. Simple intake goes to the tested backup. Anything the backup hasn't been tested on is saved, and the customer reads this:
"Our assistant is busy right now. Your claim is saved, and a person will call you within one working day."
The message is short, and it tells the customer what happens next. Nothing is lost, and nobody is left guessing.
Here is the ladder in plain Python. The main provider is scripted to fail twice, so the code shows the retries, the breaker and the saved claim.
# Made-up claims intake at an insurer. The main provider is overloaded at first.
replies = iter([529, 529]) # scripted replies, in order, no network
TESTED_ON_BACKUP = {"simple intake"} # tasks the backup has passed tests for
breaker_open = False
failures = 0 # failed calls in a row
def take_claim(claim, kind):
global breaker_open, failures
if not breaker_open:
for attempt in (1, 2): # short retry: two tries at most
status = next(replies)
print(f"{claim}, try {attempt}: {status}")
if status == 200:
failures = 0
return f"{claim}: answered by the main provider"
failures += 1
if failures >= 2:
breaker_open = True # no test calls in this demo; a real breaker lets a few through after a timeout
if kind in TESTED_ON_BACKUP:
return f"{claim}: sent to the tested backup"
return f"{claim}: saved, a person calls back within 1 working day"
print(take_claim("claim 1", "simple intake"))
print(take_claim("claim 2", "simple intake"))
print(take_claim("claim 3", "damage estimate"))
print(f"breaker open: {breaker_open}")Output
claim 1, try 1: 529 claim 1, try 2: 529 claim 1: sent to the tested backup claim 2: sent to the tested backup claim 3: saved, a person calls back within 1 working day breaker open: True
The output shows what an interviewer wants to see: short retries, a breaker that stops the waste, and no claim lost.
What does the interviewer want to hear?
A strong answer covers
- Stepped, with a plan at each step: sort the error, retry briefly, open a breaker, then back up or save.
- Spend-cap and billing errors don't clear with retries, so they go to a person.
- The backup is tested on real traffic every day, with its answers checked.
- The customer always hears what happens next, with no raw error codes.
- A stream that breaks halfway is handled in code, not silently restarted.
- Honest about the limit: a fallback keeps the service useful, it does not stop outages.
Common traps
Trap"Just keep retrying until the provider comes back."
BetterRetry briefly, with a limit. Then move on, so the waiting doesn't become the outage.
Trap"We have a backup provider, so we're covered."
BetterOnly if it is tested on real traffic. An untested backup can fail in the outage it was built for.
Trap"Failover is automatic, so nothing else needs checking."
BetterCheck answers, error codes, data location and caches. An automatic switch still needs tests.
Can you spot the risky rule?
Spot the risky rule
This is a team's fallback runbook. Which rule is the risky one?
Quick check
At 14:00 the main provider returns an error saying the monthly spend limit is reached. What is the right first move?
Can you answer these from memory?
Flash cards · tap a card to flip it
What will they ask next?
Last updated on 27 November 2026
Building an AI app that must stay up when a provider does not?
I design and build AI products and agents, including the fallback plan, the tests that prove it works and what the customer sees. Book a short call and tell me what your app must keep doing on a bad day.