[UNTESTED] [buddy-pieron/claude-code-proxy] 2 endpoint(s)
ChatGPT
API Proxy/ChatGPT
2,173 characters
Status: [UNTESTED]
Endpoints found:
http://localhost:8070/v1/chat/completions
http://localhost:8070/v1/messages
Source: https://github.com/buddy-pieron/claude-code-proxy
# Claude Code Proxy
Turn your Claude Code subscription into a local OpenAI-compatible API.
Every request routes through the `claude` CLI binary on your machine, billing against your existing Claude Code subscription ($20/mo Pro or $100/mo Max) instead of per-token API pricing. Use Claude from any tool that speaks the OpenAI or Anthropic API format: Cursor, Continue, Open WebUI, LiteLLM, custom apps, etc.
## How It Works
```
Your App --> Claude Code Proxy --> claude CLI binary --> Anthropic
(OpenAI format) (localhost:8070) (your subscription) (no extra cost)
```
The proxy spawns the `claude` CLI in print mode for each request, translates between OpenAI/Anthropic message formats and the CLI's stream-json output, and returns standard SSE streaming or JSON responses. Your app thinks it's talking to an OpenAI-compatible API. The CLI thinks it's running a normal session. Anthropic bills it against your subscription.
## Prerequisites
- **Python 3.10+**
- **Claude Code CLI** installed and authenticated
- **Active Claude Code subscription** (Pro or Max)
### Installing Claude Code CLI
```bash
npm install -g @anthropic-ai/claude-code
```
Then authenticate:
```bash
claude
# Follow the OAuth flow in your browser
```
Verify it works:
```bash
claude --print "Hello"
```
## Installation
### Option 1: Clone and run
```bash
git clone https://github.com/legitlabs/claude-code-proxy.git
cd claude-code-proxy
pip install -r requirements.txt
python server.py
```
### Option 2: pip install
```bash
pip install git+https://github.com/legitlabs/claude-code-proxy.git
claude-code-proxy
```
### Option 3: Docker
```bash
docker build -t claude-code-proxy .
docker run -p 8070:8070 \
-v ~/.claude:/root/.claude \
claude-code-proxy
```
> **Note:** Mount your `~/.claude` directory so the container can access your CLI credentials.
## Configuration
All configuration is via environment variables:
| Variable | Default | Description |
|---|---|---|
| `CLAUDE_PROXY_H