Error category

Anthropic API Errors and Fixes

Troubleshoot Claude API request failures, SDK exceptions, rate limits, overload responses, Bedrock routing problems, tool-use errors, and prompt caching issues.

This Anthropic API troubleshooting hub collects real error signatures, quick fixes, common causes, and step-by-step debugging paths for developers who need a practical answer instead of a broad overview.

80 articles in this category.

Troubleshooting overview

Start by matching the exact error message, then check the technology, environment, credentials, network path, and deployment context. The pages below are grouped so you can move from broad Anthropic API symptoms to specific root-cause families without relying on client-side search.

Common error types

  • 400 invalid request
  • 401 unauthorized
  • 404 not found
  • 429 rate limit
  • 500 internal server error
  • 529 overloaded

Common causes

  • Amazon Bedrock users get this error when attempting to use specific Claude model IDs with on-demand throughput instead of provisioned throughput. This is a billing/provisioning configuration error that blocks AI application deployment on AWS's paid Bedrock service. (1 page)
  • Stack Overflow question (score 1) about Amazon Bedrock rejecting Anthropic Claude 3 Haiku model ID when using on-demand throughput. Exact error message includes model ID and throughput type mismatch. Affects AWS Bedrock paid service users. (1 page)
  • When the /v1/messages/count_tokens endpoint returns 404, Claude SDK/CLI falls back to sending max_tokens=1 probe requests to estimate token count. A single session can fire 250+ such probes per minute (each ~53KB with tool schema), exhausting the RPM quota and causing 429 errors for all users on the same API channel. (1 page)
  • New-api PR #4441 documents a real production incident: a single Claude Code Desktop session sends 250 count_tokens probe requests per minute when the endpoint returns 404, each request ~53KB with full tool schema but max_tokens=1, exhausting upstream RPM quota and causing 429 for all users on the channel for ~2 minutes. (1 page)
  • Long-running agent sessions with many tool calls accumulate duplicate tool_result blocks, causing the API to reject the entire message history. Developers struggle to deduplicate without losing conversation context. (1 page)
  • Goose agent project hit this error with Databricks provider and direct Anthropic — long sessions with many tool calls fail because multiple tool_result blocks share the same tool_use ID. (1 page)

Related technologies

  • Claude API
  • Claude Code
  • AWS Bedrock
  • Vertex AI
  • LiteLLM

Troubleshooting clusters

  • Authentication errors
  • Rate limit and overload errors
  • Tool use and message format errors
  • Bedrock and Vertex routing errors
  • SDK streaming errors
  • Prompt caching and billing checks

Latest pages in this category

Top fixes

High-intent troubleshooting topics

  • how to fix Anthropic API errors
  • Anthropic API error fix
  • Anthropic API troubleshooting
  • Anthropic API authentication failed
  • Anthropic API timeout
  • Anthropic API permission denied
  • Anthropic API deployment failed
Anthropic API Anthropic API

Anthropic SDK Mid-Stream Transport Error Leaks as Bare httpx.Exception Instead of APIConnectionError

Developer using Anthropic streaming API loses connection mid-stream (TransportError) and can't catch it with standard except anthropic.APIConnectionError blocks — must know to also catch httpx.TransportError Includes evidence for Anthropic API troubleshooting demand.

Mid-stream httpx.TransportError leaks through as bare httpx exceptions because SSE body iteration has no try/except — customers standard retry ladder misses mid-stream drops
Anthropic API Anthropic API

Anthropic Bedrock Server-Side Errors — Mapping Non-200 Stream Events

Handle Anthropic Bedrock server-side errors (5xx/4xx responses) during streaming properly; understand transient error retry behavior and HTTP status exception handling Includes evidence for Anthropic API troubleshooting demand.

non-200 stream events raise ValueError instead of APIStatusError
Anthropic API Anthropic API

Anthropic Bedrock streaming SSE events return TypeError instead of typed APIStatusError — NoneType has no attribute 'model'

Fix intermittent streaming crashes when calling Anthropic Claude via AWS Bedrock cross-region inference profiles; rate-limited responses appear as HTTP 200 error frames causing TypeError instead of catchable APIStatusError Includes evidence for Anthropic API troubleshooting demand.

