How to Use Your Claude Max Subscription as an OpenAI-Compatible API
I often feel frustrated when I pay for a monthly AI subscription but still get billed for every token I use in my local development tools. It feels like I am paying twice for the same intelligence.
If you have a Claude Max subscription, I recommend using claude-max-api-proxy. This tool turns your subscription into an OpenAI-compatible endpoint, which lets you use your account with tools that usually require expensive API keys. Since Claude Max costs a flat $200 per month, this setup is a great way to handle personal use and development without worrying about token costs.
What You’ll Need
Section titled “What You’ll Need”- Node.js 20+ and the Claude Code CLI (authenticated)
- An active Claude Max or Pro subscription
Quick Start
Section titled “Quick Start”To get started, install the proxy globally using npm:
npm install -g claude-max-api-proxyNext, verify that your Claude CLI is logged in and ready:
claude --versionStart the proxy server:
claude-max-apiThe server runs at http://localhost:3456. You can check if it is working by running a health check:
curl http://localhost:3456/healthYou can also test a chat completion directly:
curl http://localhost:3456/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "claude-opus-4", "messages": [{"role": "user", "content": "Hello!"}] }'Available Models
Section titled “Available Models”The proxy maps OpenAI-style model IDs to Claude models:
| Model ID | Maps To |
|---|---|
claude-opus-4 | Claude Opus 4 |
claude-sonnet-4 | Claude Sonnet 4 |
claude-haiku-4 | Claude Haiku 4 |
Using with OpenClaw
Section titled “Using with OpenClaw”You can point OpenClaw at your local proxy by using this configuration:
{ env: { OPENAI_API_KEY: "not-needed", OPENAI_BASE_URL: "http://localhost:3456/v1", }, agents: { defaults: { model: { primary: "openai/claude-opus-4" }, }, },}Auto-Start on macOS
Section titled “Auto-Start on macOS”If you want the proxy to run automatically in the background, you can create a LaunchAgent:
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.plistTroubleshooting
Section titled “Troubleshooting”Proxy fails to return responses
Section titled “Proxy fails to return responses”The proxy requires an active Claude Max or Pro subscription. If you encounter errors, make sure your Claude Code CLI is authenticated. You can run claude --version to check your status.
Community Support
Section titled “Community Support”This is a community tool and is not officially supported by Anthropic or OpenClaw. It runs locally and does not send your data to third-party servers.
Need more help with your setup? Ask the AI Setup Assistant.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.