Files
openclaw/docs/claude-max-proxy-setup-2026-02-17.md
Clawd Bot ca9b510922 chore: align with upstream openclaw/openclaw and overlay local additions
- Reset master to upstream/main (16,697 commits)
- Overlay 2,271 local-only files (skills, tools, workspace, configs, apps)
- Restore IDENTITY.md and USER.md templates
- Build verified, gateway running, Discord working

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 07:40:46 +01:00

4.0 KiB

Claude Max API Proxy Setup - 2026-02-17

COMPLETE - Using Claude Max Subscription via API

What Was Done

  1. Installed Claude Code CLI (@anthropic-ai/claude-code)

    • Version: 2.1.44
    • Location: /home/alex/.local/bin/claude
    • Authenticated with Claude Max subscription
  2. Installed Claude Max API Proxy

  3. Configured OpenClaw

    • Set environment: ANTHROPIC_BASE_URL=http://localhost:3456/v1
    • Gateway restarted to use proxy
    • Model: anthropic/claude-sonnet-4-5

How It Works

OpenClaw
    ↓
ANTHROPIC_BASE_URL=http://localhost:3456/v1
    ↓
Claude Max API Proxy (localhost:3456)
    ↓
Claude Code CLI (subprocess)
    ↓
OAuth Token (Claude Max subscription)
    ↓
Anthropic API
    ↓
Response → OpenClaw

Authentication

  • Subscription: Claude Max ($200/month = ~€90/month)
  • Email: alexpolo2850@gmail.com
  • Subscription Type: max
  • Org ID: 07046f2b-c5d3-4943-808a-fe9ec7ff304e

Available Models (via Proxy)

Model ID Maps To
claude-opus-4 Claude Opus 4.5
claude-sonnet-4 Claude Sonnet 4
claude-haiku-4 Claude Haiku 4

Cost Savings

Period Before (API) After (Proxy) Savings
Per day ~$60 €0 ~$60/day
Per month ~$1,800 €0 ~$1,800/month
Annual ~$21,600 €0 ~$21,600/year

Note: €0 means included in €90/month Claude Max subscription (no additional API charges).

Management

Check proxy status:

tmux attach -t claude-proxy  # View logs
curl http://localhost:3456/health  # Health check

Restart proxy:

tmux kill-session -t claude-proxy
tmux new-session -d -s claude-proxy "cd /opt/claude-max-api-proxy && node dist/server/standalone.js"

Check OpenClaw config:

env | grep ANTHROPIC_BASE_URL
openclaw status

Testing

Test proxy directly:

curl -X POST http://localhost:3456/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_tokens": 50
  }'

Expected response: JSON with Claude's response, charged to Max subscription.

Troubleshooting

Proxy not responding:

tmux attach -t claude-proxy  # Check logs
tmux kill-session -t claude-proxy  # Restart
tmux new-session -d -s claude-proxy "cd /opt/claude-max-api-proxy && node dist/server/standalone.js"

Authentication expired:

claude auth login
# Re-enter credentials

OpenClaw using wrong endpoint:

env | grep ANTHROPIC_BASE_URL  # Should show http://localhost:3456/v1
openclaw gateway restart

Final Configuration

OpenClaw:

  • Model: anthropic/claude-sonnet-4-5
  • Provider: Claude Max (via proxy)
  • API endpoint: http://localhost:3456/v1
  • Authentication: OAuth (Claude Max)

Total Monthly AI Cost:

  • Claude Max: €90
  • API charges: €0
  • GitHub Copilot: $20
  • ChatGPT Pro: $20
  • Total: ~€130 (was ~€1,700+ before!)

Next Steps (Optional)

  1. Make proxy permanent:

    • Create proper systemd service with correct PATH
    • Auto-start on boot
  2. Monitor usage:

    • Check Claude Max usage dashboard
    • Verify no API charges appearing
  3. Consider dropping other subscriptions:

    • GitHub Copilot: $20/month (if not using other features)
    • ChatGPT Pro: $20/month (if not using web interface)

SUCCESS

Before: $60/day API charges + €90 subscription = ~€1,700/month
After: €0 API charges + €90 subscription = ~€90/month
Savings: €1,610/month ($1,800/month)

All future OpenClaw API calls now use Claude Max subscription with zero additional cost! 🎉