Skip to content

Commit e7dd97d

Browse files
committed
docs: recommend API keys over OAuth tokens for automation
Update all examples and documentation to use ANTHROPIC_API_KEY as the primary authentication method. OAuth tokens are now documented as appropriate for personal testing and development only. - Update docker run examples across all READMEs - Add Terms Considerations section to environment-variables.md - Clarify auth guidance in main README's Important Considerations - Reorder env vars to list API key first in .env.example and docker-compose.yml
1 parent 39b3424 commit e7dd97d

File tree

10 files changed

+28
-22
lines changed

10 files changed

+28
-22
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
CLAUDE_CODE_GATEWAY_API_KEY=your-secret-api-key
77

88
# Claude authentication (one of these is required)
9-
# Option 1: OAuth token for Claude Max subscription
10-
CLAUDE_CODE_OAUTH_TOKEN=
11-
12-
# Option 2: Anthropic API key for direct API access
9+
# Recommended: Anthropic API key for automation
1310
ANTHROPIC_API_KEY=
1411

12+
# Alternative: OAuth token (Claude Pro/Max) - for personal testing and development only
13+
# CLAUDE_CODE_OAUTH_TOKEN=
14+
1515
# Gateway server port (optional, default: 3100)
1616
GATEWAY_PORT=3100

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Claude Code is that orchestration layer:
4949
# Start the gateway
5050
docker run -d -p 3100:3100 \
5151
-e CLAUDE_CODE_GATEWAY_API_KEY=your-gateway-key \
52-
-e CLAUDE_CODE_OAUTH_TOKEN=your-claude-token \
52+
-e ANTHROPIC_API_KEY=your-anthropic-api-key \
5353
ghcr.io/pattern-zones-co/koine:latest
5454

