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
🌐
Zapier
zapier.com › productivity › app tips
Claude API: How to get a key and use the API
July 8, 2024 - This guide includes a step-by-step tutorial on how to get a Claude API key, how to call the Claude API, and how to get the responses where you want them.
🌐
Claude
docs.claude.com › en › api › admin-api › apikeys › get-api-key
Get API Key - Claude Docs
Learn more about extending Claude's capabilities with Agent Skills. ... curl "https://api.anthropic.com/v1/organizations/api_keys/apikey_01Rj2N8SVvo6BePZj99NhmiT" \ --header "anthropic-version: 2023-06-01" \ --header "content-type: application/json" \ --header "x-api-key: $ANTHROPIC_ADMIN_KEY"
🌐
Pickaxe
pickaxe.co › post › how-to-get-your-claude-api-key-a-step-by-step-guide
How to get your Claude API key: A step-by-step guide (2025) - Pickaxe Blog
If you have existing API keys, you'll see a list here, including their nickname and the date they were created. If you don't have any keys, it will be empty. Look for the “+Create Key” button on the top right corner and click on it.
🌐
Claude AI Hub
claudeaihub.com › claude-api-key
Claude API Key Guide | How to Get and Use It | Claude AI Hub
November 5, 2024 - After obtaining your API key, integrating it into your application is straightforward. Here’s a basic example of how to use the Claude 3 API key in a typical development environment:
🌐
Nightfall AI
nightfall.ai › ai-security-101 › anthropic-claude-api-key
Anthropic Claude API Key: The Essential Guide | Nightfall AI Security 101
The header should be named "Authorization" and the value should be "Bearer " followed by your API key. Anthropic Claude API keys are sensitive information and should be treated with care.
🌐
Make
make.com › en › blog › claude-api-key
Claude API | How to Get an API Key and Start Using It | Make
March 7, 2025 - Follow these best practices when setting up the “Create a Prompt” Claude app module: Pick the right Claude model for your needs and budget. For example, Claude 3.5 Haiku might be the best option if you need near-instant responses.
🌐
Chatbase
chatbase.co › blog › claude-api
How to Access and Use the Claude API
To interact with the Claude 3.5 Sonnet API, you will need an API key. Here’s how you can get it: Head to the API Keys section in the Anthropic Console. Click on Create Key to generate a new API key.
🌐
Medium
medium.com › @yjg30737 › how-to-get-started-with-claude-api-step-by-step-guide-92b5e35ae0a0
How to Get Started with Claude API: Step-by-Step Guide | by Yjg | Medium
September 24, 2024 - In the Settings tab (Image 1), you’ll find a section labeled API keys. This is where you manage and generate API keys. Each API key allows access to Claude’s capabilities. In this example, an API key has already been created.
Find elsewhere
🌐
tilburg.ai
tilburg.ai › home › beginner’s tutorial for the claude api python
Beginner's Tutorial for the Claude API Python - tilburg.ai
January 17, 2025 - In the New System Variable dialog, enter CLAUDE_API_KEY as the variable name and your actual API key as the variable value.
🌐
Elephas
elephas.app › blog › how-to-get-claude-api-key-step-by-step-guide-or-2024-clxvepzbb00084gdk5z5kixqp
How to Get Claude API Key (Step by Step Guide) | 2025
February 9, 2025 - 2. Navigate to API Keys: Locate the "API Keys" section, typically under your profile settings. 3. Create a New Key: Click the "Create Key" button and assign a descriptive name for easy identification. 4. Secure Your Key: Copy the generated key and store it securely in a password manager. You won't be able to retrieve it later. Claude API enforces usage limits to ensure fair access and optimal performance for all users.
🌐
Latenode
latenode.com › home › blog about no-code integrations with latenode - the ultimate no-code automation platform › undefined › anthropic claude (claude 3.5, claude 4, sonnet, opus) in ai technology & language models - explore no-code automation with latenode › what is claude api and how to get api key?
What is Claude API and How to Get API KEY?
Carefully designed prompts and combining various API calls enable the creation of sophisticated multi-turn dialogues, while extensive claude api documentation and example libraries accelerate development. You can try Newest AI Anthropic Claude Without Using API on Latenode Get started · For developers who are new to working with web APIs, it's important to grasp some claude key concepts before diving into the specifics of Claude.
🌐
Claude Docs
platform.claude.com › docs › en › api › overview
API Overview - Claude Docs
... curl https://api.anthropic... application/json" \ --data '{ "model": "claude-sonnet-4-5", "max_tokens": 1024, "messages": [ {"role": "user", "content": "Hello, Claude"} ] }'...
🌐
GitGuardian
docs.gitguardian.com › claude api key
Claude API Key | GitGuardian documentation
Summary: Anthropic is an AI safety and research company. Claude is their dialogue and creative content generation model. This detector aims at catching Claude API keys.
🌐
Social Intents
help.socialintents.com › social intents knowledge base › ai chatbots › how to find your anthropic claude api key
How to Find Your Anthropic Claude API Key - Social Intents Knowledge Base
In this article, we're going to show you how to easily generate an Anthropic Claude API Key to quickly integrate the Claude AI models into your projects and app
🌐
Anthropic
anthropic.com › learn › build-with-claude
Anthropic Academy: Claude API Development Guide
Resources to help you get started with Claude, whether you're hacking with us at an event or on your own · Set up your developer account and generate API keys on the Anthropic Console.
🌐
Apidog
apidog.com › blog › how-to-use-claude-api-key-for-free-in-2025
How to Use Claude API Key for Free in 2025
October 19, 2025 - Search for popular community-driven ... the Claude API. Platforms like GitHub are ideal for finding an SDK that suits your project’s needs. ... Install the SDK using your package manager of choice. For a Node.js environment, you might install the SDK via npm. For example: ... After installation, configure your local environment by setting the acquired API key as an environment ...