API Error 401 (authentication_error) — page 3
The API rejected the credential attached to the request.
463 issues · 40 open · 423 resolved (91%) · 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 converging. 51 new reports in the last 90 days vs 137 in the 90 before — -63%. The open backlog peaked at 70 in 2026-07 and sits at 40 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
239 of these reports name the Claude Code build they were running, spanning 117 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 10 days across 423 closures. Of the 423 closures with a recorded reason, 18% were closed as completed and 346 as not-planned or duplicate. The most recent completed fix landed in 2026-09.
Workarounds reported by the community
91 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 463 matches; the statistics above cover all 463.
- [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
- 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
- [security-guidance] Reviews that fail with API errors (e.g. HTTP 401) are reported as clean and marked reviewed
- Claude in Chrome: CLI never contacts the native messaging host (Status stays "Disabled")
- Desktop SSH remote session fails with "401 OAuth access token is invalid" while the claude CLI on the same host, same user, same credentials file works
- claude.ai META mcp connector times out in Claude Code CLI while working in claude.ai web chat
- [Bug] Anthropic API Error: Repeated false positive detection
- Setup-token (CLAUDE_CODE_OAUTH_TOKEN) fails with 401 in long-running `claude --channels` process while the same token works in one-shot `claude -p`
- [Bug] Model keeps automatically switching back to Opus
- [Bug] Duplicate skill entries in /context output with narrow terminal and long skills list
- [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] Claude Code ignores established patterns and reinvents solutions, causing token waste
- [Feature Request] Add support for forking conversations into separate threads
- [BUG] /login → Third-party → Claude Platform for AWS re-auth loops back to the top-level login menu; underlying 401 retries ~10× before surfacing
- [Bug] Anthropic API Error: Socket connection closed unexpectedly (401)
- DELETED FILES AFTER 1 DAY OF WORK ON A SIMPLE TASK. IHOPE CLAUDE GETS SUED THIS IS CONSTANT MENTAL ABUSE BY DESIGN
- TOOL KEEPS IMPROVISING MAKING OWN DECISIONS DESPITE CONSTANTLY BEING REDIRECTED TOWARDS RULES. ALL RULES IGNORED CONSTANTLY
- [Bug Report] ignores all rules doesn't execute anything correctly
- [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)
- [DOCS] MCP docs omit combined startup notification for MCP server and connector authentication
- [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