Multi-provider LLM gateway for CLI coding agents via CLIProxyAPI
From README links · today
One OpenAI-compatible endpoint fronting many CLI model accounts.
What they did
They wanted their existing coding agents and scripts to stop caring which vendor account a model lived behind. Instead of rewriting each tool to speak Kimi, Codex, Gemini CLI, Antigravity, Grok, Meta Muse, or Devin auth, they stood up CLIProxyAPI as a local proxy server. They logged into each provider once — OAuth flows for the CLI-style accounts (including the Devin login path) and API keys for the platform accounts — and let the proxy expose everything behind OpenAI-compatible (including Responses), Gemini-compatible, and Claude-compatible interfaces. Their own clients, SDKs, and agent harnesses then pointed at the local base URL with a single proxy-issued key, and model selection became a string in the request rather than a separate integration. They used the desktop EasyCLIProxyAPI client for the graphical config UI, tray controls, and start/stop, keeping the service running in the background on their workstation.
How it went
Works well as a personal aggregation layer: one base URL, one key, and any OpenAI/Gemini/Claude-compatible client can hit whichever upstream account is configured. Model availability varies by channel, so the practical result is a stable local endpoint with a shifting catalogue behind it. Polish is good for a self-hosted tool, with a desktop wrapper for people who do not want to hand-edit config.
Worth knowing
You are relying on CLI account terms and quotas, and availability differs per provider and per channel (Gemini especially). OAuth sessions expire and need re-login. Running a local proxy that holds multiple credentials means the config file and port need to stay private. The README is sponsor-heavy and model names change often, so verify current model IDs against each provider.
Wiring
Run the proxy process locally (binary or desktop client) and bind it to localhost. Authenticate providers one at a time: OAuth-based CLI accounts through the proxy's login flow, API-key providers by adding keys to the proxy config. The proxy then exposes OpenAI-compatible (including Responses), Gemini-compatible, and Claude-compatible routes on the same host. Point each client or SDK at that base URL and supply the proxy key instead of vendor keys; select the upstream by model name. Keep the config file out of version control, and restart or reload after adding accounts.
Try it yourself
Set up CLIProxyAPI in this repo's dev environment as a local model gateway. Steps: 1) install or run the proxy (or the EasyCLIProxyAPI desktop client) and note the local base URL and port; 2) add one provider login via OAuth and one via API key, keeping secrets in an env file that is gitignored; 3) write a small smoke-test script that calls the proxy's OpenAI-compatible endpoint with two different model IDs and prints the responses; 4) add a README section documenting the base URL, key env var, and how to add another provider. Do not commit any credentials.
Tools in this stack
Run this stack
Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.
npx runchr install runchr/stack-cliproxyapi-and-hermes-agentcurl -s https://api.runchr.com/api/recipes/runchr/stack-cliproxyapi-and-hermes-agent/manifestSystem prompt
You are a setup assistant for a local CLIProxyAPI gateway that fronts multiple CLI model accounts behind one OpenAI-compatible endpoint. Keep every credential in a gitignored env file, bind the proxy to localhost, and never commit or print secrets.
This system prompt was generated from this stack's copy and tools. A person has not reviewed it.
The manifest is also at api.runchr.com/api/recipes/runchr/stack-cliproxyapi-and-hermes-agent/manifest.