[BUG] Invalid API Key - Fix external API key when running headless mode with -p

Resolved 💬 8 comments Opened Aug 13, 2025 by bibo52 Closed Mar 4, 2026

Environment

  • Claude CLI version: v1.0.77
  • Operating System: MacOS 15.2
  • Terminal: Terminal App

Bug Description

Any time I attempt to run claude via claude -p "test" it returns Invalid API key · Fix external API key

Expected Behavior

Interactive Claude Code works and is logged in via Max plan, also works over SSH.

View original on GitHub ↗

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