Claude API 401 (authentication_error)

Is there an outage right now?

Claude API official status is operational. If this error persists, it is likely an implementation or environment issue on your side.

Updated: Jul 21, 2026, 8:40 PM UTC

View Claude API status

What this error means

401 means authentication failed: invalid/expired/missing key or bad x-api-key header.

Common causes

  • Wrong/expired API key
  • Missing/malformed x-api-key header
  • Env var not loaded
  • Key/org mismatch

How to fix

  1. 1.Reissue the key in Console and set via env
  2. 2.Check `x-api-key` and `anthropic-version` headers
  3. 3.Read key from env, not hardcoded
  4. 4.Use the correct org/workspace

When waiting helps (and when it won't)

Config issue—waiting will not fix it. Re-check key and headers.

Alternatives when Claude API is down

OpenAI APIGemini API / AI StudioMistral APIDeepSeek API

Related errors

FAQ

What is 401 authentication_error?

401 means authentication failed: invalid/expired/missing key or bad x-api-key header.

How do I fix 401 authentication_error?

Reissue the key in Console and set via env / Check `x-api-key` and `anthropic-version` headers / Read key from env, not hardcoded / Use the correct org/workspace

Compare Claude API with others