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

Invalid API key · Please run /login

Open EricBriscoe opened this issue 1 year ago • 5 comments

Bug Description I cannot log in to my anthropic account. Every time I try to log in it says that I'm missing an API key.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 1.0.73
  • 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 new sW (unknown:1:28)\n    at <anonymous> (/$bunfs/root/claude:796:6460)\n    at processTicksAndRejections (native:7:39)\n    at spawnSync (unknown)\n    at spawnSync (node:child_process:226:22)\n    at execSync (node:child_process:275:109)\n    at Z (/$bunfs/root/claude:1287:1572)\n    at _p9 (/$bunfs/root/claude:1287:1750)\n    at yp9 (/$bunfs/root/claude:1287:2284)\n    at yp9 (/$bunfs/root/claude:1287:2340)","timestamp":"2025-08-12T04:47:50.500Z"},{"error":"Error: No messages to compact\n    at call (/$bunfs/root/claude:2249:3779)\n    at call (/$bunfs/root/claude:2249:3978)\n    at uQY (/$bunfs/root/claude:2782:70)\n    at uQY (/$bunfs/root/claude:2778:502)\n    at hQY (/$bunfs/root/claude:2772:3525)\n    at hQY (/$bunfs/root/claude:2772:4054)\n    at jQY (/$bunfs/root/claude:2772:1560)\n    at jQY (/$bunfs/root/claude:2772:1596)\n    at nr (/$bunfs/root/claude:2772:4650)\n    at nr (/$bunfs/root/claude:2772:4614)","timestamp":"2025-08-12T04:48:09.049Z"},{"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 new sW (unknown:1:28)\n    at <anonymous> (/$bunfs/root/claude:796:6460)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-08-12T04:48:09.078Z"},{"error":"SyntaxError: JSON Parse error: Unexpected identifier \"Invalid\"\n    at <parse> (:0)\n    at parse (unknown)\n    at <anonymous> (/$bunfs/root/claude:526:9928)\n    at W (/$bunfs/root/claude:456:13332)\n    at rlG (/$bunfs/root/claude:1673:29847)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-08-12T04:48:09.078Z"},{"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 new sW (unknown:1:28)\n    at <anonymous> (/$bunfs/root/claude:796:6460)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-08-12T04:48:57.418Z"}]

EricBriscoe avatar Aug 12 '25 04:08 EricBriscoe

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5192
  2. https://github.com/anthropics/claude-code/issues/5167
  3. https://github.com/anthropics/claude-code/issues/5369

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 12 '25 04:08 github-actions[bot]

This is happening to alot of use using SSH or Mosh. Still no fix yet. @bcherny

titofebus avatar Aug 12 '25 14:08 titofebus

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

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.

github-actions[bot] avatar Jan 03 '26 10:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 10 '26 14:01 github-actions[bot]