I am seeing API Error: 401 {"type":"error","error":{"type":"...
Bug Description I am seeing API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid bearer token"}} though I have already login with my max plan
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 1.0.53
- Feedback ID:
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:882:11)\n at execSync (node:child_process:954:15)\n at AI (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:728:6320)\n at file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:640:16554\n at Q (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:542:14406)\n at MF (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:640:14339)\n at zX (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:640:13205)\n at MB (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:640:19174)","timestamp":"2025-07-16T12:45:15.226Z"},{"error":"RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded\n at Socket.onChildStdout (node:child_process:481:14)\n at Socket.emit (node:events:507:28)\n at Socket.emit (node:domain:489:12)\n at addChunk (node:internal/streams/readable:559:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)\n at Readable.push (node:internal/streams/readable:390:5)\n at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)","timestamp":"2025-07-16T12:45:19.213Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid bearer token\"}}\n at eQ.generate (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:1180:6463)\n at k$.makeStatusError (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:1197:2101)\n at k$.makeRequest (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:1197:5315)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async aB1.showErrors (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:2594:14107)\n at async aB1 (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:2140:1658)\n at async qBB (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:2594:13956)\n at async file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:2594:9065\n at async DIA (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:2594:1626)\n at async Yp (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:2594:9035)","timestamp":"2025-07-16T12:45:22.807Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid bearer token\"}}\n at eQ.generate (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:1180:6463)\n at k$.makeStatusError (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:1197:2101)\n at k$.makeRequest (file:///Users/jessie/node_modules/@anthropic-ai/claude-code/cli.js:1197:5315)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-16T12:45:57.040Z"}]
Still ongoing since yesterday
/logout and log back in.
unset ANTHROPIC_BASE_URL ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN
Solved for me.
unset ANTHROPIC_BASE_URL ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKENSolved for me.
Solved for me as well
unset ANTHROPIC_BASE_URL ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKENSolved for me.
Solved for me, thanks.
renew this bug. It still shows in version 1.0.111 when use 'claude -p'. But in version 1.0.110 is on.
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.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
i have this issue now...
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.