OpenAI 429 & Gemini 503 failover guide Separate transient bursts from dead quotas.
Not every 429 or 503 should be retried blindly: transient RPM/TPM 429s and Gemini 503 bursts recover on alternate providers immediately, whereas 400/401/403 must stop immediately. rawroute routes across up to 4 providers per model on 429/502/503 and returns real HTTP status codes so client SDKs never misread failures.
Verified 28.11.2026
Client retry matrix for LLM gateways
| HTTP Status | Meaning | Gateway & client action |
|---|---|---|
| 429 / 502 / 503 | Rate limit or upstream provider failure | Auto-failover to next provider (up to 4); safe to retry with backoff |
| 504 | Upstream request timed out | Not billed; retry idempotent requests with backoff |
| 400 / 401 / 403 / 404 | Bad payload, invalid key, spend limit, unknown model | Do NOT retry — fix request or key limit first |
Why Gemini 4 & 3.8 Flash spike on 503
Gemini endpoints regularly experience regional capacity bursts that return 503 UNAVAILABLE even when your account is healthy. rawroute distributes each Gemini model ($1.00 / $5.00) across 4 distinct providers so one region's congestion routes seamlessly to another.
import OpenAI from "openai"
const client = new OpenAI({
baseURL: "https://api.rawroute.dev/v1",
apiKey: process.env.RAWROUTE_API_KEY,
maxRetries: 3, // OpenAI SDK automatically retries 429, 502, 503 with jitter
timeout: 60_000,
})
const res = await client.chat.completions.create({
model: "gemini-4-argon",
messages: [{ role: "user", content: "Return JSON health check." }],
})When NOT to use rawroute
- — Do not expect retries to fix HTTP 400 validation errors or HTTP 401 spend-limit caps—those fail fast intentionally to protect your budget.
FAQ
Does rawroute ever return an error disguised as HTTP 200?
No. Errors always use real HTTP status codes so standard SDK retry logic works reliably.