How do I use Claude Code with an existing Anthropic API Key? - Stack Overflow
Claude Code Has Gone From Game-Changer to Garbage – Anthropic, What Are You Doing? : ClaudeAI
Is Claude from Anthropic the best AI Code Assist in the market? : LocalLLaMA
Claude is down? A lot of API Errors 500 or "Violating our Usage Policy" : Anthropic
Does Claude Code work with the Claude desktop app?
Is Claude Code secure?
Which models does Claude Code use?
Videos
» npm install @anthropic-ai/claude-code
I use my own API key in private projects, and it seems to work like this:
# .env file ANTHROPIC_API_KEY=sk-...In the project:
# .claude/settings.json { "apiKeyHelper": "source .env && echo $ANTHROPIC_API_KEY" }Then invoke
claudein inside the project root and verify with/statuscommand:Claude Code v1.0.85 L Session ID: 69... ... Account L Auth Token: apiKeyHelper L API Key: apiKeyHelper
Source: https://github.com/anthropics/claude-code/issues/441#issuecomment-3207226042
If someone get this error: Error getting API key from apiKeyHelper (in settings or ~/.claude.json): /bin/sh: 1: source: not found
That error comes from the fact that your shell (likely /bin/sh) doesn’t recognize the source command — it’s a Bash built-in, not POSIX-standard.
Here's the fix (Force bash):
{ "apiKeyHelper": "bash -c 'source .env && echo $ANTHROPIC_API_KEY'" }
Never teach people to put a secret key in a non-popular env var convention file. Always put it in the popular environment variable file.
Looks like folks found a workaround that actually works: https://github.com/anthropics/claude-code/issues/441#issuecomment-3050967059
Create a
~/.claude/settings.jsonfile with this content:{ "apiKeyHelper": "echo <API KEY>" }