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 claude in inside the project root and verify with /status command:

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.

Answer from ImBIOS on Stack Overflow
🌐
Anthropic
anthropic.com › api
Claude Developer Platform
Run Python code, create visualizations, and analyze data directly within API calls.
Claude
Claude is AI for all of us. Whether you're brainstorming alone or building with a team of thousands, Claude is here to help.
Explore pricing
Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.
Careers
Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.
Introducing Claude 3.5 Sonnet
Claude 3.5 Sonnet is now available for free on Claude.ai and the Claude iOS app, while Claude Pro and Team plan subscribers can access it with significantly higher rate limits. It is also available via the Anthropic API, Amazon Bedrock, and Google Cloud’s Vertex AI.
🌐
Anthropic
docs.anthropic.com › en › docs › claude-code › overview
Claude Code overview - Claude Code Docs
Unix philosophy: Claude Code is composable and scriptable. tail -f app.log | claude -p "Slack me if you see any anomalies appear in this log stream" works. Your CI can run claude -p "If there are new text strings, translate them into French and raise a PR for @lang-fr-team to review". Enterprise-ready: Use the Claude API, or host on AWS or GCP.
Discussions

How do I use Claude Code with an existing Anthropic API Key? - Stack Overflow
Instead of going through claude console /login to create a new API key, I would like to use an existing Anthropic API key. How do I get Claude Code to do this? The /login command forces you to More on stackoverflow.com
🌐 stackoverflow.com
Claude Code Has Gone From Game-Changer to Garbage – Anthropic, What Are You Doing? : ClaudeAI
Claude hitting usage limits? Let Autopilot Work While You Live. NO API KEY NEEDED. NO EXTRA COST. ... This post is locked. You won't be able to comment. ... Claude Code Has Gone From Game-Changer to Garbage – Anthropic, What Are You Doing?Coding (self.ClaudeAI) More on old.reddit.com
🌐 r/ClaudeAI
Is Claude from Anthropic the best AI Code Assist in the market? : LocalLLaMA
I have been using Claude for the last two days and I'm impressed! Thinking of buying the Pro subscription, but before that I need to confirm... More on old.reddit.com
🌐 r/LocalLLaMA
Claude is down? A lot of API Errors 500 or "Violating our Usage Policy" : Anthropic
🌐 r/Anthropic
People also ask

Does Claude Code work with the Claude desktop app?
Yes. Max, Pro, Team, and Enterprise users can access Claude Code on the Claude desktop app.
🌐
claude.com
claude.com › product › claude-code
Claude Code - AI coding agent for terminal & IDE | Claude
Is Claude Code secure?
Yes. Claude Code runs locally in your terminal and talks directly to model APIs without requiring a backend server or remote code index. It also asks for permission before making changes to your files or running commands.
🌐
claude.com
claude.com › product › claude-code
Claude Code - AI coding agent for terminal & IDE | Claude
Which models does Claude Code use?
Claude Code works with the Opus 4.5, Sonnet 4.5, and Haiku 4.5 models. Enterprise users can run Claude Code using models in existing Amazon Bedrock or Google Cloud Vertex AI instances.
🌐
claude.com
claude.com › product › claude-code
Claude Code - AI coding agent for terminal & IDE | Claude
🌐
npm
npmjs.com › package › @anthropic-ai › claude-code
@anthropic-ai/claude-code - npm
1 day ago - Use Claude, Anthropic's AI assistant, right from your terminal. Claude can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.. Latest version: 2.0.76, last published: 20 hours ago.
      » npm install @anthropic-ai/claude-code
    
Published   Dec 22, 2025
Version   2.0.76
Author   Anthropic
🌐
AWS
docs.aws.amazon.com › amazon bedrock › user guide › amazon bedrock foundation model information › inference request parameters and response fields for foundation models › anthropic claude models › anthropic claude messages api
Anthropic Claude Messages API - Amazon Bedrock
4 days ago - This topic shows how to use the Anthropic Claude messages API with the base inference operations (InvokeModel or InvokeModelWithResponseStream). However, we recommend that you use the Converse API to implement messages in your application. The Converse API provides a unified set of parameters that work across all models that support messages.
🌐
Anthropic
anthropic.com › learn › build-with-claude
Anthropic Academy: Claude API Development Guide
Set up your developer account and generate API keys on the Anthropic Console. Use our quickstart guide to make your first API call · Get started with Claude Code with npm install -g @anthropic-ai/claude-code
🌐
Claude
claude.com › product › claude-code
Claude Code - AI coding agent for terminal & IDE | Claude
1 month ago - ⏺ Now I'll fix the issue by updating the route.ts file to remove unused fileData code since the frontend constructs the messages for the API: ... ⏺ Great, there are no more instances of fileData in the route.ts file. Now let's run the lint check to ensure our changes don't cause any issues: ... ⏺ Bash(cd /Users/user/code/anthropic-quickstarts/financial-data-analyst && git commit -m "Fix unused fileData code in finance API route …
Find elsewhere
🌐
Anthropic
anthropic.com › news › claude-3-7-sonnet
Claude 3.7 Sonnet and Claude Code
API users also have fine-grained control over how long the model can think for. Claude 3.7 Sonnet shows particularly strong improvements in coding and front-end web development. Along with the model, we’re also introducing a command line tool for agentic coding, Claude Code.
🌐
Claude
claude.ai
Claude
Talk with Claude, an AI assistant from Anthropic