# How do I diagnose a Claude API failure and decide whether to retry?

Exam: CCDV-F — Claude Certified Developer - Foundations
Knowledge domain: Eval, Testing, and Debugging
Updated: 2026-11-25T08:29:58.282414+00:00
HTML: https://learningpathx.com/faq/CCDV-F/ccdvf-diagnose-claude-api-errors-and-rate-limits.html

## Also asked as

- Which Claude API errors require a request change, and which can be retried?
- How can I distinguish rate limits, overload, stream errors, and bad model output in Claude?

Start with the last boundary that completed. Check request construction and connection, then API status or streaming events, then parser and consumer state. Evaluate model quality after a complete response reaches application validation.

| Evidence | Recovery |
| --- | --- |
| 400, 401, 402, 403, 404, or 413 | Read the error details. Correct invalid payloads, spending or billing problems, credentials or permissions, resource identifiers, or request size. Retrying the unchanged request is unlikely to help. |
| 409 conflict | Resolve the conflicting resource state before repeating a write. |
| 429 | Inspect the error code and quota scope. Honor `retry-after` when present. A tier spend-cap 429 has no retry delay and needs restored access. Traffic ramp limits and token or request rate limits need pacing. |
| 500-class fault, 529 overload, or a connection error | Retry within budget only when the operation can be safely repeated. Honor a refusal to retry in `x-should-retry` and any `retry-after` delay. An ambiguous timeout can mean the service already received work. |
| Error event after HTTP 200 or no terminal SSE event | Record an incomplete stream. Check the last valid event, remaining open blocks, timeouts, and consumer queue before choosing a recovery. |
| Complete Message with an invalid result | Inspect stop reason and failed application checks to separate truncation, invalid structure, and low-quality content. |

Record sanitized operation and attempt IDs, environment, model configuration, timing, status and error type, the request ID when available, and stream phase. Escalate persistent or deterministic failures to the owner of the failed boundary. Use a prequalified fallback only if it can satisfy the same requirements, and record which path returned the result.

**Official references**

* [Claude API error and retry reference](https://platform.claude.com/docs/en/api/errors)
* [Claude API rate limits](https://platform.claude.com/docs/en/api/rate-limits)
* [Streaming Claude Messages](https://platform.claude.com/docs/en/build-with-claude/streaming)

Source: [Reliable Claude API Streaming, Asynchronous Work, and Error Handling](https://learningpathx.com/news/reliable-claude-api-streaming-asynchronous-work-and-error-handling.html)
