docs/providers/claude-max-api-proxy.md
claude-max-api-proxy is a community tool that exposes your Claude Max/Pro subscription as an OpenAI-compatible API endpoint. This allows you to use your subscription with any tool that supports the OpenAI API format.
<Warning> This path is technical compatibility only. Anthropic has blocked some subscription usage outside Claude Code in the past. You must decide for yourself whether to use it and verify Anthropic's current billing rules before relying on it.Anthropic's current support docs say claude -p is Agent SDK/programmatic usage.
Starting June 15, 2026, subscription-plan claude -p usage draws from a separate
monthly Agent SDK credit first, then from usage credits at standard API rates if
usage credits are enabled.
</Warning>
| Approach | Cost route | Best for |
|---|---|---|
| Anthropic API | Pay per token through Claude Console or cloud | Production apps, shared automation, volume |
| Claude subscription proxy | Claude Code / claude -p plan and credit rules | Personal experiments with compatible tools |
If you have a Claude Max or Pro subscription and want to use it with OpenAI-compatible tools, this proxy may fit some personal workflows. It is not an unlimited flat-rate path. API keys remain the clearer policy and billing path for production use.
Your App → claude-max-api-proxy → Claude Code CLI / claude -p → Anthropic
(OpenAI format) (converts format) (uses your login)
The proxy:
http://localhost:3456/v1/chat/completions```bash
npm install -g claude-max-api-proxy
# Verify Claude CLI is authenticated
claude --version
```
# List models
curl http://localhost:3456/v1/models
# Chat completion
curl http://localhost:3456/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'
```
```json5
{
env: {
OPENAI_API_KEY: "not-needed",
OPENAI_BASE_URL: "http://localhost:3456/v1",
},
agents: {
defaults: {
model: { primary: "openai/claude-opus-4" },
},
},
}
```
| Model ID | Maps To |
|---|---|
claude-opus-4 | Claude Opus 4 |
claude-sonnet-4 | Claude Sonnet 4 |
claude-haiku-4 | Claude Haiku 4 |
- Native OpenAI-only request shaping does not apply
- No `service_tier`, no Responses `store`, no prompt-cache hints, and no
OpenAI reasoning-compat payload shaping
- Hidden OpenClaw attribution headers (`originator`, `version`, `User-Agent`)
are not injected on the proxy URL
```bash
cat > ~/Library/LaunchAgents/com.claude-max-api.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.claude-max-api</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/node</string>
<string>/usr/local/lib/node_modules/claude-max-api-proxy/dist/server/standalone.js</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/opt/homebrew/bin:~/.local/bin:/usr/bin:/bin</string>
</dict>
</dict>
</plist>
EOF
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.claude-max-api.plist
```
claude -p billing, usage-credit, and rate-limit behavior