9Router is a self-hosted LLM router that sits between AI coding tools and model providers. A client such as Claude Code, Codex, Cursor, Cline, OpenCode, or OpenClaw points at 9Router's OpenAI-compatible endpoint, and 9Router translates the request format, picks a provider from a configured fallback chain, tracks quota, refreshes OAuth tokens, and compresses tool output before it reaches the model.
Routing is organized as combos: ordered lists of models that fall through on exhausted quota or errors. The documented pattern is a three-tier chain, subscription accounts (Claude Code, Codex, GitHub Copilot, Cursor) first, then cheap API providers (GLM, MiniMax, Kimi), then free tiers (Kiro, OpenCode Free, Vertex AI credits). Multiple accounts per provider rotate round-robin or by priority. Format translation covers OpenAI, Claude, Gemini, Cursor, Kiro, Vertex, Antigravity, Ollama, and OpenAI Responses request shapes.
| Tier | Provider | Cost | Quota reset |
|---|---|---|---|
| Subscription | Claude Code (Pro/Max) | $20-200/mo | 5h and weekly |
| Codex (Plus/Pro) | $20-200/mo | 5h and weekly | |
| GitHub Copilot | $10-19/mo | Monthly | |
| Cursor IDE | $20/mo | Monthly | |
| Cheap | GLM-5.1 / GLM-4.7 | $0.6/1M | Daily |
| MiniMax M2.7 | $0.2/1M | 5-hour rolling | |
| Kimi K2.5 | $9/mo flat | 10M tokens/mo | |
| Free | Kiro AI | $0 | 50 credits/mo |
| OpenCode Free | $0 | Varies | |
| Vertex AI | $300 credits | New GCP accounts |
Several opt-in token savers run inside the proxy. RTK losslessly compresses tool outputs such as git diff, grep, and directory listings before the request reaches the model, with a claimed 20-40% input-token saving. Headroom is an optional external compression proxy called before routing. Caveman mode and Ponytail inject system prompts that bias the model toward terse replies and minimal, YAGNI-first code. A request header bypasses all savers for one call.
A dashboard configures providers, combos, and client tools, and shows live quota, reset countdowns, request logs, and usage analytics with cost estimates (for comparison only, 9Router itself charges nothing). Settings can sync across devices through a cloud sync service. Self-hosted speech and embedding servers that speak the OpenAI shape (whisper.cpp, Speaches, Kokoro-FastAPI, llama-server, vLLM, Infinity) can be added as providers, and the router deploys on a workstation, a VPS, Docker, or Cloudflare Workers. It is built with Next.js and React over SQLite.
Features
- Fallback combos: ordered model chains that switch provider when quota runs out or a request errors, mixing subscription, cheap, and free tiers
- RTK token saver: lossless compression of tool outputs (git diff, grep, ls, tree, log dumps) before the request reaches the model
- Headroom, Caveman, and Ponytail: an optional external compression proxy and two injected system prompts that shorten replies and bias toward minimal code
- Format translation: converts between OpenAI, Claude, Gemini, Cursor, Kiro, Vertex, Antigravity, Ollama, and OpenAI Responses request shapes
- Quota tracking: live token counts, reset countdowns (5-hour, daily, weekly), cost estimates, and monthly reports per provider
- Multi-account: several accounts per provider with round-robin or priority routing and fallback between them
- OAuth token refresh: subscription provider tokens refresh before expiry without re-login
- Client setup: the dashboard writes model settings for Claude Code, Codex, OpenClaw, Cursor, Cline, Continue, Roo Code, Kilo Code, and other tools
- Request logging: a debug mode records full request and response payloads and exports them
- Cloud sync: providers, combos, and settings sync across devices
- Self-hosted providers: speech and embedding servers that speak the OpenAI shape (whisper.cpp, Speaches, Kokoro-FastAPI, llama-server, vLLM, Infinity)
- Deployment targets: a local workstation, a VPS, Docker, or Cloudflare Workers


