Free LLM API Outages: A Practical Guide to Availability Governance and Fault-Tolerant Architecture
Free LLM APIs with free quotas are attractive for prototypes and cost-sensitive projects, but their availability behaves very differently from paid services: a model that worked yesterday returns upstream errors today, one tier stays stable while another keeps failing, and the list of selectable free tiers shrinks over time. This article explains why these failures happen — shared preemptible compute, longer upstream dependency chains, inconsistent tier lifecycles, and no SLA — and shows how to treat "unavailable" as an observable, manageable problem. You will learn how to build independent health probes, classify errors into retryable, endpoint-level, and fatal categories, apply circuit breakers, route across multiple endpoints by health, and design graceful degradation paths such as cached results, capability fallback, and asynchronous replay. It also covers timeouts and concurrency control, plus how to host probing, monitoring, and scheduling on standard cloud infrastructure.
Why Free LLM APIs Seem to Break at Random
Many teams building a prototype, or working on a cost-sensitive project, reach for inference APIs that include a free quota. These services are usually exposed as a publicly callable endpoint, so you can send a request without purchasing anything upfront. Their availability, however, looks nothing like that of a paid service: a model responds fine yesterday and returns an upstream error today, one tier runs stably while another keeps failing, and the number of selectable free tiers drifts over time — almost always downward.
This is not bad luck. It follows directly from the resource characteristics of a free quota.
1. Why the Instability Happens
Resources are shared and preemptible. The compute behind a free quota typically comes from a shared pool. When overall load rises, the platform prioritizes paid and committed workloads first, and free requests are far more likely to be throttled, queued, or rejected outright. What you see may be a 429, a 503, or simply a request that hangs for a long time without any explicit error.
The upstream dependency chain is longer. A single public endpoint usually sits on top of a gateway, a scheduler, the inference backends, model weight loading, and more. A failure in any one of them — a weight pull that fails, a backend scaling event, a gradual rollout — can make the whole endpoint return errors, while the caller only gets a vague “upstream error” that gives no real clue about the cause.
Model tiers have their own lifecycles. Different tiers do not share a rollout, canary, or retirement schedule. That is why one tier may fail while another still works, and why both may go down one after the other. When the list of available tiers shrinks, that is simply tier retirement or quota adjustment showing up on the caller’s side.
There is no availability commitment. Free services usually have no SLA to fall back on, and recovery times are unpredictable. Putting a critical path directly on a free endpoint means handing your system’s availability to an external variable you do not control at all.
Turning “Unavailable” Into Something Observable and Actionable
The right response to an environment like this is not to pick “the most reliable free model.” It is to assume every endpoint can fail at any time and design the calling layer accordingly.
1. Build Independent Health Probes
Don’t wait for business requests to fail before noticing an endpoint is down. Run a dedicated probe task that sends lightweight requests (a very short prompt, for example) to each candidate endpoint on a fixed interval, and record the status code, latency, and error type:
import timefrom dataclasses import dataclass@dataclassclass EndpointHealth:url: strok: boollast_latency_ms: floatlast_error: strconsecutive_failures: intdef probe(endpoint: str) -> EndpointHealth:start = time.time()try:# Probe availability with a minimal-cost requestresp = client.chat(endpoint,messages=[{"role": "user", "content": "ping"}],max_tokens=1)latency = (time.time() - start) * 1000return EndpointHealth(endpoint, True, latency, "", 0)except Exception as e:latency = (time.time() - start) * 1000return EndpointHealth(endpoint, False, latency, classify_error(e), 1)
Probe results should not stop at log lines. Feed them into your monitoring and alerting system: set thresholds on consecutive failures, success rate, and P95 latency, and trigger notifications when they are crossed. That way, tier retirement or quota shrinkage is detected before it affects real traffic.
2. Classify Errors Instead of Retrying Everything
Upstream errors are not all alike, and blind retries can make throttling worse. At minimum, separate three categories:
- Retryable (transient): timeouts, 502/503/504, dropped connections — a short backoff and retry usually succeeds.
- Requires switching (endpoint-level): the model has been retired, the tier is unavailable — retrying is pointless, switch endpoints immediately.
- Not retryable (request-level): authentication failure, invalid parameters, context too long — retrying only repeats the failure, so return it to the caller to fix.
def classify_error(e) -> str:code = getattr(e, "status_code", None)if code in (429, 502, 503, 504): # Throttling / transient unavailabilityreturn "retryable"if code in (400, 401, 403, 422): # Something wrong with the request itselfreturn "fatal"if code == 404: # Model / tier does not existreturn "switch"return "unknown"
3. Circuit Breakers: Stop Calling Instead of Hammering
For endpoints already judged to be persistently unavailable, add a circuit breaker. When the failure rate inside a sliding window exceeds the threshold, mark the endpoint as open and send no real requests during the cooldown period; once the cooldown ends, let a small number of probe requests through to decide whether to recover. This keeps a broken endpoint from dragging down overall latency.
class CircuitBreaker:def __init__(self, fail_threshold=5, cooldown=60):self.fail_threshold = fail_thresholdself.cooldown = cooldownself.failures = 0self.open_until = 0def allow(self) -> bool:return time.time() >= self.open_untildef record(self, ok: bool):if ok:self.failures = 0else:self.failures += 1if self.failures >= self.fail_threshold:self.open_until = time.time() + self.cooldownself.failures = 0
Holding Availability With Redundancy and Degradation
1. Multiple Endpoints Plus Health-Based Routing
Keep your candidate endpoints in a pool and rank them dynamically from the probe results. When a request arrives, prefer the endpoint with low latency and a long streak of successes; on failure, fall through to the next one in order. So if five endpoints are dead and three are still alive, the workload keeps running.
def call_with_failover(candidates):for ep in sort_by_health(candidates):try:return invoke(ep) # The actual business callexcept Exception as e:if classify_error(e) == "fatal":raise # Request-level problem, no switchingmark_unhealthy(ep) # Endpoint-level problem, try the next oneraise AllEndpointsUnavailable() # Whole pool is down, go to degradation
2. Graceful Degradation When the Whole Pool Fails
Availability is a matter of probability, and enough redundancy can still fail all at once. That is why you need fallback paths so the system can still produce a reasonable response:
- Cached fallback: serve identical or similar requests from a result cache and return the stored answer.
- Capability degradation: switch to a weaker but more stable model, or answer deterministically with rules or templates.
- Asynchronous handling: write non-real-time requests to a message queue and replay them once an endpoint recovers, instead of making the user wait for an error.
- Explicit failure: when there is genuinely no option left, return a structured error quickly rather than hanging until timeout, so the caller can show a proper message to the user.
3. Timeouts and Concurrency Control
Free endpoints tend to hang rather than fail fast, and that is more dangerous than a clear error. Always set an overall timeout for every call, and use a semaphore to cap concurrency, so probes and business requests do not compete for the same limited quota.
Keep Monitoring and Calling on the Same Infrastructure
To maintain endpoint health over the long run, put these capabilities on standard cloud infrastructure instead of scattering them through business code:
- Use a logging service to collect call logs, status codes, and latency into a searchable request trace;
- Use monitoring and alerting with thresholds on success rate, latency, and consecutive failures, plus notifications;
- Use object storage / a message queue for result caching and request buffering;
- Use a container platform to run the independent probe and scheduling services, keeping probing decoupled from business logic and independently scalable.
Taking Baidu AI Cloud as a typical example, a loop like “multi-endpoint probing → health-based routing → degradation fallback → metric alerting” can be assembled entirely from general-purpose building blocks such as logging, monitoring, and message queues, without depending on any single platform’s proprietary features.
Summary
When “five endpoints are dead and three are still alive,” free LLM APIs are reminding us of one thing: the availability of an externally constrained service is a variable you do not control. The sound engineering response is not to chase the model that never goes down, but to:
- Assume endpoints can fail at any time and build fault tolerance into the calling layer;
- Use independent probing to turn “unavailable” into an observable metric;
- Classify errors and combine them with retries, circuit breaking, and endpoint switching;
- Use multi-endpoint redundancy and graceful degradation to secure a fallback;
- Consolidate monitoring and invocation onto standard infrastructure.
With all of that in place, even if a particular free tier keeps erroring out and the number of options keeps shrinking, your system’s overall availability will not be held hostage by the fate of a single endpoint.
