API Error: 401 {"type":"error","error":{"type":"authenticati...

Resolved 💬 59 comments Opened Jul 10, 2025 by jackrobertscott Closed Jul 10, 2025

Bug Description
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid OAuth token. The provided token
was not found or is malformed."}}

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 1.0.44
  • Feedback ID: b5e5486b-26ac-409a-b1c6-b839f8ac9f21

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:892:11)\n    at execSync (node:child_process:964:15)\n    at wD (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:9350\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n    at uC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:8496)\n    at hC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:7361)\n    at wB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:11970)","timestamp":"2025-07-10T00:40:04.277Z"},{"error":"Error: Command failed: security delete-generic-password -a $USER -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:892:11)\n    at execSync (node:child_process:964:15)\n    at wD (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n    at TpA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:10462)\n    at OpA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:10336)\n    at k9A (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2125:2567)\n    at e01.startOAuthFlow (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2125:3733)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-10T00:40:14.822Z"},{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:892:11)\n    at execSync (node:child_process:964:15)\n    at wD (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:9350\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n    at uC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:8496)\n    at hC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:7361)\n    at wB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:11970)","timestamp":"2025-07-10T00:40:14.890Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid OAuth token. The provided token was not found or is malformed.\"}}\n    at D6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n    at gq.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n    at gq.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:5311)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-10T00:40:29.556Z"},{"error":"SyntaxError: Unexpected token 'A', \"API Error:\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:618:9971\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n    at Lw2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1337:10306)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-10T00:40:29.567Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid OAuth token. The provided token was not found or is malformed.\"}}\n    at D6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n    at gq.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n    at gq.makeRequest (file:///opt/homebrew/

Note: Error logs were truncated.

View original on GitHub ↗

59 Comments

giswqs · 1 year ago

Just ran into the same issue.

giswqs · 1 year ago

I tried logout and deleted ~/.claude and ~/.claude.json, then login again. Still the same error.

gianlucamazza · 1 year ago

same error here, confirmed

daichi1207 · 1 year ago

same here

bigmasonwang · 1 year ago

same here

wbcian · 1 year ago

same here

kimwest00 · 1 year ago

same here;)

Niqnil · 1 year ago

Same here. https://status.anthropic.com/ doesn't show outage.

Chrrxs · 1 year ago

Good to see we're all here.

gianlucamazza · 1 year ago

can we open an issue for a better error message? I got panic

fuzihaofzh · 1 year ago

Same problem。 what happend?

sottenad · 1 year ago

Same here

russellhtan · 1 year ago

Same -- logged out/in, ran /doctor, restarted. issue remains

TakashiAihara · 1 year ago

Same here

ivan-velikanov · 1 year ago

same here

ivan-velikanov · 1 year ago
Same here. https://status.anthropic.com/ doesn't show outage.

Yes. A basic message there would have been helpful, that reduces the panic to be honest. Also a command line switch to see such status in claudecode would be nice. The login issues are horrible, somewhat reduces with proxies sometimes.

MamaxYT · 1 year ago

same

bazsupport · 1 year ago

+1

is911 · 1 year ago

same here. /logout restarted machine , ran claude update /login

RoryWatts · 1 year ago

+1

SJhak · 1 year ago

+1

TheKillerScope · 1 year ago

Same on my side, and it happened at the worse step possible...

alfredchavez · 1 year ago

+1

iceice666 · 1 year ago

Same here

adsgutier · 1 year ago

Same here

dancaldera · 1 year ago

+1

thad0ctor · 1 year ago

same

davidhop11 · 1 year ago

same

RaviTmg · 1 year ago

+1

mcgilly17 · 1 year ago

+1

echo1097 · 1 year ago

same

spanosg131 · 1 year ago

Same issue. Also claude desktop for mac is not loading

Hyuk · 1 year ago

same here

parameswari-sampath · 1 year ago

+1

kjparkdavid · 1 year ago

+1

jacobfogolyan · 1 year ago

Just react to the original comment so there is't a huge thread for when we need to see solution

dohuta · 1 year ago

+1

rheza · 1 year ago

guys which video do i need to watch ?, i forgot how to code.

alansparrow · 1 year ago

+10000

RoryWatts · 1 year ago
guys which video do i need to watch ?, i forgot how to code.

I've switched to Gemini CLI for the moment and I feel like a damned animal

Sam23D · 1 year ago

same here

ZacharyZhang-NY · 1 year ago

same herer

thePostFuturist · 1 year ago

+1

Zensome · 1 year ago

🫠

attilaacs · 1 year ago

same... forced to go outside and get some sun now

dazmiller · 1 year ago

Same.

Error : API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid OAuth token. The provided token was not found or is malformed."}}

Version: 1.2.2
VSCode Version: 1.99.3
Date: 2025-07-07T06:19:13.016Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.19045

MamaxYT · 1 year ago

It's working again

ZacharyZhang-NY · 1 year ago

Deleted .claude and relogin, seems working now

<img width="1353" height="627" alt="Image" src="https://github.com/user-attachments/assets/ac333cf0-a976-476d-a0cf-bb7590b00382" />

ian-saivvi · 1 year ago

Ran /doctor and it recommended /migrate-installer. I followed the instructions there, restarted my shell, and now it's working. Could be a coincidence, but I'm back in.

mendelordanza · 1 year ago

Tried running npm i -g @anthropic-ai/claude-code in terminal and it works now

iamajvillalobos · 1 year ago

I am on max plan but I only see the sonnet model.

backnotprop · 1 year ago

Works for me:

unalias claude

npm install -g @anthropic-ai/claude-code@1.0.47

kongzui · 1 year ago

it works

03-CiprianoG · 1 year ago

Yes working again :)

jpantana · 1 year ago

works for me now

illusivejosiah · 1 year ago

Working

Hyuk · 1 year ago

It is working now.

alansparrow · 1 year ago

Fixed

github-actions[bot] · 11 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.