Skip to content

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.

  • Node.js 20+ and the Claude Code CLI (authenticated)
  • An active Claude Max or Pro subscription

To get started, install the proxy globally using npm:

Terminal window
npm install -g claude-max-api-proxy

Next, verify that your Claude CLI is logged in and ready:

Terminal window
claude --version

Start the proxy server:

Terminal window
claude-max-api

The server runs at http://localhost:3456. You can check if it is working by running a health check:

Terminal window
curl http://localhost:3456/health

You can also test a chat completion directly:

Terminal window
curl http://localhost:3456/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'

The proxy maps OpenAI-style model IDs to Claude models:

Model IDMaps To
claude-opus-4Claude Opus 4
claude-sonnet-4Claude Sonnet 4
claude-haiku-4Claude Haiku 4

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" },
},
},
}

If you want the proxy to run automatically in the background, you can create a LaunchAgent:

Terminal window
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

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.

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.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.