Invalid API key · Please run /login
Resolved 💬 10 comments Opened Aug 5, 2025 by devload Closed Jan 20, 2026
Bug Description
Environment Info
- Platform: darwin
- Terminal: ssh-session
- Version: 1.0.68
- Feedback ID:
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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1269:6454\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-08-05T11:45:50.789Z"},{"error":"SyntaxError: Unexpected token 'I', \"Invalid AP\"... is not valid JSON\n at JSON.parse (<anonymous>)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:813:9932\n at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:674:14418)\n at XOB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1294:10811)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-08-05T11:45:50.797Z"},{"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 oP.validateHeaders (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1278:930)\n at oP.buildHeaders (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1278:8380)\n at oP.buildRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1278:7461)\n at oP.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1278:3310)\n at async yY1.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3030:14400)\n at async yY1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2512:3471)\n at async _pB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3030:14251)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3030:9308\n at async vP0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3030:1689)\n at async z01 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3030:9278)","timestamp":"2025-08-05T11:45:50.864Z"},{"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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1269:6454\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-08-05T11:46:50.244Z"}]This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