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

Resolved 💬 2 comments Opened Jul 10, 2025 by MizuNoKokyu 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."}}... please help

Environment Info

  • Platform: darwin
  • Terminal: cursor
  • Version: 1.0.44
  • Feedback ID: 18f3981f-ba52-4c8f-ab9a-ccc81ff5a281

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:984:15)\n    at wrappedFn (node:internal/errors:538:14)\n    at checkExecSyncError (node:child_process:891:11)\n    at execSync (node:child_process:963:15)\n    at wD (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n    at file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:623:9350\n    at Q (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n    at uC (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:623:8496)\n    at hC (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:623:7361)\n    at wB (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:623:11970)","timestamp":"2025-07-10T00:46:18.467Z"},{"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:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n    at gq.makeStatusError (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n    at gq.makeRequest (file:///Users/josephkim/.claude/local/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:46:19.379Z"},{"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:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n    at gq.makeStatusError (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n    at gq.makeRequest (file:///Users/josephkim/.claude/local/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:46:19.848Z"},{"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:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n    at gq.makeStatusError (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n    at gq.makeRequest (file:///Users/josephkim/.claude/local/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:46:20.437Z"},{"error":"SyntaxError: Unexpected token 'A', \"API Error:\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:618:9971\n    at Q (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n    at Lw2 (file:///Users/josephkim/.claude/local/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:46:20.439Z"},{"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:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n    at gq.makeStatusError (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n    at gq.makeRequest (file:///Users/josephkim/.claude/local/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:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1690:23214)\n    at async fA1 (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1690:12720)\n    at async aR2 (file:///Users/josephkim/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1690:23062

Note: Error logs were truncated.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