DEV Community

dtzp555-max
dtzp555-max

Posted on

Run Claude Opus 4.6 as a Local OpenAI-Compatible API — for Free (with Max/Pro Subscription)

openclaw-claude-proxy (OCP)

Version

OpenAI-compatible local proxy for Claude CLI — use Opus 4.6 in Cursor, Cline, Open WebUI and more, with zero API cost.

What is it?

openclaw-claude-proxy (OCP) wraps the claude CLI in an OpenAI-compatible HTTP server. Any tool that speaks OpenAI API can talk to Claude — without paying per token.

Why it matters

Claude API OCP (this project)
Cost Pay per token $0 (included in Max/Pro)
Models All claude-opus-4-6, sonnet, haiku
OpenAI compatible Yes Yes
Multi-user No Yes — share one subscription
Setup API key npm install -g openclaw-claude-proxy

Quick Start

npm install -g openclaw-claude-proxy
ocp-server
Enter fullscreen mode Exit fullscreen mode

Then point any OpenAI client at http://localhost:9090.

Authentication

For shared/exposed deployments, set PROXY_API_KEY to require Bearer token auth:

PROXY_API_KEY=my-secret ocp-server
Enter fullscreen mode Exit fullscreen mode

Works with

  • Cursor — set base URL to http://localhost:9090, model to claude-opus-4-6
  • Cline (VS Code) — OpenAI provider, same base URL
  • Open WebUI — add as OpenAI connection
  • LangChain / LlamaIndex — set openai_api_base
  • Any OpenAI SDK — just change base_url

Honest tradeoffs

  • Uses CLI pool internally → requests execute sequentially per worker (not pure parallel)
  • Requires active Claude Max or Pro subscription on the machine
  • Pool workers restart on crash with backoff

Links

Give it a ⭐ if it saves you money!

Top comments (0)