Quanta

← Back to Briefings

A 3-Retry Budget for Claude Sonnet 5.5 Teams

Cost at volumeEN3 reads

01 · Step 1: Treat every retry as a new metered request

Start with the assumption that a retry is not free. In a pay-as-you-go API workflow, each attempt can consume input tokens, output tokens, cache reads, and cache writes. A failed request may still have used meaningful capacity before the failure occurred. Repeating the same request can therefore increase spend without producing additional useful work.

For a team running sustained workloads with Claude Sonnet 5.5, Gemini 3.1 Pro, or another model, record the full cost of every attempt. The important unit is not only the successful response. It is the total cost of the original request plus every retry generated by the client, queue, worker, or orchestration layer.

02 · Step 2: Map the retry sources before changing limits

List every component that can repeat a call. Common sources include an SDK, an HTTP middleware package, a job queue, a command-line tool, and application code that catches an error and tries again. These layers can multiply one another.

  • › An SDK may retry twice.
  • › A worker may rerun the same failed job three times.
  • › A queue may redeliver the job after a timeout.
  • › An operator may manually start the operation again.

A request that appears to have a three-attempt limit in one layer may receive many more attempts overall. Give each layer an owner and write down its maximum. The goal is one intentional retry policy across the whole path.

03 · Step 3: Separate transient failures from permanent failures

Retry only errors that have a reasonable chance of succeeding later. Temporary network disconnects, service-busy responses, and selected server errors can qualify. Invalid authentication, malformed requests, unsupported parameters, and context-limit failures generally should stop immediately.

Classify errors using the response status, provider error code, and request stage. Do not retry a request simply because the response was inconvenient. A permanent error repeated five times creates cost and delay while hiding the actual defect.

04 · Step 4: Set a total attempt cap per operation

Choose a maximum that matches the value and duration of the work. For many interactive operations, a total of three attempts is a practical starting point: the initial request plus two retries. Batch jobs may justify a different limit, but the limit should be explicit and enforced by a single operation identifier.

Cap attempts globally, not only by process. If a worker crashes after the second attempt and another worker receives the job, the new worker must inherit the attempt count. Store that count with the job or request metadata so restarts cannot reset the budget.

05 · Step 5: Add backoff without extending the budget

Backoff spaces attempts apart when the problem may be temporary. Use increasing delays with a small random variation so many workers do not retry at the same moment. A typical sequence might wait briefly after the first failure and longer after the second.

Backoff controls timing, not cost. A ten-minute delay does not make another attempt free. Keep the attempt cap, total elapsed-time limit, and token budget separate. Stop when any one of them is exhausted.

06 · Step 6: Protect expensive requests with a retry budget

For large prompts or long outputs, cap the expected retry spend before sending the request. Track an estimated input and output allowance, then reject or defer a retry when the operation would exceed its budget. Include cache behavior in the calculation because cache writes and cache reads are priced separately.

Quanta is useful for this control model because one balance can cover Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok, and other supported models. Every call is metered on real tokens, so a team can inspect usage across a sustained workload instead of treating retries as an invisible fixed fee. Open a Quanta account when you are ready to centralize that balance and apply the same retry controls across your tools.

07 · Step 7: Make exhaustion visible and actionable

When the cap is reached, return a clear failure state containing the operation identifier, attempt count, last error category, and recommended next action. Do not silently continue in the background. For batch work, move the item to a review queue. For interactive work, show that the operation stopped after its configured limit.

08 · Step 8: Review retry cost by workload and model

Measure retry rate, tokens consumed by failed attempts, cache reads, cache writes, time spent in backoff, and successful completion rate. Break the results down by application, team, model, and error class.

A rising retry rate may indicate a timeout that is too short, an overloaded worker pool, an invalid request pattern, or an unsuitable model choice. The right response is often to fix the failure source, not to raise the retry limit. A capped, observable policy keeps heavy workloads predictable while preserving retries for failures that are genuinely recoverable.