5555
# Make your first request
@@ -101,11 +101,10 @@ console.log(result.text);
101101
>
102102
> - **Use Docker**: containers provide essential filesystem and process isolation
103103
> - **Internal networks only**: deploy on VPN or Docker networks, not public internet
104-
> - **Know your auth method**:
105-
> - *API keys* (Anthropic API): pay-per-token, suitable for automation
106-
> - *OAuth tokens* (Claude Pro/Max): subscription plans may restrict commercial use and automation; review [Anthropic's Consumer Terms](https://www.anthropic.com/legal/consumer-terms)
104+
> - **Use API keys for automation**: Anthropic API keys are the recommended authentication method. They operate under the [Commercial Terms](https://www.anthropic.com/legal/commercial-terms) which permit programmatic access.
105+
> - **OAuth tokens for personal use only**: Claude Pro/Max OAuth tokens are appropriate for personal testing and development. For production or shared deployments, use an API key.
107106
>
108-
> **You are responsible for compliance with Anthropic's Terms of Service.**
107+
> See [Environment Variables](docs/environment-variables.md#terms-considerations) for details.
109108
110109
## Documentation
111110

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ services:
1414
HOME: /home/bun
1515
# Authentication for the gateway API
1616
CLAUDE_CODE_GATEWAY_API_KEY: ${CLAUDE_CODE_GATEWAY_API_KEY:-}
17-
# Claude auth: set CLAUDE_CODE_OAUTH_TOKEN for Max subscription, or ANTHROPIC_API_KEY for API auth
18-
# If both are set, OAuth token takes precedence (see cli.ts buildClaudeEnv)
19-
CLAUDE_CODE_OAUTH_TOKEN: ${CLAUDE_CODE_OAUTH_TOKEN:-}
17+
# Claude auth: ANTHROPIC_API_KEY recommended for automation (see docs/environment-variables.md)
18+
# OAuth tokens are appropriate for personal testing and development only
2019
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
20+
CLAUDE_CODE_OAUTH_TOKEN: ${CLAUDE_CODE_OAUTH_TOKEN:-}
2121
volumes:
2222
# Named volume for Claude CLI data
2323
- koine-data:/home/bun/.claude
2424
# WARNING: Bind-mounting ~/.claude is NOT SAFE for production.
2525
# It exposes credentials AND links all user-scoped Claude Code config
2626
# (slash commands, skills, MCP servers, etc.) which may be inappropriate.
2727
# Only use for local development/testing. For production:
28-
# - Set CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY in .env
28+
# - Set ANTHROPIC_API_KEY in .env (recommended for automation)
2929
# - Use project-scoped assets only (future: build-time asset mounting)
3030
# Security hardening
3131
security_opt:

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
```bash
1616
docker run -d -p 3100:3100 \
1717
-e CLAUDE_CODE_GATEWAY_API_KEY=your-key \
18-
-e CLAUDE_CODE_OAUTH_TOKEN=your-token \
18+
-e ANTHROPIC_API_KEY=your-anthropic-api-key \
1919
ghcr.io/pattern-zones-co/koine:latest
2020

2121
curl http://localhost:3100/health

docs/environment-variables.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
| Variable | Description |
1212
|----------|-------------|
13-
| `CLAUDE_CODE_OAUTH_TOKEN` | OAuth token (Claude Max). Takes precedence if both set. |
14-
| `ANTHROPIC_API_KEY` | Anthropic API key |
13+
| `ANTHROPIC_API_KEY` | Anthropic API key (recommended for automation) |
14+
| `CLAUDE_CODE_OAUTH_TOKEN` | OAuth token (Claude Pro/Max). See [Terms Considerations](#terms-considerations). |
1515

1616
## Optional
1717

@@ -25,6 +25,13 @@
2525
# .env
2626
CLAUDE_CODE_GATEWAY_API_KEY=your-secure-api-key
2727
ANTHROPIC_API_KEY=sk-ant-...
28-
# CLAUDE_CODE_OAUTH_TOKEN=your-oauth-token
2928
GATEWAY_PORT=3100
3029
```
30+
31+
## Terms Considerations
32+
33+
**API keys** are the recommended authentication method for Koine and automation use cases. They operate under [Anthropic's Commercial Terms](https://www.anthropic.com/legal/commercial-terms) which explicitly permit programmatic access.
34+
35+
**OAuth tokens** (Claude Pro/Max subscriptions) are appropriate for personal testing and development only. For production or shared deployments, use an API key.
36+
37+
If both are set, the OAuth token takes precedence. For automation, set only `ANTHROPIC_API_KEY`.

packages/gateway/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This package is not published to npm. Deploy via Docker (pre-built or from sourc
99
```bash
1010
docker run -d -p 3100:3100 \
1111
-e CLAUDE_CODE_GATEWAY_API_KEY=your-key \
12-
-e CLAUDE_CODE_OAUTH_TOKEN=your-token \
12+
-e ANTHROPIC_API_KEY=your-anthropic-api-key \
1313
ghcr.io/pattern-zones-co/koine:latest
1414
```
1515

packages/sdks/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Python SDK for [Koine](https://github.com/pattern-zones-co/koine) — the HTTP g
77
```bash
88
docker run -d -p 3100:3100 \
99
-e CLAUDE_CODE_GATEWAY_API_KEY=your-key \
10-
-e CLAUDE_CODE_OAUTH_TOKEN=your-token \
10+
-e ANTHROPIC_API_KEY=your-anthropic-api-key \
1111
ghcr.io/pattern-zones-co/koine:latest
1212
```
1313

packages/sdks/python/examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
```bash
77
docker run -d -p 3100:3100 \
88
-e CLAUDE_CODE_GATEWAY_API_KEY=your-key \
9-
-e CLAUDE_CODE_OAUTH_TOKEN=your-token \
9+
-e ANTHROPIC_API_KEY=your-anthropic-api-key \
1010
ghcr.io/pattern-zones-co/koine:latest
1111
```
1212

packages/sdks/typescript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TypeScript SDK for [Koine](https://github.com/pattern-zones-co/koine) — the HT
77
```bash
88
docker run -d -p 3100:3100 \
99
-e CLAUDE_CODE_GATEWAY_API_KEY=your-key \
10-
-e CLAUDE_CODE_OAUTH_TOKEN=your-token \
10+
-e ANTHROPIC_API_KEY=your-anthropic-api-key \
1111
ghcr.io/pattern-zones-co/koine:latest
1212
```
1313

packages/sdks/typescript/examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
```bash
77
docker run -d -p 3100:3100 \
88
-e CLAUDE_CODE_GATEWAY_API_KEY=your-key \
9-
-e CLAUDE_CODE_OAUTH_TOKEN=your-token \
9+
-e ANTHROPIC_API_KEY=your-anthropic-api-key \
1010
ghcr.io/pattern-zones-co/koine:latest
1111
```
1212

0 commit comments

Comments
 (0)