Last reviewed: 2026-06-13
Direct answer
A retry budget runbook for LLM API calls should answer one practical question: when a request fails or times out, how many additional attempts are safe before the client should stop retrying and record the outcome for review?
Use the runbook to separate three things:
- The documented API contract you are calling, such as the CometAPI chat completions reference for POST /v1/chat/completions.
- The retry behavior your own client controls, such as bounded attempts with backoff for transient failures.
- The evidence your operators keep, such as HTTP method, status code, route template, error type, retry attempt count, and final result.
The safe default is not “retry until it works.” The safer pattern is a small, explicit retry allowance, backoff between attempts, and a stop condition that protects the caller and the upstream service. For related reliability context, see Retry and Backoff Evidence for CometAPI Gateway Calls.
Smoke-test workflow
Setup assumptions:
- Use a non-production environment or a controlled canary client.
- Use a CometAPI credential managed by your normal secret store, not embedded in logs or documentation.
- Verify the current chat completions path, authorization requirements, request body fields, and response fields from the official CometAPI reference before running the test.
Happy-path request plan:
- Send one minimal documented chat completions request to the documented endpoint.
- Record the HTTP method, route template, status code, retry attempt number, elapsed time bucket, and whether the client returned a usable application-level result.
- Treat the test as passing only if the client receives a documented successful HTTP response and records the evidence fields without exposing credentials or full response bodies.
Error-path check:
- Use a controlled invalid request or a test double that returns a retryable failure class your client already recognizes.
- Confirm the client uses bounded retry attempts with backoff rather than immediate tight-loop retries.
- Confirm the client stops after the configured allowance and records the terminal outcome.
Minimum assertions:
- The client records one row per attempt or an equivalent structured event.
- The final record identifies whether the request succeeded, failed without retry, or failed after retry.
- HTTP telemetry uses low-cardinality names where possible, such as a route template rather than a unique URL containing user data.
- The operator can distinguish client-side validation failures from transient transport or service failures.
What the smoke test must not assert:
- It must not assert model availability, price, quota, rate limit, latency objective, uptime, or billing behavior unless those details have been separately verified in the current official account and product documentation.
- It must not log secrets, prompts with sensitive data, full responses, or account-specific commercial terms.
Sanitized log-record template:
timestamp: 2026-06-13T00:00:00Z
environment: staging
provider_route: cometapi_chat_completions
http_method: POST
http_route: /v1/chat/completions
http_status_code: 200
retry_attempt: 0
retry_budget_remaining: 2
backoff_applied_ms: 0
client_result: success
terminal_outcome: returned_documented_response
operator_note: placeholder-no-sensitive-data
If your team wants a gateway before calling a model provider directly, Start with CometAPI after verifying the current product documentation and account setup.
For broader release checks, see CometAPI chat reliability contract review.
Who this is for
This guide is for engineers who operate LLM API clients and need a compact evidence checklist for retries. It is especially useful when a team already has basic request logging but cannot yet explain why a request was retried, when retrying stopped, or which documented contract areas were verified before a rollout.
Key takeaways
- A retry budget is an operator-defined allowance for additional attempts; keep it explicit, small, and visible in logs.
- Backoff is useful for transient failures, but repeated retries can worsen overload if clients do not stop.
- For CometAPI chat completions, verify the current endpoint path, authorization requirements, request fields, response fields, and streaming behavior in the official reference before asserting contract behavior.
- HTTP evidence should prefer stable route names, status codes, error categories, and attempt counts over high-cardinality raw URLs or full payloads.
- Do not mix reliability evidence with account-specific commercial claims unless those claims are verified from current account documentation.
Failure modes
- Evidence gap: the agent cannot inspect the failing log, source page, pull request, or local command output. The safe action is to stop and record the missing evidence instead of guessing.
- Scope drift: the agent edits files that are not connected to the observed failure. Keep the repair tied to the failing signal and leave unrelated cleanup for a separate task.
- Environment mismatch: the local check uses different versions, credentials, feature flags, or runtime settings than the hosted path. Record the mismatch before treating the result as proof.
- Unreviewed fallback: the agent changes models, endpoints, permissions, or retry behavior to make a run pass without preserving the review boundary. Treat access and provider failures as operational blockers, not topic failures.
- Weak handoff: the final note says the issue is fixed but omits the command, result, changed files, and remaining uncertainty. That makes the next operator repeat the investigation.
Sources checked
- CometAPI documentation - accessed 2026-06-13; purpose: verify current CometAPI documentation navigation.
- CometAPI chat completions reference - accessed 2026-06-13; purpose: verify chat completion contract areas.
- AWS retry with backoff pattern - accessed 2026-06-13; purpose: verify retry and backoff guidance.
- OpenTelemetry HTTP semantic conventions - accessed 2026-06-13; purpose: verify HTTP telemetry field context.
Contract details to verify
| Area | What to verify | Source URL | Accessed | Safe candidate wording |
|---|---|---|---|---|
| Documentation host | Confirm the current official documentation host is reachable before using any API detail. | https://apidoc.cometapi.com/ | 2026-06-13 | “The current CometAPI documentation host was reachable during review.” |
| Chat completions endpoint area | Confirm the documented method and path for chat completions before wiring a smoke test. | https://apidoc.cometapi.com/api/text/chat | 2026-06-13 | “The chat completions reference describes POST /v1/chat/completions; verify the current page before use.” |
| Request and response contract | Confirm required request fields, optional controls, streaming behavior, response fields, and error examples from the current reference. | https://apidoc.cometapi.com/api/text/chat | 2026-06-13 | “Use the documented chat completions request and response contract; do not assume fields not shown in the current reference.” |
| Retry behavior | Confirm your client retries only transient failure classes and applies backoff between attempts. | https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/retry-backoff.html | 2026-06-13 | “Bound retry attempts with backoff rather than retrying in a tight loop.” |
| Overload safety | Confirm retry policy stops before repeated attempts increase pressure on a degraded dependency. | https://sre.google/sre-book/handling-overload/ | 2026-06-13 | “A retry allowance should protect the upstream service as well as the caller.” |
| HTTP evidence | Confirm the telemetry fields your client records are stable enough for aggregation and incident review. | https://opentelemetry.io/docs/specs/semconv/http/ | 2026-06-13 | “Record low-cardinality HTTP evidence such as method, route template, status code, and error category.” |
Reader next step
Compare the workflow against Start with CometAPI.
Use CometAPI chat reliability contract review as the next comparison point. Keep Timeout-budget fallback checks for chat completions nearby for setup and permission checks.
FAQ
Is a retry budget the same as exponential backoff?
No. Backoff describes spacing between attempts. A retry budget describes how many additional attempts the client is allowed to spend before it stops and records a terminal outcome. A robust runbook uses both.
Should every LLM API failure be retried?
No. Client-side validation errors, unsupported request shapes, and authentication failures usually need correction rather than retry. Retry only failure classes your client has explicitly classified as safe to retry.
Can this runbook prove uptime or latency for a provider?
No. It only gives operators a repeatable way to capture evidence about client behavior and documented contract areas. Uptime, latency objectives, quotas, commercial terms, and account-specific availability require separate verification.
What is the smallest useful evidence set?
Start with timestamp, environment, operation name, HTTP method, route template, status code, retry attempt, remaining allowance, backoff applied, final outcome, and a short operator note without sensitive data.