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

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

Open ap-start-ups opened this issue 2 months ago โ€ข 7 comments

Bug Description API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."},"request_id":"req_011CUfEoUHxoPjKj7PJHsAZt"} ยท Please run /login ----- not able to login using account and getting OAuth Request Failed Internal server error

Environment Info

  • Platform: win32
  • Terminal: null
  • Version: 2.0.30
  • Feedback ID:

Errors

[{"error":"AxiosError: Request failed with status code 401\n    at fR (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:24:1136)\n    at IncomingMessage.<anonymous> (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:29:9845)\n    at IncomingMessage.emit (node:events:530:35)\n    at IncomingMessage.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1698:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at b7A.request (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:31:2129)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Hp2 (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3617:15232)","timestamp":"2025-10-31T11:41:56.985Z"},{"error":"AxiosError: Request failed with status code 400\n    at fR (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:24:1136)\n    at IncomingMessage.<anonymous> (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:29:9845)\n    at IncomingMessage.emit (node:events:530:35)\n    at IncomingMessage.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1698:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at b7A.request (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:31:2129)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async ekQ (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1954:1434)\n    at async Hn (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3594:10956)\n    at async Hz (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:653:23256)\n    at async OR8 (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:653:29928)\n    at async QrB (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:653:30174)","timestamp":"2025-10-31T11:42:00.609Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"OAuth token has expired. Please obtain a new token or refresh your existing token.\"},\"request_id\":\"req_011CUfDSdp14tmeUAHBizfgm\"}\n    at M4.generate (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:204:83101)\n    at Jk.makeStatusError (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:358:2117)\n    at Jk.makeRequest (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:358:5330)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async YVA (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1314:8767)\n    at async UwA (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3378:1031)\n    at async K01 (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3378:1240)\n    at async cm2 (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3388:531)","timestamp":"2025-10-31T11:42:05.056Z"},{"error":"AxiosError: Request failed with status code 400\n    at fR (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:24:1136)\n    at IncomingMessage.<anonymous> (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:29:9845)\n    at IncomingMessage.emit (node:events:530:35)\n    at IncomingMessage.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1698:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at b7A.request (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:31:2129)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async ekQ (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1954:1434)\n    at async Hn (file:///C:/Users/amitm/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3594:10956)\

Note: Error logs were truncated.

ap-start-ups avatar Oct 31 '25 12:10 ap-start-ups


Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/10706
  2. https://github.com/anthropics/claude-code/issues/10705
  3. https://github.com/anthropics/claude-code/issues/10710

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 Oct 31 '25 12:10 github-actions[bot]

same for me please fix it platform: mac os

mhhio avatar Oct 31 '25 12:10 mhhio

yeah same

Hue-Honda avatar Oct 31 '25 12:10 Hue-Honda

Same error

emersong-espressolabs avatar Oct 31 '25 12:10 emersong-espressolabs

same issue, this is fkn ridiculous

anthonystepvoy avatar Oct 31 '25 13:10 anthonystepvoy

Try this, it worked for me https://github.com/anthropics/claude-code/issues/10171#issuecomment-3505231395

jererobles avatar Nov 07 '25 22:11 jererobles

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 09 '25 10:12 github-actions[bot]

still having this issue

codenamezjames avatar Dec 12 '25 15:12 codenamezjames