| name | use-cliproxy |
| display_name | Use CLIProxyAPI |
| description | Route RAW model calls (no agent harness) to subscription tokens via the local CLIProxyAPI server, which re-exposes Codex/Claude/Gemini/Grok/Antigravity CLI logins as OpenAI- and Anthropic-compatible HTTP endpoints. Use for bulk generation / classification / extraction where you need model output, not file-editing tools. For agentic implementation work, use the agent CLIs (use-codex etc.) instead — see the decision rule below. |
CLIProxyAPI Subagent Skill
CLIProxyAPI (cliproxy) is a local server that reuses your CLI subscription OAuth logins (Codex, Claude, Gemini, Grok, Antigravity, Kimi) and re-exposes them as OpenAI- and Anthropic-compatible HTTP endpoints. It strips the agent harness — so a call sends only your prompt, none of the 15–23k tokens of system-prompt + tool-definition boilerplate an agent CLI prepends per invocation.
When to use this vs. the agent CLIs — THE decision rule
| Task shape | Use | Why |
|---|
| Agentic / implementation — edit files, run bash, hold repo context, multi-step build, "go implement X" | agent CLI (use-codex / use-grok / use-cursor / use-agy / use-droid) | The harness (file/bash/tool loop) is the entire value. A raw endpoint can only return text. |
| Bulk raw generation — draft/rewrite/summarize/classify/extract N items, LLM-as-judge, embeddings-style fan-out | CLIProxyAPI | No tools needed. Measured: agent CLIs spend ~5–7× the input tokens on harness boilerplate for pure-generation calls (cursor ~23k, droid ~15k overhead PER fresh spawn). The proxy sends only your payload. |
| One-off question / second opinion | either; agent CLI is fine | Overhead is negligible at N=1. |
Rule of thumb: if the task needs tools, use an agent CLI; if it's just model-in/text-out at volume, use the proxy. Measured basis: docs/x-outreach-design-style bulk drafting was ~85% harness tokens per batch through cursor-agent; the proxy eliminates that.
Setup
Build from source (Go 1.24+) or use the Docker image from CLIProxyAPI:
git clone --depth 1 https://github.com/router-for-me/CLIProxyAPI && cd CLIProxyAPI
go build -o ~/.local/bin/cliproxy ./cmd/server
mkdir -p ~/.cliproxy/auths
Write ~/.cliproxy/config.yaml (localhost-only recommended):
host: "127.0.0.1"
port: 8317
auth-dir: "~/.cliproxy/auths"
api-keys:
- "sk-local-<generate-your-own>"
remote-management:
allow-remote: false
secret-key: "<generate-your-own>"
Auth (user runs these — interactive OAuth, browser)
Each provider is a separate login; tokens land in ~/.cliproxy/auths/ and auto-refresh:
cliproxy --config ~/.cliproxy/config.yaml --codex-login
cliproxy --config ~/.cliproxy/config.yaml --claude-login
cliproxy --config ~/.cliproxy/config.yaml --antigravity-login
cliproxy --config ~/.cliproxy/config.yaml --xai-login
cliproxy --config ~/.cliproxy/config.yaml --kimi-login
Run the server
cliproxy --config ~/.cliproxy/config.yaml
Verify: curl -s -H "Authorization: Bearer $KEY" http://127.0.0.1:8317/v1/models → 200 with a model list (401 without the key confirms auth is enforced).
Call it
OpenAI-compatible:
curl -s http://127.0.0.1:8317/v1/chat/completions \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-terra","messages":[{"role":"user","content":"..."}]}'
Anthropic-compatible endpoint (/v1/messages) is also exposed — point the Anthropic SDK's base_url at http://127.0.0.1:8317 with the local key. Model ids are whatever the logged-in providers expose (GET /v1/models to enumerate). Notable Claude ids on a Claude subscription login (verified 2026-07-24): claude-opus-5 (newest Opus — prefer it for the hardest raw-generation/LLM-judge calls), plus claude-fable-5, claude-opus-4-8, claude-sonnet-5, claude-haiku-4-5-20251001. The proxy is currently the only raw-endpoint route to Opus 5; among agent CLIs only Claude Code and cursor carry it (see ../cli-model-overlap.md). For bulk jobs, drive it with a small concurrency-pooled script (concurrency-pooled fetch loop pointed at the proxy base_url) rather than one request at a time.
Verification / caveats
- It's raw model output — no file changes to verify, but still validate the content (schema/format/length) exactly as you would any model output.
- Subscription rate limits still apply through the proxy — it spends the same weekly/session quota (visible via
codexbar usage), just without the harness tax. Check quota before a big fan-out.
- Localhost-only by design. Do not set
remote-management.allow-remote: true or bind host: "" unless you intend to expose it.
- ToS note: this reuses subscription OAuth for API-style calls. Enabled here at the account owner's explicit direction.