claude-code-proxy is a local Anthropic-compatible proxy that lets Claude Code run against backends it normally couldn’t — for instance, using a ChatGPT or Kimi subscription you already pay for. Claude Code points at the local proxy, the proxy translates and forwards the requests, and you keep the Claude Code experience while the model underneath changes.
This is the WSL setup, which is the cleanest way to run a local proxy on Windows. For the routing-focused alternative, see Claude Code Router setup.
How it works
Claude Code speaks the Anthropic format. claude-code-proxy runs a small server locally that accepts that format and forwards to your chosen backend, handling any translation. You set ANTHROPIC_BASE_URL to the local proxy address, and Claude Code is none the wiser.
Step 1: WSL and prerequisites
If WSL isn’t installed, start with the WSL install guide. Install whatever runtime the proxy needs (Node or similar) inside WSL per the repo.
Step 2: Install the proxy
Clone and set up claude-code-proxy following its README. It’s a local server, so you’ll start it and leave it running while you use Claude Code.
# illustrative — follow the repo's exact commands
git clone https://github.com/raine/claude-code-proxy
cd claude-code-proxy
# install deps and configure your backend per the README
Step 3: Configure the backend and point Claude Code at it
Configure the proxy with your backend credentials (the subscription or API key the README describes). Then point Claude Code at the local proxy:
export ANTHROPIC_BASE_URL="http://127.0.0.1:PORT"
export ANTHROPIC_AUTH_TOKEN="any-value-the-proxy-accepts"
claude
Use the port the proxy prints. Claude Code now routes through it.
claude-code-proxy vs Claude Code Router
Which local proxy
| claude-code-proxy | Back Claude Code with a specific subscription/provider |
|---|---|
| Claude Code Router | Multi-provider routing; per-task model selection |
Both are local proxies that free Claude Code from Anthropic-only backends. Choose claude-code-proxy when its supported backends match what you want (e.g. an existing subscription); choose Claude Code Router when you want to route different task types to different models. For straightforward Anthropic-compatible providers like DeepSeek, you may not need either — see anthropic-compatible endpoints.
Troubleshooting
- Claude Code can’t connect — the proxy isn’t running, or the port in
ANTHROPIC_BASE_URLis wrong. - Auth errors to the backend — backend credentials in the proxy config are missing or invalid.
- Format errors — the proxy version may lag a Claude Code update; check the repo’s issues.
- Works then stops — your backend subscription hit a limit; check its dashboard.
claude-code-proxy checklist
- WSL ready; proxy runtime installed
- claude-code-proxy installed per its README
- Backend credentials configured in the proxy
- Proxy running; ANTHROPIC_BASE_URL pointed at it
- Tested Claude Code on a small task
Wrapping up
claude-code-proxy backs Claude Code with a local Anthropic-compatible proxy, letting you run it against subscriptions or providers it couldn’t reach directly. On Windows, WSL is the clean place to run that local server: install it, configure the backend, point ANTHROPIC_BASE_URL at the local port, and Claude Code works as usual. Keep it bound to localhost and treat it as the community project it is.
For alternatives, see Claude Code Router, deepclaude, and claude-code-mux.