relogin many time but : "API Error: 401...
Resolved 💬 18 comments Opened Jul 10, 2025 by babim Closed Jul 10, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
relogin many time but : "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: linux
- Terminal: WarpTerminal
- Version: 1.0.44
- Feedback ID: c4e6d4ef-5467-4ff1-8cee-db880babe70f
Errors
[{"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:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n at gq.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n at gq.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:5311)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-07-10T00:52:10.722Z"},{"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:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n at gq.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n at gq.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:5311)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-07-10T00:52:11.499Z"},{"error":"SyntaxError: Unexpected token 'A', \"API Error:\"... is not valid JSON\n at JSON.parse (<anonymous>)\n at file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:618:9971\n at Q (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n at Lw2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1337:10306)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-07-10T00:52:11.505Z"},{"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:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n at gq.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n at gq.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:5311)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async fA1.showErrors (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:23214)\n at async fA1 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:12720)\n at async aR2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:23062)\n at async file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:18138\n at async Y0A (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:5121)\n at async Vc (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:18108)","timestamp":"2025-07-10T00:52:12.188Z"},{"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:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n at gq.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n at gq.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:5311)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-07-10T00:52:14.877Z"},{"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:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n at gq.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n at gq.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:5311)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async fA1.showErrors (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:23214)\n at async fA1 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:12720)\n at async aR2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:23062)\n at async file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:18138\n at async Y0A (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:5121)\n at async Vc (file:///usr/lib/node_modules/@a
Note: Error logs were truncated.
18 Comments
I just started running into this too.
Same here
Running on Mac OS
Same, after trying all fixes in https://github.com/anthropics/claude-code/issues/1484 and https://github.com/anthropics/claude-code/issues/1746
Same here.
same here suddenly right now.
Same here, I guess its just an error on Anthropics side
FYI for others who didn't know this. If you closed the conversation to try to reconnect, you can resume your previous conversation with /resume
Wow here I was trying to load context into new chats manually :(
We paged our accounts oncall and are trying to address the issue ASAP.
Yeah, for $200USD per month....
~173 working hours per month (40 hours × 52 weeks ÷ 12 months)
$200 ÷ 173 hours = $1.16 per hour
Just saying.... refunds no matter how small are appreciated when Anthropic is heartless about charging you for every API call no matter how erroneous (the case before Claude MAX).
EDIT: Back online within 10minutes of this going up. That is why Anthropic is a leader, shouldn't happen but when it does they take care of it. I won't delete the post, it's a reminder to Anthropic that we count the beans too.
Hey its now working on my side
anthropics Fixed
May the vibe be with everyone
The incident should now be resolved. Thank you for your patience.
\- Claude Code oncall
I'm still getting the same API error 401. The version is 1.0.48.
it was working yesterday but today (2025-07-22, two weeks after this issue was first posted) I had the same problem, on the AUR package claude-code-1.0.55-1. I removed it and installed the latest 1.0.57 from npm, which fixed it
I'm still having this same exact issue, which started yesterday for me. I hate to open another ticket as they seem to get closed as a duplicate.... but it's still an issue.
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.