Use your Claude, Gemini, or ChatGPT subscription from any OpenAI-compatible tool — no API keys needed.
Wraps the official Claude Code, Gemini CLI, and Codex CLIs and exposes a local OpenAI-compatible HTTP API. Point any tool that supports OPENAI_BASE_URL or ANTHROPIC_BASE_URL at it and your subscription handles the billing.
npx llm-cli-proxy --provider claude --port 3456Node.js 20+ and at least one CLI installed and authenticated:
| Provider | Subscription | Install | Authenticate |
|---|---|---|---|
| Claude | Claude Pro or Max | npm install -g @anthropic-ai/claude-code |
Run claude and sign in |
| Gemini | Gemini Advanced (Google One AI Premium) | npm install -g @google/gemini-cli |
Run gemini and sign in |
| Codex | ChatGPT Plus, Pro, or Team | npm install -g @openai/codex |
Run codex and sign in |
npm install -g llm-cli-proxyOr use without installing:
npx llm-cli-proxy --provider claudeStart one instance per provider you want to use:
llm-cli-proxy --provider claude # listens on port 3456
llm-cli-proxy --provider gemini # listens on port 3457
llm-cli-proxy --provider codex # listens on port 3458Then point your tool at the local URL:
# For tools using the Anthropic SDK
export ANTHROPIC_BASE_URL=http://localhost:3456/v1
# For tools using the Google Gemini SDK
export GOOGLE_GEMINI_BASE_URL=http://localhost:3457/v1
# For tools using the OpenAI SDK
export OPENAI_BASE_URL=http://localhost:3458/v1Some SDKs will refuse to initialize without an API key env var set. If you hit that, set it to any non-empty string — the proxy ignores it.
llm-cli-proxy --provider <claude|gemini|codex> [options]
--provider, -p <name> Provider: claude, gemini, or codex (required)
--port <port> HTTP port (default: 3456/claude, 3457/gemini, 3458/codex)
--workspace, -w <dir> Working directory for the CLI (default: current directory)
--model, -m <model> Model override
--version, -V Show version
--help, -h Show help
# Non-streaming
curl http://localhost:3456/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Hello"}]}'
# Streaming
curl http://localhost:3456/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Hello"}],"stream":true}'Returns available models for the running provider.
{
"status": "ok",
"provider": "Claude Code",
"session_active": true,
"model": "claude-sonnet-4-6",
"workspace": "/your/project"
}| Provider | Default | Available |
|---|---|---|
| Claude | claude-sonnet-4-6 |
claude-sonnet-4-6, claude-opus-4-6 |
| Gemini | gemini-2.5-flash |
gemini-2.5-flash, gemini-2.5-pro |
| Codex | codex-mini-latest |
codex-mini-latest |
- Claude & Gemini — spawns the official CLI per request using
--resumeto maintain conversation context. The CLI handles authentication automatically. - Codex — calls the Codex API endpoint directly using the OAuth token stored by the Codex CLI. This avoids a known bug in
exec resumethat causes the system prompt to be re-injected on every turn, multiplying token usage.
MIT