The Invisible 40%: How Retry Logic Is Inflating Your LLM Bill Right Now
The Real Incident
The retry logic looked completely reasonable in code review: if a request times out, retry it once, maybe twice, with a short backoff. Nobody flagged it as a cost risk because retries are a reliability pattern, not a billing one. Months later, a cost audit found that 40% of total spend was going to requests that were retries of already-failed calls — work the user never saw and the team never measured.
The same audit surfaced a second pattern: a ReAct-style agent loop averaged 7 model calls per run, compared to 3 for an equivalent linear chain — a 2.3x cost multiplier for the same user-facing task. And buried in the user-level breakdown was one account that had generated 340 conversations in a single month, costing $310 on its own.
Retry Cost Calculator
Enter your real numbers to see how much retries are likely costing you each month.
Three Retry Patterns Ranked
- Capped retry with exponential backoff (best) — bounded attempts, increasing delay, cost stays predictable.
- Fixed-count retry with no backoff (risky) — bounded attempts but no delay, can hammer a struggling endpoint and multiply failures.
- Unbounded retry on timeout (worst) — no cap, no backoff; under sustained provider slowness this can retry indefinitely and is the direct cause of invisible bill inflation.
Agent Architecture Multiplier
Click a card to see how each architecture pattern multiplies cost for the same underlying task.
The $310 User
The runaway user wasn't malicious. A script called a feature in a loop, each call triggering a multi-step agent chain, each step itself eligible for retries on timeout. The combination of architecture multiplier and retry inflation turned one account into a cost outlier large enough to show up in a monthly review — but only because someone happened to look at per-user spend that month.
// Tag retries explicitly so they're visible in cost breakdowns
async function callWithRetry(fn, feature, maxRetries = 3) {
let attempt = 0
while (true) {
try {
const res = await fn()
fetch('https://llm-track.com/api/ingest', {
method: 'POST',
headers: { 'x-api-key': process.env.LLMTRACK_KEY },
body: JSON.stringify({
feature_name: feature,
is_retry: attempt > 0,
retry_count: attempt,
status: 'success'
})
}).catch(() => {})
return res
} catch (err) {
attempt++
if (attempt > maxRetries) throw err
await new Promise(r => setTimeout(r, 2 ** attempt * 100))
}
}
}
Tag retries at ingest time and see the breakdown in under a minute.
FAQ
Tag every retried request with a retry flag and feature name at ingest time, then compare total cost against first-attempt-only cost for the same period. The gap is your retry waste.
Most teams find that capping retries around 2–3 attempts with exponential backoff recovers nearly all the reliability benefit while keeping retry-driven cost under roughly 3% of total spend.
Switching to a cheaper model reduces cost per call, but an agent architecture that makes 7 calls instead of 3 multiplies that cost regardless of which model you use. Architecture and retries compound together.
Stop paying for failure
Tag your retries, cap them with backoff, and watch the wasted 40% disappear from your monthly spend.
Start free →