Verdict: 9Router is a free, open-source local proxy (MIT licensed, ~24,000 GitHub stars as of July 2026) that sits between your AI coding CLI tools and 40+ model providers, exposing a single OpenAI-compatible endpoint at http://localhost:20128/v1. It is genuinely useful for two things: (1) stacking fallback tiers so a rate limit on your primary provider no longer kills your coding session, and (2) cutting input token use 20–40% by compressing verbose tool outputs like git diff and grep before they reach the model. The "unlimited free coding forever" framing you see in many walk-throughs is half-true — the genuinely free upstream tiers (Kiro AI, OpenCode Free, Vertex AI trial credits) carry their own real-world caps, and 9Router is a router, not a model, so quality depends on whichever provider the request lands on. For a solo builder or small team already juggling multiple AI subscriptions, it is worth wiring in. For regulated production workflows, treat it as experimental until you audit credential storage and each provider's terms.
Last verified: 2026-07-30 · Open source (MIT) · Runs locally · One endpoint speaks chat, embeddings, TTS, STT, image, search · Save 20–40% input tokens (RTK), up to 65% output tokens (Caveman mode). Pricing and free-tier limits change often — re-check before relying on any figure below.
What is 9Router and what problem does it actually solve?
9Router is a local smart gateway that translates, compresses, and routes requests from AI coding tools (Claude Code, Codex CLI, Cursor, OpenClaw, Cline, Copilot, Antigravity, and anything else that speaks OpenAI- or Anthropic-compatible APIs) to 40+ backend providers and 100+ models. The core problem it addresses is provider lock-in and interruption: most coding agents are hard-wired to one backend, so when that backend's quota resets or a 429 rate-limit error arrives mid-session, work stops. 9Router adds a three-tier fallback chain — subscription → cheap → free — and silently hops to the next provider when the current one is exhausted, so the coding agent never sees an error.
It is not a model. It does not invent a new foundation model or improve code quality by itself. It is a piece of infrastructure — a Next.js app with an SQLite store and an SSE translation core — that decides how each request is shaped, which account sends it, and what to do when the preferred path fails. The creator is decolua; the canonical repository is github.com/decolua/9router; the npm package is 9router (MIT, ~34,000 weekly downloads, v0.5.45 at time of writing).
The honest framing from the project's own issue tracker (see the community-signal sections of third-party guides and the repo's own notes) is that provider and client protocols are changing fast, so a router has to be patched continuously. Model IDs change, streaming formats differ, OAuth paths break. 9Router is a moving target — useful, but not a set-and-forget piece of infrastructure.
| Layer | What it does | Benefit |
|---|---|---|
| Single endpoint | All your coding tools point at one local URL | No juggling five keys and dashboards |
| Format translation | Converts between OpenAI, Anthropic, Gemini, Cursor, Kiro, Vertex, Antigravity, Ollama, and OpenAI Responses formats | Any tool with any provider |
| Quota tracking | Live token count + reset countdown per account | Use every bit of a subscription before it resets |
| Auto-fallback | Quota exhausted → hop to next tier automatically | Zero-downtime coding sessions |
| RTK token saver | Losslessly compresses git diff, grep, ls, log output, numbered reads before sending |
Saves 20–40% input tokens |
| Caveman / Ponytail modes | Inject terse-style system prompts | Up to 65% fewer output tokens |
How does the three-tier smart fallback work?
The fallback system is the reason most people install 9Router, and it works exactly as described on the project's own README and npm page. You define a named "combo" — an ordered chain of providers — and 9Router tries them in order.
Tier 1 — SUBSCRIPTION: Claude Code, Codex, GitHub Copilot, Cursor
(use what you already pay for first)
↓ quota exhausted
Tier 2 — CHEAP: GLM ($0.60/1M tokens), MiniMax ($0.20/1M)
(low-cost backup, resets every few hours)
↓ budget limit
Tier 3 — FREE: Kiro AI, OpenCode Free, Vertex AI ($300 trial credits)
(emergency fallback, zero cost)
A real "always-on" combo from the 9Router docs looks like this:
Combo: "always-on"
1. cc/claude-opus-4.7 (best quality, your subscription)
2. cx/gpt-5.5 (second subscription)
3. glm/glm-5.1 (cheap, resets daily 10 AM)
4. minimax/MiniMax-M2.7 (cheapest, 5-hour rolling reset)
5. kr/claude-sonnet-4.5 (free unlimited via Kiro)
The trade-off, which the project's own community notes acknowledge, is that fallback improves availability only if the fallback models can actually handle the task. A cheap or free model may keep the stream alive but produce weaker edits, worse tool calls, or function-call structures incompatible with your agent. So "never stop coding" is not the same as "never produce bad code." The smart move is to put a quality floor in your combo — reserve the genuinely free tiers for emergency continuity, not primary work.
For more on why picking the right model for each job matters more than picking the single "best" model, see our piece on AI agent loop cost in 2026, which argues it is often cheaper to run a cheap builder plus a strong judge than one frontier model.
Which providers are actually free, and what are their real limits?
This is where the marketing and the engineering diverge most sharply. 9Router itself never charges anything — it is free open-source software running on your own machine, with no billing system. But the "free" upstream providers each have their own caps.
| Free Provider | What you get | Real limit | Source |
|---|---|---|---|
| Kiro AI (AWS) | Claude Sonnet 4.5, GLM-5, MiniMax M2.5, Deepseek v3.2, Qwen3 coder via OAuth (AWS Builder ID, Google, or GitHub login) | ~50 credits/month on the free tier; paid tiers start at $20/mo (1,000 credits). No daily/weekly rate limits — credits are the cap. | kiro.dev; github.com/decolua/9router |
| OpenCode Free | Auto-fetched model list, no auth needed (passthrough proxy) | Model list fluctuates — some models are free only for limited promos and the list "subject to change without notice" | opencode.ai; npmjs.com/package/9router |
| Vertex AI (Google Cloud) | Gemini 3 Pro, GLM-5, DeepSeek via GCP service account | $300 free credits for new GCP accounts, valid 90 days. Since March 2026 the Gemini API endpoint no longer consumes free credits — you must use the Vertex AI Studio endpoint. | github.com/decolua/9router |
A few easy-to-miss facts the README flags explicitly: the iFlow, Qwen Code, and Gemini CLI free tiers were discontinued in 2026 — use Kiro, OpenCode Free, or Vertex instead. And although Kiro markets itself around Claude 4.5, the free tier is credit-capped, not truly unlimited; the "unlimited" language applies to the paid Kiro tiers, not the free one. The genuinely no-auth, no-cap path today is OpenCode Free, but its model list is unstable.
For builders who want a deeper comparison of free and open-source AI tooling more broadly, our 10 free open-source AI tools you can actually run in 2026 walkthrough covers the wider landscape.
How do you set up 9Router in under ten minutes?
The install is genuinely small. Three steps get you a working local router.
Step 1 — Install and start the router
# Option A: npm (recommended for desktop)
npm install -g 9router
9router
# Dashboard opens at http://localhost:20128/dashboard
# Option B: Docker (server / VPS)
docker run -d --name 9router -p 20128:20128 \
-v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data \
decolua/9router:latest
# Option C: run from source
git clone https://github.com/decolua/9router.git
cd 9router
cp .env.example .env
npm install
PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev
After start-up, two URLs matter: the dashboard at http://localhost:20128/dashboard (where you connect providers and build combos) and the OpenAI-compatible API at http://localhost:20128/v1 (where your coding tools send requests).
Step 2 — Connect at least one free provider
Open the dashboard, go to Providers, and connect Kiro AI (OAuth via AWS Builder ID, Google, or GitHub — no credit card) or OpenCode Free (no auth at all). Either one gets you writing code at $0/month. If you already pay for Claude Code, Codex, GitHub Copilot, or Cursor, connect those too — 9Router's quota tracker will make sure you use every bit of your subscription before it resets each cycle.
Step 3 — Point your coding tool at the endpoint
All the major CLI/IDE agents accept a custom OpenAI-compatible base URL. Point yours at http://localhost:20128/v1, paste the API key from the dashboard, and pick a model alias with the right prefix.
Claude Code (~/.claude/config.json):
{
"anthropic_api_base": "http://localhost:20128/v1",
"anthropic_api_key": "your-9router-api-key"
}
Codex CLI (environment variables):
export OPENAI_BASE_URL="http://localhost:20128"
export OPENAI_API_KEY="your-9router-api-key"
codex "your prompt"
Cursor / Cline / Continue: set the OpenAI base URL to http://localhost:20128/v1 and the model to whatever alias 9Router exposes (for example kr/claude-sonnet-4.5 for free Claude via Kiro).
For a team-focused walk-through of wiring Claude Code and Codex into a shared agent workspace, see our guide on setting up Buzz with Claude Code and Codex in 2026.
What is RTK token saving and how much does it actually save?
RTK (the built-in token saver) is the most underrated part of 9Router. Agentic coding tools burn enormous numbers of tokens on tool outputs — git diff, ls, grep, file trees, log dumps — that are verbose but carry most of their meaning in structure, not verbatim text. RTK applies lossless content-aware compression to those outputs before they are translated and sent to the upstream model.
The README's headline figure is a 20–40% reduction in input tokens with no loss of meaning. A worked example from the project's own docs: a 47K-token git diff can be compressed to 28K tokens while preserving everything the model needs to understand the changes. Compression is automatic — RTK recognises git diffs by their diff --git header, grep output by its filename:line_number:content pattern, directory listings by tree structure, and log dumps by timestamp patterns. No configuration is needed.
On the output side, two optional prompt-injection modes push savings further:
- Caveman Mode — injects a caveman-speak system prompt that forces terse, noun-verb replies. Up to ~65% fewer output tokens across five intensity levels.
- Ponytail — injects a "lazy senior dev" YAGNI-first prompt (Lite / Full / Ultra) that nudges the model to skip unnecessary output and avoid premature refactoring.
The catch: prompt-injection modes change the model's behaviour, not just its verbosity. Terse replies can be fine for code edits but misleading for explanations. RTK (input) is safe to leave on by default; Caveman/Ponytail (output) is a per-task choice.
How does 9Router compare to just using one coding tool directly?
| Question | Single tool, direct (e.g. Claude Code out of the box) | 9Router in front |
|---|---|---|
| What happens when my quota resets? | Coding stops until the reset window | Falls back to next tier automatically |
| Can I mix providers without reconfiguring? | No — one tool, one backend | Yes — one endpoint, 40+ providers |
| Token cost on verbose tool outputs | Full token cost on every git diff, grep, ls |
20–40% input compression (RTK) |
| Where do my credentials live? | The tool's own config/store | Local SQLite under ~/.9router |
| Setup effort | Native — open the tool | Extra local service + endpoint config |
| Suitability for regulated / production codepaths | Vendor-supported SLA path | Treat as experimental until you audit terms |
The single-tool path wins on simplicity and on vendor support. The 9Router path wins on cost control, availability, and provider freedom. The two are not mutually exclusive — you can run 9Router in front of tools you already pay for, using paid tiers for heavy lifting and free tiers for the everyday 90% of work.
If you are comparing which AI coding agents to use at all (not just how to route them), our DeepSWE vs SWE-bench Pro guide covers why the public coding benchmarks are breaking and what to use instead for picking models on real tasks.
Is 9Router safe? What about credentials and OAuth?
9Router runs locally on your machine; provider keys and OAuth tokens are stored in a local SQLite database under ~/.9router/db/data.sqlite (or %APPDATA%/9router/db/data.sqlite on Windows, /app/data in Docker). Requests leave your machine only to the providers you select — there is no central relay unless you explicitly enable the optional Cloudflare tunnel / cloud sync.
That said, a few honesty flags worth knowing before you wire it into anything sensitive:
- OAuth/subscription reuse is a policy decision, not a setup decision. 9Router can intercept IDE traffic (Antigravity, GitHub Copilot, Kiro IDE) via a MITM bridge to reuse subscriptions with any backend. Whether that violates a specific provider's terms is on you to check — the project itself flags risk notices for some providers.
- Set
REQUIRE_API_KEY=trueon any public deployment to require a Bearer key on the/v1/*routes. The default first-login password is123456— changeINITIAL_PASSWORDimmediately if you bind to anything other than localhost. - Streaming format and model-ID mismatches are the common failure mode. The issue tracker shows continuous patching as providers change their APIs. Pin a known-good version and test after upgrades.
- Caveman/Ponytail modes alter model behaviour. They are not free — terse replies are not just shorter, they are different outputs. Test them on a known task before trusting them in production.
For regulated production codepaths, the agentpedia and pyshine deep-dives (both linked in Sources) recommend treating 9Router as experimental until you have reviewed credential storage, logging, provider terms, and fallback behaviour under your own policies. For solo builders and side projects, the localhost default is fine.
What does 9Router mean for builders and small teams?
For the audience we write for — people using AI for work, small businesses, and people building products — 9Router's real value is economic and operational, not technical novelty.
- It kills the "one subscription and done" trap. If you pay for Claude Code or Cursor and hit a five-hour rate limit mid-build, there is no clean recovery today without 9Router. With it, the session continues on a fallback model. The cost of that continuity is monitoring a local dashboard.
- It stretches your existing spend. RTK's 20–40% input compression means your paid subscription credits last longer before reset — you are paying for meaningful context, not verbatim
git diffnoise. - It opens genuinely $0 coding paths — but with limits. Kiro's free tier gives ~50 credits/month, OpenCode Free gives a fluctuating model set, and Vertex gives a one-time $300 trial. These are enough for prototyping and side projects, not for sustained commercial development. Plan to upgrade at least one provider when the work becomes real.
- It is not a replacement for picking the right model for the job. A router that hops to GLM-4.6 when Claude Sonnet runs dry will keep your stream alive, but the code you get back will be materially different. Combos should never silently downgrade you past your quality floor without you noticing.
If this kind of multi-layer AI infrastructure sounds familiar, our piece on what an AI agent operating system actually is in 2026 covers the broader category 9Router sits inside — the move from single-model clients toward local AI infrastructure with routing, budget control, and provider abstraction.
FAQ
Q: Is 9Router free? A: Yes — the software itself is free and open source under the MIT license and never charges anything. The only costs are the upstream providers you choose to connect (some of which have free tiers, some paid). 9Router itself has no billing system.
Q: Does 9Router provide free unlimited Claude coding? A: Partially. The free Kiro AI provider exposes Claude Sonnet 4.5 at no cost, but Kiro's free tier is capped at roughly 50 credits per month — it is not truly unlimited. OpenCode Free offers no-auth passthrough to a fluctuating model list. For genuinely unlimited free coding, combine multiple free providers with auto-fallback, and accept that quality and availability will vary.
Q: Which AI coding tools work with 9Router?
A: Claude Code, Codex CLI, Cursor, OpenClaw, Cline, Continue, GitHub Copilot, Antigravity, Kilo Code, Roo, Droid, and OpenCode are all listed as supported. Anything that can set a custom OpenAI- or Anthropic-compatible base URL can connect to the http://localhost:20128/v1 endpoint.
Q: How much does RTK token saving actually save? A: The project reports 20–40% input token savings, losslessly, by compressing verbose tool outputs like git diffs and grep results before they reach the model. Two optional output-side modes (Caveman, Ponytail) can push savings to 65% on output but alter model behaviour, so they are per-task choices, not default-on.
Q: Can I run 9Router on a server or only on my laptop?
A: Both. The npm global install is the desktop path. For a server or VPS, use the published Docker image (decolua/9router:latest on Docker Hub and GHCR, multi-platform amd64/arm64), mounting $HOME/.9router to /app/data to persist config. If you expose the port publicly, set REQUIRE_API_KEY=true and change the default INITIAL_PASSWORD from 123456.
Q: Is it safe to route OAuth subscriptions (Claude Code, Cursor) through 9Router? A: Locally, yes — credentials stay in your own SQLite store. But routing paid subscription traffic through a third-party gateway can violate individual provider terms. 9Router's own docs flag risk notices for some providers; treat it as a policy decision per provider, not a universal green light, especially in regulated environments.

Discussion
0 comments