router-for-me/CLIProxyAPI

Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini Series, GPT Series, Grok Series, Claude model through API

What is CLI Proxy API?

CLI Proxy API is a self‑hosted proxy server that lets you talk to many large‑language‑model providers (OpenAI, Google Gemini, Anthropic Claude, xAI Grok, Meta Muse, Kimi, etc.) using the same OpenAI‑compatible HTTP endpoints that command‑line tools and SDKs expect. In other words, you point your usual openai‑style client at the proxy, and the proxy forwards the request to the real provider you’ve configured, handling authentication, load‑balancing across multiple accounts, and translating any provider‑specific quirks.

The project also ships a Go SDK so other programs can embed the proxy logic directly, and a set of optional management consoles (CPA‑Manager‑Plus, Oh‑My‑CPA, etc.) for monitoring usage, costs, and account health.


Who might need it?

  • Developers with multiple AI subscriptions – if you have a ChatGPT‑plus account, a Gemini Pro key, a Claude Code subscription, etc., you can configure the proxy to rotate among them automatically, avoiding rate limits and getting the cheapest model for each request.
  • Tool authors – any CLI or IDE plugin that expects an OpenAI‑style endpoint can work with any supported model without code changes.
  • Teams that want local control – the proxy runs on your own machine (or server), so you keep API keys in‑house and can add custom logging, caching, or cost‑tracking.

Core features (as described in the README)

Feature What it does
Multi‑provider compatibility Exposes OpenAI‑, Gemini‑, Claude‑, Grok‑compatible APIs for a long list of models (Kimi K3, OpenAI GPT‑6 series, Claude Fable/Opus/Sonnet/Haiku, Gemini 4 Argon, Grok 4.7, Meta Muse, etc.).
OAuth login for each provider Simple CLI commands (--gemini-login, --openai-login, …) let you add accounts without manually handling tokens.
Round‑robin load balancing When you have several accounts for the same provider, the proxy can distribute requests evenly, improving reliability and throughput.
Streaming & WebSocket support Pass‑through of streaming completions and WebSocket‑based chat when the upstream model offers it.
Function calling / tool use The proxy forwards function‑call payloads so tools built on the OpenAI spec keep working.
Multimodal input Accepts both text and image data (where the upstream model supports vision).
Generative‑Language API‑key mode You can use a single “proxy key” for your own applications; the proxy injects the real provider keys behind the scenes.
Configurable upstream providers Besides the built‑in list, you can point the proxy at any OpenAI‑compatible service (e.g., OpenRouter).
Reusable Go SDK A library (docs/sdk-*.md) for embedding the proxy logic in other Go programs.
Management & observability Optional dashboards (CPA‑Usage‑Keeper, CPA‑Manager‑Plus, Oh‑My‑CPA) give you request logs, token counts, latency, and cost breakdowns, stored in SQLite.

How to get started

  1. Run the proxy – clone the repo and start the binary (or use the Docker image). The README points to a web‑based guide at https://help.router-for.me/ for detailed steps.
  2. Add provider accounts – use the CLI flags (--openai-login, --gemini-login, etc.) or edit the config file to supply API keys/OAuth tokens.
  3. Point your tools – change the endpoint URL in any OpenAI‑compatible client to http://localhost:PORT/v1 (or the port you chose).
  4. Optional UI – install the companion desktop client EasyCLIProxyAPI for a system‑tray UI, one‑click start/stop, and automatic updates.

Ecosystem & related projects

Several third‑party tools already build on CLI Proxy API:

  • vibeproxy – macOS menu‑bar app that lets you use Claude Code and ChatGPT without exposing API keys.
  • Subtitle Translator – desktop/web app that translates SRT files using any of your LLM subscriptions via the proxy.
  • CCS (Claude Code Switch) – CLI wrapper for instant switching between multiple Claude accounts.
  • Quotio – macOS menu‑bar app that aggregates quotas and does smart fail‑over across providers.

Who maintains it?

The repository is owned by the router‑for‑me organization. Sponsorship links to various AI‑relay services (PackyCode, AICodeMirror, etc.) are included, but the core proxy code is open‑source and accepts community contributions via pull requests.


TL;DR

CLI Proxy API is a locally run proxy that makes any OpenAI‑style client work with dozens of LLM providers, handling auth, multi‑account load‑balancing, and optional usage dashboards. It’s useful for developers who juggle several AI subscriptions or want a single, controllable endpoint for their tools.

Related

  • Project
  • Project
  • Project
  • Project
  • Project