claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

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

Open danal443 opened this issue 1 year ago • 33 comments

Bug Description API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."},"request_id":"req_011CSGC6FX7ZYBFteg7RDwAF"}

Environment Info

  • Platform: win32
  • Terminal: null
  • Version: 1.0.84
  • Feedback ID: 9407d087-56c9-48d2-87a0-9df64f36c4a7

Errors

[{"error":"Error: Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the \"X-Api-Key\" or \"Authorization\" headers to be explicitly omitted\n    at file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:950:6454","timestamp":"2025-08-19T01:14:41.651Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"OAuth authentication is currently not supported.\"},\"request_id\":\"req_011CSGBgwt54cyGf9ntyixix\"}\n    at D6.generate (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:942:2449)\n    at aP.makeStatusError (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:959:2101)\n    at aP.makeRequest (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:959:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-08-19T01:16:29.681Z"},{"error":"SyntaxError: Unexpected token 'A', \"API Error:\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:718:9932\n    at Q (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:677:13339)\n    at jPB (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:29738)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-08-19T01:16:29.698Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"OAuth authentication is currently not supported.\"},\"request_id\":\"req_011CSGBgyDSmu5nPknKDQ5v3\"}\n    at D6.generate (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:942:2449)\n    at aP.makeStatusError (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:959:2101)\n    at aP.makeRequest (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:959:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async OPB.dG1.showErrors (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:24578)\n    at async dG1 (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:13705)\n    at async OPB (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:24429)\n    at async file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:19524\n    at async yN0 (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:5164)\n    at async G01 (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:19494)","timestamp":"2025-08-19T01:16:30.099Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"OAuth authentication is currently not supported.\"},\"request_id\":\"req_011CSGC6DmSR3SgxyjG4b7Aj\"}\n    at D6.generate (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:942:2449)\n    at aP.makeStatusError (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:959:2101)\n    at aP.makeRequest (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:959:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-08-19T01:21:45.502Z"},{"error":"SyntaxError: Unexpected token 'A', \"API Error:\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:718:9932\n    at Q (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:677:13339)\n    at jPB (file:///C:/Users/dan/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1875:29738)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-08-19T01:21:45.521Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"OAuth authentication is currently not supported.\"},\"request_id\":\"req_011CSGC6FX7ZYBFteg7RDwAF\"}\n    at D6.generate (file:///

Note: Error logs were truncated.

danal443 avatar Aug 19 '25 01:08 danal443

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/6052
  2. https://github.com/anthropics/claude-code/issues/5976
  3. https://github.com/anthropics/claude-code/issues/5983

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 19 '25 01:08 github-actions[bot]

it happened my cc too .

stream2java avatar Aug 19 '25 02:08 stream2java

The same issue is happening here. I've also subscribed to the $250 Max Plan via iOS, but in other sessions it detects me as a pro user and locks me to use Sonnet 4 only :(.

AliAkhtari78 avatar Aug 19 '25 05:08 AliAkhtari78

it happened my cc too

novacents avatar Aug 19 '25 05:08 novacents

This is also happening for me, I just signed up for the pro monthly plan

pravin-santhanam27 avatar Aug 19 '25 05:08 pravin-santhanam27

I get the same error

mgrahamx avatar Aug 19 '25 09:08 mgrahamx

Same error. Did u fix it?

YadgarovFayzullo avatar Aug 19 '25 10:08 YadgarovFayzullo

API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not allowed for this organization."},"request_id":"req_011CSGwJ2hH5idbf2uY9jM8g"} just happened on mac os

simonojok-glitch avatar Aug 19 '25 10:08 simonojok-glitch

Same here...just subscribed to claude for a project but now I can't use it

API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."},"request_id":"req_011CSGxeVLab5eZsBgGc2bs4"}

hgabha avatar Aug 19 '25 11:08 hgabha

same error

pattycodes avatar Aug 19 '25 11:08 pattycodes

Looks like I just had to close logout claude, close by current terminal session and open a new one.

vatadepalli avatar Aug 19 '25 13:08 vatadepalli

same error to me, have you fixed it ?

bingshuoguo avatar Aug 19 '25 13:08 bingshuoguo

/logout and then.. /model I change to use opus4 only and it work +

sap-anan avatar Aug 19 '25 15:08 sap-anan

Unfortunately that is a temp fix: it will stop working. Here is the breakdown of this bug:

  • Hit rate limit: Get 401. Logout and back in fixes it. Twice.
  • Third time? That stops working no matter what you do.
  • After that, you have to downgrade to 1.0.81 to get back to work.
  • GREAT, that works a few times, BUT,
  • THEN it starts ignoring your no auto update rule, and updates you to the latest versions (82, 83, and now 84), with the BUG
  • NOW you have to downgrade every time you hit the limit.

We need this fixed.

swoopsus avatar Aug 19 '25 17:08 swoopsus

uninstalling and then installing worked for me

patrg444 avatar Aug 19 '25 20:08 patrg444

same here

Joir-Jio avatar Aug 20 '25 06:08 Joir-Jio

low your version to .1 it can works

stream2java avatar Aug 20 '25 07:08 stream2java

low your version to .1 it can works

how did u lower version?

YadgarovFayzullo avatar Aug 20 '25 10:08 YadgarovFayzullo

mesmo erro aqui tambem API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."}

brunnocruzf avatar Aug 20 '25 11:08 brunnocruzf

In Windows, I deleted {User}\.claude directory. It worked for me.

SkyrookieYu avatar Aug 20 '25 14:08 SkyrookieYu