API errors
Anthropic API 401, 403 and 400 errors: authentication and request problems
Updated 8/13/2026
What's happening
401 means the key was not accepted, 403 means the key lacks access, and 400 means the request body did not validate.
Fix it
- Send the key in the x-api-key header, not an Authorization bearer header.
- Check the environment variable for trailing whitespace or newline characters.
- Confirm the key is still active in the Console and belongs to the right organisation.
- Include the anthropic-version header on every request.
- For 400s, validate the messages array shape, role alternation and max_tokens field.
Still stuck?
Log the error type and request id from the response body — they identify the exact validation failure.
Quick fixes
- Claude is down or not loading
- Claude Pro billing or payment problem
- Can't sign in to Claude