AttributeError: 'NoneType' object has no attribute 'model' — Bedrock cross-region profile returns HTTP 200 with error payload type='rate_limit_error', SDK decodes as BetaRawMessageStartEvent with message=None
Anthropic API Anthropic API

Anthropic SDK Mid-stream SSE Overloaded Error Returns Wrong Status Code (200 vs 529)

Developer using anthropic SDK streaming sees overloaded_error arrive as HTTP 200 SSE event; SDK creates bare APIStatusError(200) instead of OverloadedError(529); fallback/retry logic breaks because status check >= 500 never matches Includes evidence for Anthropic API troubleshooting demand.

Mid-stream SSE overloaded_error returns status_code=200 instead of 529 — fails fallback retry logic
Anthropic API Anthropic API

Claude Opus 4.7 Quota Suddenly Changed to 0 TPM on AWS Bedrock

Enterprise users on AWS Bedrock experience sudden 0 TPM throttling for Claude Opus 4.7 model; need to restore throughput capacity Includes evidence for Anthropic API troubleshooting demand.

Claude Opus 4.7 quota changed to 0 TPM in Bedrock
Anthropic API Anthropic API

Anthropic API refusal_error — Content Policy Violation Blocking Production

Resolve Anthropic API returning refusal_error when prompts trigger content policy blocks, breaking production LLM pipelines Includes evidence for Anthropic API troubleshooting demand.

refusal_error: Your message must not include any first person (i.e., "I" or "me") pronouns or references to yourself, regardless of how they're expressed.
Anthropic API Anthropic API

Anthropic API overloaded_error (HTTP 529) — Retry and Fallback Strategies Needed

Developer needs to handle Anthropic's silent overloaded errors programmatically with proper retry logic, jitter, and fallback routing to maintain production reliability Includes evidence for Anthropic API troubleshooting demand.

overloaded_error: HTTP 529 — The API is temporarily overloaded. 529 errors can occur when APIs experience high traffic across all users
Anthropic API Anthropic API

Anthropic API SSE Stream 中断时状态码错误为 200 而非 529

修复 Anthropic Claude API 流式调用中 SSE 中断错误事件返回 HTTP 200 而非正确的 529 Overloaded 状态码的问题 Includes evidence for Anthropic API troubleshooting demand.

APIStatusError: Status code 200 (expected 529) — mid-stream 'overloaded_error' event not properly mapped in streaming response
Anthropic API Anthropic API

Anthropic API Batch Processing undocumented 64-character custom_id limit

Fix Anthropic API batch processing error: custom_id character limit not documented, causing 400 BadRequestError Includes evidence for Anthropic API troubleshooting demand.

BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'requests.0.custom_id: String should have at most 64 characters'}}
Anthropic API Anthropic API

Anthropic Claude API Overloaded Error 529 — Fix Guide

Fix Anthropic API overloaded_error when Claude models are at capacity during paid API calls Includes evidence for Anthropic API troubleshooting demand.

overloaded_error — Anthropic API returns 529 or 503 when Claude models are at capacity
Anthropic API Anthropic API

AWS Bedrock Claude Model Invocation Not Supported Error

Fix AWS Bedrock ValidationException when invoking Anthropic Claude models — requires inference profile instead of direct model ID Includes evidence for Anthropic API troubleshooting demand.

Invocation of model ID anthropic.claude-3-5-sonnet-20241022-v2:0 with on-demand throughput isn't supported
Anthropic API Anthropic API

How to Fix Anthropic API overloaded_error 529 (Overloaded)

Fix Anthropic Claude API 529 overloaded error that blocks paid API calls Includes evidence for Anthropic API troubleshooting demand.

Anthropic API Error 529: {"type":"error","error":{"type":"overloaded_error","message":"Overloaded"},"request_id":"req_..."}

Browse all Anthropic API troubleshooting pages

Continue through the full static archive for this hub. Every listed page is crawlable and keeps its existing canonical URL.

Browse all Anthropic API troubleshooting pages