API Error 401 (authentication_error) — page 2
The API rejected the credential attached to the request.
441 issues · 48 open · 393 resolved (89%) · first seen Apr 7, 2025
First response · account
What to do now
Most likely: The credential is missing, expired or belongs to a different account context.
- Confirm which authentication method and organization Claude Code is using.
- Re-authenticate once and remove only the credential proven to be stale.
- If a gateway is involved, verify that it forwards the expected authorization header.
These are conservative triage steps, not an official Anthropic fix. Use the issue and workaround evidence below before making a destructive configuration change.
Is this getting better or worse?
This class of problem is holding steady. 114 new reports in the last 90 days vs 131 in the 90 before — -13%. The open backlog peaked at 70 in 2026-07 and sits at 48 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
223 of these reports name the Claude Code build they were running, spanning 102 releases. Heaviest reporters:
- Claude Code v2.1.165
- Claude Code v2.1.92
- Claude Code v2.1.177
- Claude Code v2.1.185
- Claude Code v2.1.150
- Claude Code v2.1.121
- Claude Code v2.1.87
- Claude Code v2.1.72
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 5 days across 393 closures. Of the 393 closures with a recorded reason, 19% were closed as completed and 317 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
80 of these issues post a workaround someone says worked. The highest-engagement ones:
- [BUG] In the middle of running I get `⎿ API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."}}`
- …rompt and the 401 error goes away Thank you so much for the workaround! However, I am on the lower Max Plan and it was not like this before. --- Expected behavior After the Opus limit message, the conversation should con…
Found in the thread of #5893 · still open - [BUG] OAuth token expiration disrupts autonomous workflows – refresh token handling needed
- …t working, giving the same error message again Update: Temp workaround is to go to the folder and start Claude CLI with , then continue the session from there.
Found in the thread of #12447 · still open - [BUG] OAuth error: timeout of 15000ms exceeded can not login it keeps timout even though I tried token too
- I found a workaround for this issue. I used the binary from a previous version (2.1.50), which can be found in ~/.local/share/claude/versions. I logged in using that version, and once the authentication was successful, I…
Found in the thread of #33214 · still open - [Bug] OAuth token expiration causing repeated 401 authentication errors during active sessions
- …igned certificate in certificate chain ), and I was able to work around it by running: and then executing . For reference.
Found in the thread of #18225 · still open - OAuth Authentication Not Supported for Highest Plan Tier
- …out/closing terminal, and logging back in is indeed only a temporary fix (tested on both Mac + PC/Windows). I also downgraded to 1.0.81 and so far no issues.
Found in the thread of #5956 · resolved
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 101–200
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 441 matches; the statistics above cover all 441.
- Agent Teams teammates ignore model/auth environment variables (incomplete fix from #23561)
- [BUG]Xcode 26.3 Claude Agent -Xcode 26.5 downloads darwin-arm64 binary on Intel Macs (workaround inside)"
- HTTP transport: custom headers (-H) not sent during MCP session establishment
- [BUG] Issue with Atlassian MCP
- Constant flickering.
- Are you able to read that directory for the menu items?
- Invalid API key · Fix external API key
- api error: 401{"type" ; "error": {"type":...
- [BUG] CLI 401 OAuth errors. Multiple devices on two Pro accounts, fully paid.
- Bug Report
- Claude code getting API error 401 authentication error...
- oauth error occurs
- [BUG] Claude Code npm package immediately enters interactive mode with OAuth expired error - authentication commands don't trigger OAuth flow
- [Bug] CSS changes reverted during Angular app migration with multiple file rewrites
- Sub-agent API 401 (auth expired) is reported to parent agent as "Request interrupted by user for tool use"
- ⏺ API Error: 500 Internal server error. This is a...
- `claude --print` fails with 401 when no interactive session is open (regression in 2.1.185)
- [BUG]
- VS Code extension forces daily re-login due to refresh token rejection (400) when multiple windows are open
- OAuth refresh corrupts credentials state during transient upstream 5xx → persistent 401 loop across sessions
- [Bug] Anthropic API Error: Server rate limiting prevents work across multiple Pro accounts
- [BUG] Telegram plugin: frequent HTTP 401 authentication errors mid-session
- VS Code extension always returns 401 "OAuth token has expired" on macOS 12 (Monterey) - cannot authenticate at all
- [BUG] Cant login to my own subscribtion account
- I have executed "/login" and it prompts "Login successful",...
- API Error: 401 {"type":"error","error":{"type":"authenticati...
- OAuth Authentication Not Supported for Claude Code CLI
- Getting 401 error
- API Error: 401 {"type":"error","error":{"type":"authenticati...
- [BUG] headersHelper not re-run on mid-session 401 (2.1.197): client falls into OAuth /register fallback and stays wedged until manual /mcp reconnect
- [BUG] CLI: OAuth login fails with "Invalid OAuth Request — Missing redirect_uri parameter" — Pro plan, Windows 11
- [BUG] "Please run /login · API Error: 401 ... token expired" has no recovery path when using Claude Platform for AWS (awsAuthRefresh configured)
- Claude Desktop 3P mode — inferenceCustomHeaders not applied to HTTP requests
- [BUG] MCP server error notifications render as "[object Object]" instead of the error message
- [BUG] Slack MCP (HTTP OAuth): tokens cleared on every 401 instead of using refresh token — forces full re-auth ~each session
- [BUG] OAuth login redirects existing Max subscriber to "Let's create your account" onboarding loop, browser + Mac desktop + Windows desktop all locked out, iPhone + Console + Claude Code still authenticated
- Compaction irreversibly discards context when summary API call fails
- OAuth auto-refresh fails in non-interactive (subprocess) mode → 401 after token expiry
- [BUG] Rate limits too aggressive for Pro plan (90€/month)
- [BUG] OAuth tokens expire silently, breaking unattended automation (LaunchAgent/cron)
- [Bug] Claude Code intermittent 500 Internal Server Error during longer-running repo work
- [BUG] Claude Desktop uses an incorrect redirect_uri during Dynamic Client Registration
- [Bug] Context window exhaustion causes multi-agent freeze
- [Bug] Auto-response sends message when only image is submitted without text
- [Bug] 401 Unauthorized error persists after successful login and Max plan upgrade
- UI get this after trying to login to my Claude PRO account...
- [BUG] Claude Desktop and claude.ai fail to connect to custom OAuth-protected MCP server - infinite about:blank loop
- [BUG] Authentication Error: Invalid bearer token persists after login
- What a shi* fu** model
- Constantly running into "API Error: 400 due to tool use...
- Anthropic API Authentication Error: OAuth Not Supported
- API Error: 401 {"type":"error","error":{"type":"authenticat...
- [BUG] Persistent console errors and EventEmitter memory leak on Desktop launch
- [BUG] 401 Auth Loop - All commands fail including /login, Windows, Pro subscription**
- Plugin hooks that refresh OAuth tokens silently break authentication
- [BUG] 401 after successful /login on 2.1.87 — token not persisting FOR 12+ hours and 10+ attempts with success print
- OAuth token expires when using Claude Code on multiple devices
- [BUG]
- [BUG] OAuth token has expired 라고해서 /login 했더니 cloudflare 500 에러 뜨는데 이러면 클로드코드를 어떻게 써야하나요?
- i tired to upload a photo it gived me an error and it...
- API Error 401: OAuth authentication is currently not allowed for this organization.
- [BUG] Using Max 200 Plan but Charged for API Usage!
- [BUG] [Claude Desktop] Custom OAuth connector sends unsigned/opaque token to resource server
- [BUG] Gateway provider discards the refresh token and has no refresh-token grant, so every renewal is a full device-code re-grant
- headersHelper server falls into OAuth dynamic client registration on 401 instead of re-running the helper
- [BUG] Atlassian MCP connector: write calls (addCommentToJiraIssue) blocked by Cloudflare; connector also intermittently drops to "no OAuth token" during reconnect
- Subscription-OAuth long-running Remote Control session dead-ends at 401 / "Please run /login" at the daily refresh boundary; /login cannot complete in a remote-controlled session
- [BUG] `Failed to authenticate. API Error: 401 Invalid authentication credentials` and THEN: `Claude configuration file at /Users/<user>/.claude.json is corrupted: Unexpected end of JSON input` when tried to do `claude -p`
- tolls cant do a simple history search and lies
- [Bug] OAuth login fails in tmux environment
- [BUG] key is blocked
- Reconnect action unreachable for mcpServers entries added by direct ~/.claude.json edit
- 2.1.118: 401 auth error with custom ANTHROPIC_BASE_URL (third-party provider, worked in 2.1.112)
- HTTP MCP: SDK client does not attach configured --header on tool calls (Claude Code 2.1.114, Windows)
- /status corrupts OAuth session on narrow terminals — Max switches to Claude API, model downgrade, and 401 errors
- [BUG] 401 Authentication Error — OAuth token rejected on all servers despite valid Max 20x subscription
- [BUG] Claude Code on macOS does not recognize active iOS Apple-billed Max subscription, login succeeds but CLI says account has no access
- [BUG] Issues loggin in and reporting bugs on claude code CLI
- Frequent 401 Authentication Errors Requiring Re-login
- [BUG] Authorization header not sent when ANTHROPIC_AUTH_TOKEN is set.
- [BUG] v2.1.81 - multiple parallel agents cause 401 auth issue
- [BUG] 401 Invalid bearer token on every request - Pro plan not recognized - Nigeria
- OAuth token expired — login/logout/all commands fail with 401, no recovery path
- [BUG] 401 authentication error
- OAuth token refresh fails in non-interactive/headless mode
- [BUG] OAuth login fails with "Failed to start OAuth callback server: Failed to start server. Is port 0 in use?
- [BUG] Claude Code 401 Authentication Error on Windows
- Claude Code CLI always selects API Usage Billing org instead of Max plan on second Mac
- [BUG] API ERROR 401 after login on Ubuntu
- Task tool subagents fail with "OAuth authentication is currently not supported" when logged in via OAuth
- [Bug] Claude Code freezes with token consumption but no task progress
- [BUG] Excessive Retry Delays When Fast Model Returns 401 - No Configurable Fallback
- WebFetch returns 401 error for publicly accessible docs.claude.com URLs
- Bug Report
- I am getting this API error more frequently it seems over...
- [Bug] Terminal UI Flickering and Inconsistent Code Generation Behavior
- [BUG] Custom endpoint settings.json regression
- [FEATURE] Voice mode hardcodes "dummy-key-for-local" instead of supporting configurable API keys for local STT services
- seems my cladue code faced the API Error: 401...
- Sub-agent Authentication Failure Preventing Tool Execution