"Please run /login · API Error: 401 Invalid authentication credentials"
Updated
"Please run /login · API Error: 401 Invalid authentication credentials" is an authentication failure, not a usage limit. The Error reference says the API recognized the format of your credential but rejected the account or organization behind it: a revoked credential, a disabled organization, or a deactivated account. At the API level it is a 401 authentication_error. No window is full and no reset will clear it; run /status to see the active credential, then rotate the key or /login.
- Last reset
- 04 SEP 20:08Z
- Status
- OVERDUE
The gap since the last reset is past 1.5x the recent median.
- Next est.
- ANY TIME
- Days since
- 13.1
days
What does "Please run /login · API Error: 401 Invalid authentication credentials" mean?
The Error reference describes this as the API recognizing the format of your credential but rejecting the account or organization behind it. Anthropic returns it when a credential was recently revoked, when an organization was disabled or removed your access, or when the account itself was deactivated; the docs add that an expired token is not the cause.
The HTTP status is 401. The Claude Platform error reference lists 401 as authentication_error, "an issue with your API key (for example, it's malformed, revoked, or expired)". A usage limit is a different code entirely: 429 rate_limit_error. That is the whole distinction: this is not a quota problem, and a reset will not solve it.
The credential can be your saved /login or an approved ANTHROPIC_API_KEY, and the fix differs. Environment variables take precedence over /login, so if /status shows an API key row that is in use, running /login does not replace it. If ANTHROPIC_BASE_URL points at an LLM gateway, the text after 401 is the gateway's message rather than Anthropic's.
Which window is full?
| Window | Resets | Where to check |
|---|---|---|
| None: this is an authentication failure, not a usage window | Never; there is nothing to wait for | /status shows which credential is active |
What to do when you see it
- Run /status
See which credential is active: an API key row that is not marked as not in use means an approved ANTHROPIC_API_KEY is winning over your login.
- If an API key is active
Rotate the key in the Claude Console, or fall back to your subscription with unset ANTHROPIC_API_KEY (PowerShell: Remove-Item Env:ANTHROPIC_API_KEY).
- If only your login is active
Run /login once. If the credential was revoked, a fresh login replaces it. The help center notes /login also switches you from Console pay-as-you-go to your subscription plan.
- If the same message returns for the same account
The account or organization is no longer active. Check the account and organization that /status reports and ask your organization admin to restore access.
- If you use an LLM gateway
With ANTHROPIC_BASE_URL set, the text after 401 comes from the gateway; fix the credential the gateway expects instead of running /login.
When does it reset?
Your own window: nothing resets here. A 401 is returned before any usage is counted, so your five-hour and weekly windows are untouched; when a usage window is actually full, Claude Code shows "You've hit your session limit" with a reset time instead. After access is restored, /usage shows where the windows stand.
Account-wide resets: an official reset announced by Anthropic restores quota for accounts in good standing; it does not reactivate a revoked credential or a disabled organization. The board above records those announcements for a different situation than this one.
Related errors
FAQ
Is a 401 a usage limit?
No. The Platform error reference lists 401 as authentication_error, an issue with your API key or credential. A usage limit returns 429 rate_limit_error, and Claude Code shows it as "You've hit your session limit" or a sibling message with a reset time. Waiting for a reset does not change a 401.
Why does /login not fix it?
Usually because an approved ANTHROPIC_API_KEY is the active credential. Environment variables take precedence over your login, so /login does not replace the key. Rotate it in the Console or unset the variable. If /status shows only your login and the message persists, the account or organization is no longer active.
Is my token just expired?
The Error reference says an expired token is not the cause of this message: the API rejected the account or organization behind a well-formed credential, after a revocation, a disabled organization, or a deactivated account. An expired saved login shows "Login expired · Please run /login" instead.
How is this different from "Invalid API key · Fix external API key"?
"Invalid API key" means the key itself was rejected or malformed. This 401 message means the credential's format was fine but the account or organization behind it was rejected. Both are authentication errors with no window and no reset time.
Sources
- Claude Code docs: Error reference — "API Error: 401 Invalid authentication credentials"verified 2026-09-18
- Claude Platform docs: API errors (401 authentication_error, 429 rate_limit_error)verified 2026-09-18
- Claude Code docs: Authentication — Authentication precedenceverified 2026-09-18
- Claude Help Center: Use Claude Code with your Pro or Max plan (/status, /login, shared limits)verified 2026-09-17
- Claude Code docs: Error reference — "You've hit your session limit"verified 2026-09-18
Want the next Claude reset on your phone?