Claude Code, powered by OpenAI Codex, Kimi, Grok, OpenCode Go, or Cursor Agent.
Docs: https://claude-code-proxy.raine.dev
LLM docs: https://claude-code-proxy.raine.dev/llms.txt
Tip
I'm building aven, a local-first task manager for power users and agents.
Claude Code remains an excellent coding harness, with strong tools, skills, hooks, subagents, and editor integrations. claude-code-proxy keeps that client experience while translating its Anthropic API traffic for subscription-backed provider services.
One local process handles provider authentication, model-based routing, protocol translation, streaming responses, and diagnostics. The built-in monitor shows sessions, active and recent requests, errors, token usage, and throughput.
Install on macOS or Linux:
brew install raine/claude-code-proxy/claude-code-proxyOr use the release installer:
curl -fsSL https://raw.githubusercontent.com/raine/claude-code-proxy/main/scripts/install.sh | bashWindows and other prebuilt artifacts are available from GitHub Releases.
Sign in with the Codex CLI using a ChatGPT Plus or Pro account, not an
OpenAI API account. The proxy reads the credentials the Codex CLI stores in
~/.codex/auth.json and has no Codex login of its own:
codex loginStart the proxy in one terminal:
claude-code-proxy serveFor a background service, use claude-code-proxy serve --no-monitor and attach
from another terminal with claude-code-proxy monitor. Closing an attached
dashboard leaves the proxy running.
Start Claude Code in another:
ANTHROPIC_BASE_URL=http://127.0.0.1:18765 \
ANTHROPIC_AUTH_TOKEN=unused \
ANTHROPIC_MODEL=gpt-6-sol[1m] \
ANTHROPIC_SMALL_FAST_MODEL=gpt-6-luna[1m] \
CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000 \
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 \
claudeSee Getting started for the complete first session.
Optional Codex image generation and editing can reuse the same ChatGPT login:
CCP_CODEX_IMAGES_API=1 claude-code-proxy serve
curl http://127.0.0.1:18765/v1/images/generations \
-H 'Content-Type: application/json' \
-d '{"prompt":"A paper-cut fox","model":"gpt-image-2"}'The opt-in Images API returns base64 image data and consumes the signed-in account's image quota. Image prompts and payloads are excluded from traffic captures. See the HTTP API for generation and edit schemas.
claude-* models and the opus, sonnet, and haiku aliases are relayed to
api.anthropic.com byte for byte with Claude Code's own subscription login, so
no Anthropic API key is needed. gpt-* models go to Codex through the ChatGPT
login above. Both run in the same session and can be switched mid-conversation
with /model; reasoning from the previous backend is carried across the switch
as tagged text.
Leave ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY unset. Claude Code forwards
its subscription login only when no explicit token is present; setting either
one sends that value instead and the Claude route returns 401.
ANTHROPIC_BASE_URL=http://127.0.0.1:18765 \
ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-8 \
ANTHROPIC_DEFAULT_SONNET_MODEL=gpt-6-astra \
claude/model opus then uses the Claude subscription and /model gpt-6-astra uses
the ChatGPT subscription. CCP_ANTHROPIC_BASE_URL overrides the Anthropic
upstream. Codex credentials are read from ~/.codex/auth.json; CODEX_HOME or
CCP_CODEX_AUTH_FILE points the proxy at another file, and refreshed tokens are
written back so the Codex CLI keeps working.
Claude Code turns on its /effort menu by matching the model id against its own
patterns, so a gpt-* id gets no effort menu until its capabilities are declared
as a custom picker entry:
export ANTHROPIC_CUSTOM_MODEL_OPTION="gpt-6-astra"
export ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES="effort,xhigh_effort,max_effort"| Provider | Account | Model selection |
|---|---|---|
| Claude | Claude subscription (Claude Code's own login) | claude-* models and the opus, sonnet, haiku aliases |
| Codex | ChatGPT Plus or Pro | Registered gpt-* models and -fast variants |
| Kimi | kimi.com with Kimi Code access | kimi-for-coding and aliases |
| Grok | grok.com | Registered Grok models |
| OpenCode Go | OpenCode Go subscription | Non-conflicting IDs and opencode-go/<model-id> |
| Cursor Agent | Cursor account | Cursor aliases and cursor:<model-id> prefixes |
Run claude-code-proxy models for the current catalog or
claude-code-proxy models --full for every dynamic Cursor alias.
Warning
The proxy accepts local requests without client authentication. It binds to
127.0.0.1 by default. Protect any non-loopback listener with a firewall or
authenticating reverse proxy. Provider subscriptions, model access, terms,
and account enforcement remain under each provider's control. Unofficial
clients may carry account risk.
- What is claude-code-proxy?
- Choosing a provider
- Configure Claude Code
- Models and routing
- Monitor TUI
- Troubleshooting
- Command reference
- Configuration
- HTTP API
- Compatibility and limitations
- For coding agents
- aven: local-first task management for power users and agents
- claude-history: search Claude Code conversation history from the terminal
- git-surgeon: non-interactive hunk-level git staging for coding agents
- workmux: parallel coding tasks in git worktrees and tmux
- consult-llm: consult other AI models from an agent workflow
