Skip to content

Claude Max API proxy

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.

ApproachCostBest For
Anthropic APIPay per token (~$15/M input, $75/M output for Opus)Production apps, high volume
Claude Max subscription$200/month flatPersonal use, development, unlimited usage

If you have a Claude Max subscription and want to use it with OpenAI-compatible tools, this proxy may reduce cost for some workflows. API keys remain the clearer policy path for production use.

Your App → claude-max-api-proxy → Claude Code CLI → Anthropic (via subscription)
(OpenAI format) (converts format) (uses your login)

The proxy:

  1. Accepts OpenAI-format requests at http://localhost:3456/v1/chat/completions
  2. Converts them to Claude Code CLI commands
  3. Returns responses in OpenAI format (streaming supported)
  1. Install the proxy

    Requires Node.js 20+ and Claude Code CLI.

    Terminal window
    npm install -g claude-max-api-proxy
    # Verify Claude CLI is authenticated
    claude --version
  2. Start the server

    Terminal window
    claude-max-api
    # Server runs at http://localhost:3456
  3. Test the proxy

    Terminal window
    # Health check
    curl http://localhost:3456/health
    # 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!"}]
    }'
  4. Configure OpenClaw

    Point OpenClaw at the proxy as a custom OpenAI-compatible endpoint:

    {
    env: {
    OPENAI_API_KEY: "not-needed",
    OPENAI_BASE_URL: "http://localhost:3456/v1",
    },
    agents: {
    defaults: {
    model: { primary: "openai/claude-opus-4" },
    },
    },
    }
Model IDMaps To
claude-opus-4Claude Opus 4
claude-sonnet-4Claude Sonnet 4
claude-haiku-4Claude Haiku 4
Proxy-style OpenAI-compatible notes

This path uses the same proxy-style OpenAI-compatible route as other custom /v1 backends:

  • 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
Auto-start on macOS with LaunchAgent

Create a LaunchAgent to run the proxy automatically:

Terminal window
cat > ~/Library/LaunchAgents/com.claude-max-api.plist << 'EOF'

Label

com.claude-max-api

RunAtLoad

KeepAlive

ProgramArguments

/usr/local/bin/node

/usr/local/lib/node_modules/claude-max-api-proxy/dist/server/standalone.js

EnvironmentVariables

PATH

/usr/local/bin:/opt/homebrew/bin:~/.local/bin:/usr/bin:/bin

EOF

launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.claude-max-api.plist

  • This is a community tool, not officially supported by Anthropic or OpenClaw
  • Requires an active Claude Max/Pro subscription with Claude Code CLI authenticated
  • The proxy runs locally and does not send data to any third-party servers
  • Streaming responses are fully supported
Anthropic provider

Native OpenClaw integration with Claude CLI or API keys.

OpenAI provider

For OpenAI/Codex subscriptions.

Model selection

Overview of all providers, model refs, and failover behavior.

Configuration

Full config reference.