# Solved: How to use an Anthropic Claude API key without browser login

> Why sharing API keys for teaching, CI/CD, or team projects shouldn't require giving everyone access to your organization.

Published: 2025-09-22
URL: https://daniliants.com/blog/solved-how-to-use-anthropic-claude-api-key-without-browser-login/
Tags: claude-code, anthropic-api, api-keys, teaching

---

Was teaching agentic AI today. Hit a stupid roadblock during the hands-on part.

The plan: Generate a temp Claude API key with strict limits, share it with students, revoke after class. No need for everyone to have paid accounts. Simple.

What actually happened: The Anthropic client library completely broke the workflow. Every time someone used the key, it forced open a browser demanding organizational login. Can't give 20 students access to my org settings - that's insane.

Searched everywhere for a way to disable this. Nothing in the docs.

Then a student finds this [Reddit thread](https://www.reddit.com/r/ClaudeAI/comments/1jwvssa/comment/mtt0urz/) with the exact fix. Turns out it's a common problem - CI/CD pipelines, automated scripts, team sharing - everyone hits this wall. The solution? One undocumented parameter in the client.

Writing this down because:

1. I'll forget otherwise
2. You'll probably hit the same issue
3. The official docs won't help you

The fix exists. It's just hidden like some secret handshake.

## The fix

Here is the fix (for macOS and Linux):

Add/edit **~/.claude/settings.json** to have:

```json
{
  "apiKeyHelper": "~/.claude/anthropic_key.sh"
}
```

Add your key to **~/.claude/anthropic_key.sh**:

```bash
echo "sk-........."
```

```bash
chmod +x ~/.claude/anthropic_key.sh
```