Zero-Key CLI OAuth
Authenticate Codex, Claude Code, Antigravity, Kimi, xAI, Meta, and Devin directly from your terminal, including headless --no-browser and device-code flows.
cli-proxy-api --claude-login --no-browser
One command line. Every frontier model.
A compiled Go command-line proxy server that turns your CLI OAuth subscriptions and API keys into unified OpenAI, Gemini, Claude, Codex, and Grok compatible local endpoints—with round-robin load balancing and a built-in terminal UI.
Point Claude Code, Codex CLI, OpenAI SDKs, or Gemini clients at localhost:8317. CLIProxyAPI normalizes reasoning budgets, translates wire protocols, and rotates accounts automatically.
+----------------------+ +---------------------------------------------------+ +---------------------------+
| CLIENTS & TOOLS | | cli-proxy-api (:8317) | | UPSTREAM PROVIDERS |
+----------------------+ +---------------------------------------------------+ +---------------------------+
| * Claude Code CLI | ===> | POST /v1/messages [Anthropic Protocol] | ===> | -> OpenAI / Codex OAuth |
| * OpenAI Codex CLI | ===> | POST /v1/responses [Responses + WS] | ===> | -> Anthropic Claude OAuth |
| * OpenAI / cURL SDKs | ===> | POST /v1/chat/completions [Chat Completions] | ===> | -> Gemini / Antigravity |
| * Gemini SDKs | ===> | POST /v1beta/interactions [Gemini Interactions] | ===> | -> Kimi / xAI / Meta |
+----------------------+ +---------------------------------------------------+ | -> Devin / OpenRouter |
| | | +---------------------------+
[auths/ OAuth Pool] [Round-Robin LB] [Thinking Pipeline]
Canonical Thinking Pipeline -> Protocol Translator -> Per-Provider Runtime Executor (Streaming SSE, Non-Streaming & WebSockets).
No bloated GUI wrappers required—just a single compiled Go binary designed for shells, SSH sessions, containers, and local workstations.
Authenticate Codex, Claude Code, Antigravity, Kimi, xAI, Meta, and Devin directly from your terminal, including headless --no-browser and device-code flows.
cli-proxy-api --claude-login --no-browser
Expose OpenAI (Chat & Responses), Anthropic Messages, and Gemini (including Interactions) endpoints with streaming SSE, WebSockets, tools, and vision.
/v1/chat/completions · /v1/responses · /v1/messages
Pool multiple CLI subscriptions and API keys per provider. Requests rotate across healthy credentials automatically to smooth out rate limits.
auths/codex-01.json + auths/codex-02.json
Launch an interactive full-screen terminal dashboard with --tui --standalone to inspect accounts, manage API keys, trigger OAuth, and tail live logs.
cli-proxy-api --tui --standalone
Run cli-proxy-api discover to scan _ai-gateway._tcp via DNS-SD on your local network, with clean --json output ready for shell pipelines.
cli-proxy-api discover --timeout 3 --json
Embed sdk/cliproxy directly into Go services, hot-reload YAML config, and persist credentials on disk, PostgreSQL, Git, or Object Storage.
import "github.com/router-for-me/CLIProxyAPI/v8/sdk/cliproxy"
Build from Go 1.26+ source or download a prebuilt binary, log in from your shell, and start serving requests locally.
Build the single Go binary and initialize config.yaml from the included template.
go build -o cli-proxy-api ./cmd/server && cp config.example.yaml config.yaml
Sign in with one flag—credentials are stored cleanly under auths/ for round-robin routing.
./cli-proxy-api --claude-login
Run headless in the background or open the built-in Bubbletea TUI console.
./cli-proxy-api --tui --standalone