Videos
How do I get started with Claude?
Does Claude Code work with the Claude desktop app?
Is Claude Code secure?
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>" }
Been using code cli (pay as you go) and claude pro plan for a few months now.
The docs *now* indicate that a user can connect their pro plan account to their code cli. However, when I use the login in shows only 1) sign up for max, or 2) use the api pay-as-you-go. Inquiring with the online help doesn't provide a solution.
Here is the:
<snippet>
Claude Code can now be used with your Max subscription from the Claude app or billed based on API usage through your Console account.
Select login method:
โฏ 1. Claude account with Max subscription
Starting at $100/mo - Best value, predictable pricing
2. Anthropic Console account
API usage billing
</snippet
I am logged in to both services with the same login/account. Has anyone fixed this?
I've used claude code with api keys in the past, my account has zero credits.
Today I was going to try the claude code with pro subscription, but it just does not work. Im using the latest version of the CLI tool and it still says balance too low. even after logout, login, at login now it says "Add $5 to procced" which makes no sense.
So, how to use it?