API Error 401 (authentication_error) — page 3
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 201–300
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 441 matches; the statistics above cover all 441.
- API Error: 401 {"type":"error","error":{"type":"authenticati...
- Not able to chat with agent in claude code it is throwing...
- OAuth Token Refresh Failure During Active Session
- Cowork chat composer intermittently unclickable (click doesn't focus it); Cmd+R recovers, restart doesn't
- [BUG] ECONNRESET on home Wi-Fi — curl succeeds at exact same moment Claude Code fails
- [BUG] Successful auto-retry after api_error orphans the assistant turn: stop_hook_summary + next user message get parented to the api_error node instead of the recovered reply
- [BUG] /login → Third-party → Claude Platform for AWS re-auth loops back to the top-level login menu; underlying 401 retries ~10× before surfacing
- TOOL KEEPS IMPROVISING MAKING OWN DECISIONS DESPITE CONSTANTLY BEING REDIRECTED TOWARDS RULES. ALL RULES IGNORED CONSTANTLY
- [Bug Report: Unable to process - no bug details provided] COMPLETELY IGNORES ALL INSTRUCTIONS - MENTAL ABUSE DAY IN ALL DAY EVERY DAY
- [Bug] Model inverts instructions, modifying protected code sections instead of specified areas
- [BUG] Severe latency on Sonnet 4.6 in VS Code extension despite green status page (Jun 6, 2026)
- Stale OAuth refresh token causes persistent 401 "Invalid authentication credentials" that `/login` does not recover from (manual deletion of ~/.claude/.credentials.json required)
- claude.ai connector via mcp-proxy.anthropic.com rejected with mcp_unauthorized_after_token_refresh while claude.ai backend uses the same grant successfully (OAuth 2.1 refresh rotation race)
- setup-token OAuth token returns 401 Invalid bearer token with claude -p on Max subscription (interactive login on same account works)
- [BUG] headersHelper output not applied to HTTP MCP requests -- SDK ignores tokens and falls through to OAuth 2.1 browser flow
- [Bug] Shell snapshot doesn't capture zsh hook arrays (chpwd_functions, precmd_functions)
- [Bug] 200K context model requires usage credits unexpectedly after recent changes
- You've hit your session limit · resets 11:40am (America/Los_Angeles)
- [Bug] Token usage exceeds expected rate during API calls
- You've hit your limit · resets 9:20pm (America/Sao_Paulo)
- [BUG] OAuth session expires mid-session with 401, /login doesn't reliably refresh
- Credit balance is too low
- [Bug] Authentication Error: 401 Unauthorized on API Requests
- [BUG] Desktop SSH session: every API call fails with `OAuth authentication is currently not supported` (401) on `ccd-cli 2.1.121`
- [BUG] v2.1.121 OAuth authentication fails with 401 on Team subscription, v2.1.89 works fine
- I don't see a complete bug report in your message. Could you please provide the full bug report details so I can generate an appropriate GitHub issue title for Claude Code?
- [BUG] CLI OAuth login succeeds but all API calls return 401 Invalid bearer token (desktop app works fine)
- [BUG] Claude Pro subscription returns 401 on every API call after successful login (macOS)
- [BUG] MCP server env block in ~/.claude.json not passed to spawned MCP servers inside Dev Container
- [Bug] Terminal output from background loops erases Claude conversation history
- Desktop app freezes during large builds — token stream stalls while timer continues
- Claude Code CLI: OAuth token not auto-refreshed on headless server (refreshToken ignored)
- [BUG] Frequent mid-session 401 errors
- MCP env vars: tokens stripped from OPENAPI_MCP_HEADERS, NOTION_TOKEN renamed to NOTION_API_KEY (v2.1.109)
- [Bug] Claude ignores project guidelines in claude.md for complex refactoring tasks
- Streamable HTTP MCP: auth requirement should be based on 401 response, not well-known endpoint discovery
- I have Max plan but I see error " Please run /login · API...
- Title: CLI login flow is unreliable — takes multiple attempts, inconsistent behavior
- [BUG] CLI bridge sessions intermittently throw 401 authentication_error on Max plan (v2.1.92)
- [BUG] Authentication issue
- RemoteTrigger tool returns 401 due to missing beta/version headers
- [BUG] RemoteTrigger tool returns 401 in Desktop app while UI can create triggers successfully
- [BUG] MCP OAuth: Client does not fall back to OIDC Discovery (/.well-known/openid-configuration) when RFC 8414 metadata returns 404
- Ghost claude.ai MCP server blocks plugin server despite not being configured in connectors
- setup-token generates invalid bearer token (401 Invalid bearer token)
- [BUG] RemoteTrigger tool returns 401 despite valid OAuth on Max plan (tengu_ccr_bridge: false)
- Claude ignores CLAUDE.md instruction to read memory files at conversation start
- RemoteTrigger tool returns 401 despite successful OAuth login
- [BUG] ECONNRESET on every API call — macOS 26.3.1 Tahoe, Intel x86_64
- OAuth token refresh race condition kills parent session during parallel agent spawns
- [BUG] Log in via OAuth is far too frail
- [BUG] Claude Code CLI/VS Code — repeated connection timeouts followed by OAuth token expiry, forces re-login every few minutes
- [BUG] --brief mode silently swallows authentication errors (401), showing no output
- [Feature Request] Add internationalization (i18n) support for CLI interface
- [BUG] VS Code Extension OAuth broken on Linux - malformed redirect URI + subscription 401
- [BUG] API Error: 401 — authentication_error: OAuth token
- [Bug] Anthropic API Error: Invalid authentication credentials (401)
- [BUG] OAuth token expires 5-10 times within a single session, requiring constant /login
- [Bug] API Error: 401 on new Claude Code sessions and idle session resumption
- unusually fast 30 minute token burn in Claude pro
- [BUG] Auth broken in all IDE extensions since 2.1.32 — "Invalid API key" / "Invalid bearer token" 401
- [BUG] OAuth token expiration causing repeated 401 errors despite re-authentication
- [Bug] File search functionality broken after upgrade to 2.1.9
- OAuth token expires mid-session in Claude Desktop with no recovery path
- MCP OAuth tokens expire in idle conversations with no way to re-authenticate
- Retain user input after OAuth token expiration and re-login
- [BUG] /login reports success but the bearer token is immediately invalid (401).
- [BUG]
- [Bug] Crashes whiles working in latest version
- [FEATURE]
- [Bug] Claude Opus hallucinating fabricated system-reminder blocks with fake tool results
- MCP server environment variables not passed to server process (Notion MCP returns 401)
- [Bug] /context command returns textual error instead of loading context
- [Bug] Anthropic API Error: OAuth token expiration not handled, requires manual /login restart
- [Bug] Context low warning triggers despite available token budget
- Teleport doesn't work. I started a Claude Code session on...
- [Bug][BLOCKER] Anthropic API Error: Invalid OAuth token authentication failure
- ⎿ API Error: 401 {"type":"error","error":{"type":"authenti...
- [Bug] Unauthorized git push to main branch without user confirmation
- I have run into the dreaded authentication token expiration...
- [BUG]
- STRONG DISLIKE of the weird new question dialog thing.
- False positive on content moderation when I mentioned 'gain-of-function'
- you need to become better in validation of when something...
- Bug Report: FileHistory causes memory exhaustion and crash...
- I think you have chosen here an unsecure approach of giving...
- Fetch Tool does not work
- Claude completely hallucinated about there being a password...
- If you switch to Opus mode and then try to invoke '/model...
- [Bug] Authentication failure: Unable to login
- [BUG] OAuth token is dropped and requirement is ignored after MCP initialization failure
- Agent creation in recommended mode doesn't work
- [BUG] ANTHROPIC_AUTH_TOKEN renamed to CLAUDE_CODE_OAUTH_TOKEN
- [Bug] Repeated Compaction Fails with "Conversation Too Long" Error
- Claude asks "Do you trust the files in this folder?" every launch
- [Bug] Anthropic API Error: Invalid Compact Message Content
- [BUG] ⎿ API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not allowed for this organization."},"request_id":"req_011CSaNp8sR3VFy1jBYowjbq"}
- Claude code execution fails in-between session, Api error 401 is shown. its an authentication.
- Anthropic API Authentication Failure in Claude Code CLI
- OAuth Authentication Not Supported for Claude Code CLI