Diagnose a 401 authentication error
For direct Claude API requests, send an anthropic-version header and exactly one authentication header. A developer API key can go in Authorization: Bearer or the legacy x-api-key header. Organization-scoped keys also require anthropic-workspace-id. Claude API key documentation
Check the secret used by the deployed process and whether a proxy forwards the header. Reload processes that read secrets at startup after updating their configuration. Keep credentials out of application logs and browser code. Check the actual error type for billing, permissions or rate limits before changing authentication. Claude API error reference
Handle a 529 overload error
A 529 overloaded_error indicates temporary overload at the provider. For requests your application can safely repeat, use bounded exponential backoff with jitter. Respect retry guidance in the response, and check whether your SDK already retries so the combined retry budget fits your request timeout. If overload persists, return a clear retry message. In a streaming integration, also handle errors that arrive after the stream starts.
For help with an agreed fix, send the details in writing. See integration services for larger changes.
Frequently Asked Questions
Why does the direct Claude API return a 401 after key rotation?
Check whether the deployed process still reads the old key and whether a proxy strips the authentication header. Also check the exact error message for an organization policy that blocks direct browser requests.