9Router: Free AI Router & Token Saver

Connect Claude Code, Codex, Cursor, Cline and more to 40+ AI providers with free tiers, auto-fallback, and RTK's 20-40% token savings—never hit limits again.

Source repo
decolua/9router
Stars
★ 33k
Last updated
10d ago v0.5.35
FARS reviewed
Nov 07, 2026
License
MIT
Primary language
JavaScript

At a glance

How it runs
CLISelf-hosted serviceWeb app
Works with
Universal · cross-platformChatGPT · Codex · Claude Code
Cost
Free software; you pay for model usage
Pricing
- **Vertex AI**: $300 free credits for new Google Cloud accounts (90 days). per README
OS / editors
Cursor per README
Setup effort
Low · running in minutes
You'll need
Node.js 20+npmShell / CLINetwork accessLocal filesystem
Typical use
A developer with a Claude Pro subscription wants to maximize it; they configure a combo that falls back to GLM and Kiro free models when quota runs out, avoiding interruptions and extra costs.
Not a fit if
  • Non-technical users unwilling to run a local server or VPS deployment
  • Users relying on iFlow, Qwen Code, or Gemini CLI free tiers, discontinued in 2026
Website
9router.com ↗ set on GitHub
Maintenance
Commits in the last 30 dayslast commit 2026-11-23latest release v0.5.35 (2026-07-16)+35.9 ★/day over 7 days

What does this agent do, and when should you use it?

9Router is a local AI gateway that unifies all major AI coding CLIs—Claude Code, Codex, Cursor, Cline, Copilot, Antigravity, and others—under one OpenAI-compatible endpoint, routing them to 40+ providers including subscription tiers (Claude Code, Codex, GitHub Copilot, Cursor), cheap APIs (GLM, MiniMax, Kimi), and free tiers (Kiro AI, OpenCode Free, Vertex AI). It provides smart 3-tier fallback (Subscription → Cheap → Free) for zero downtime, and reduces token usage via the built-in RTK Token Saver (compressing tool outputs, saving 20-40% input tokens), plus optional Caveman and Ponytail prompt injections to cut output tokens. The dashboard offers real-time quota tracking, request logging, usage analytics, multi-account round-robin, and cloud sync. Installation is via npm global install or from source, with deployment options for localhost, VPS, or Docker. The software is free and open-source (MIT), with costs only from the providers you use directly.

9Router runs locally, listens on port 20128, and serves a dashboard at /dashboard and an OpenAI-compatible API at /v1. It receives standard OpenAI-format requests from CLI tools, translates them to provider-native formats (Claude, Gemini, Cursor, etc.) via its format translator, routes them to the configured provider based on a combo, and intelligently falls back across tiers (subscription → cheap → free). The RTK Token Saver compresses tool outputs (like git diff, grep) before the request, Caveman mode injects a caveman-speak prompt to reduce output tokens by up to 65%, and Ponytail injects a 'lazy senior dev' prompt to bias toward minimal code. It tracks quota and token usage per provider, auto-refreshes OAuth tokens, supports multi-account round-robin, and logs full request/response for debugging. Authentication is via API keys using the Authorization Bearer header.

  1. A developer with a Claude Pro subscription wants to maximize it; they configure a combo that falls back to GLM and Kiro free models when quota runs out, avoiding interruptions and extra costs.
  2. A budget-conscious coder wants zero-cost AI coding; they set up a 'free-forever' combo using Kiro and OpenCode Free, achieving $0/month with production-ready models.
  3. A user wants to integrate AI into messaging apps like WhatsApp or Telegram via OpenClaw; they configure a free combo and access it through their messaging client without any subscription.
  4. A team needs predictable costs; they choose Kimi's flat $9/month plan or MiniMax's $0.20/1M tokens as a cheap backup to a paid subscription, with automatic fallback.
  5. An always-on coding setup for deadlines; a combo chains multiple subscriptions, cheap APIs, and free tiers to guarantee zero downtime during heavy coding sessions.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Install / run
  • npm install -g 9router
  • docker run -d --name 9router -p 20128:20128 -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data decolua/9router:latest
Ports
20128
Environment variables
NEXT_PUBLIC_BASE_URL DATA_DIR OPENAI_BASE_URL OPENAI_API_KEY
Config files
.env.example .env ~/.claude/config.json
Runtime
Node.js 20+
Install notes cover
Docker

How do you install or deploy this agent?

To install, globally install the npm package with 'npm install -g 9router', then run '9router' to start the dashboard at http://localhost:20128. Alternatively, run from source: clone the repo, copy .env.example to .env, run 'npm install', then start the dev server with 'PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev'; for production, run 'npm run build' followed by 'npm run start'. Requires Node.js 20+. For Docker, run 'docker run -d --name 9router -p 20128:20128 -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data decolua/9router:latest'.

How do you use this agent?

After installation, open the dashboard and connect providers: sign up for Kiro or OpenCode Free (no signup needed), or add API keys for others. Copy the API key from the dashboard. Configure your CLI tool: for Claude Code, edit ~/.claude/config.json with '{"anthropic_api_base": "http://localhost:20128/v1", "anthropic_api_key": "your-9router-api-key"}'. For Codex, set environment variables 'OPENAI_BASE_URL="http://localhost:20128"' and 'OPENAI_API_KEY="your-9router-api-key"'. In the CLI, specify a model like 'cc/claude-opus-4-7' or a combo name like 'free-forever'. Send a test request: 'curl -X POST http://localhost:20128/v1/chat/completions -H "Authorization: Bearer your-key" -H "Content-Type: application/json" -d '{"model": "kr/claude-sonnet-4.5", "messages": [{"role": "user", "content": "Hello"}]}'. The dashboard allows you to create combos and monitor usage.

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • Built-in RTK Token Saver compresses tool outputs, saving 20-40% input tokens per request, with safe fallback if compression fails.
  • Smart 3-tier fallback (Subscription → Cheap → Free) ensures zero downtime for 24/7 coding workflows.
  • Supports 40+ providers including free tiers (Kiro, OpenCode Free, Vertex) enabling $0-cost AI coding.
  • OpenAI-compatible endpoint works with all major CLI tools; format translation supports OpenAI, Claude, Gemini, Cursor, and more.
  • Robust dashboard with real-time quota tracking, request logging, usage analytics, and cloud sync for multi-device setups.
Limitations
  • Documentation for free tiers is partially outdated, referencing discontinued iFlow, Qwen Code, and Gemini CLI as of 2026, which could mislead users.
  • Kiro AI's free tier is capped (~50 credits/month) and OpenCode Free's model list fluctuates; availability must be verified.
  • Self-hosted providers (TTS/STT/embeddings) require extra configuration, and the embeddings endpoint must be an OpenAI-compatible base URL.
  • Requires a local or VPS deployment, which may not be turnkey for less technical users.
  • The pricing disclaimer and cost display may confuse users into thinking 9Router charges fees, though it is entirely free.

How does this agent compare with similar options?

The README acknowledges the original Go implementation CLIProxyAPI as inspiration, and integrates token-saving techniques from RTK, Caveman, and Ponytail. It also mentions OmniRoute, a feature-rich TypeScript fork with 36+ providers and advanced features, as an alternative. No other direct comparisons are provided.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
9Router: Free AI Router & Token Saver This agent 59 · Major gaps CLIFree + model costs ★ 33k 10d ago JavaScript ChatGPT · Codex · Claude Code
AIWG 77 · Good CLIFree + model costs ★ 233 today TypeScript Codex · Claude Code
Puppetmaster 73 · Some gaps CLIFree + model costs ★ 487 12d ago Python Codex · Claude Code
aisync 70 · Some gaps CLIFree ★ 53 2d ago Python Codex · Claude Code

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
59/ 100 5-point scale 3.0 / 5
Trust 12/29
Reliability 8/14
Adaptability 14/18
Convention 12/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust12 / 29 · 2.1/5

The documentation says requests pass through a local gateway to upstream services and that self-hosted embeddings without a baseUrl produce a configuration error instead of silently going to a cloud provider; this gives users some data-flow visibility. Deductions: the sample does not fully describe chat, credential, and usage-data storage, transmission, or retention, nor show broad access controls or a revocation path. CLAUDE.md also says the default INITIAL_PASSWORD is 123456 and must be overridden. The OIDC/SAML test routes check login state, but that does not establish confirmation controls across the product.

Reliability8 / 14 · 2.9/5

The routing engine describes default and specialized executors, fallback, and fail-open behavior for RTK hooks; the README and skills provide multiple request formats and some error boundaries. Deductions: free-tier and model statements in the README can change, and the product's broad feature claims cannot be verified from this sample. CLAUDE.md reports known test failures and tests that require network access or credentials, so this evidence does not establish runtime results.

Adaptability14 / 18 · 3.9/5

The README and chat, embeddings, image, and speech skills cover developers, several CLI clients, API use, and self-hosted services, with model discovery, endpoints, and provider-specific parameters. Deductions: skills generally trigger on broadly described user requests, and the sample cannot establish the full compatibility matrix or runtime boundaries across providers and environments.

Convention12 / 18 · 3.3/5

The repository has a structured README, task-specific skills, an MIT license, installation instructions, copyable examples, and some limitation notes. CLAUDE.md describes version and changelog practices. Deductions: CLAUDE.md is primarily contributor guidance, not user-facing security documentation; the sample does not establish maintainers' identity or response responsibility. Separate root and CLI versioning also adds version-tracking overhead.

Effectiveness9 / 13 · 3.5/5

The skills provide directly adaptable curl and JavaScript examples, request fields, response shapes, and provider-specific notes; routing, format translation, and fallback offer clear capabilities beyond a single-upstream call. Deductions: multi-provider, account, and translation configuration add usage and troubleshooting complexity. Token savings and free-use benefits are mainly asserted in the documentation, with no independently verifiable measurements or cost comparisons in the sample.

Verifiability4 / 8 · 2.5/5

The README and skills support some claims with concrete endpoints, parameters, and response examples; source samples also show executor registration and provider-catalog construction. Deductions: many product and savings claims lack independent corroboration in the sample, and there are no execution records to check them. The documentation does not always clearly separate demonstrated facts from inferred benefits.

Risks and how to mitigate them
  • The documentation identifies 123456 as the default INITIAL_PASSWORD; set a strong password before deployment. This sample cannot establish whether a deployment has overridden it.
  • Chat requests are routed to the selected upstream provider. Check that the provider, credentials, and data handling meet your needs. Free-tier, model, and savings statements in the README may change and are not independently verified by this sample.
Evidence confidence: Low Reviewed Nov 07, 2026 Reviewed revision 1fe586bb1cf3 New commits since this review; the score may not cover them
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/9router.svg)](https://followagents.com/en/agents/9router)
<a href="https://followagents.com/en/agents/9router"><img src="https://followagents.com/badge/9router.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. v0.5.35 feat: Grok Imagine video, Copilot Claude route, i18n th/fa version 0.5.35
    Release notes excerpt
    Features: - xAI: Grok Imagine video generation (/v1/videos) + CLI - CLI tools: Grok Build setup — writes [model.9router] to ~/.grok/config.toml - GitHub Copilot: route Claude models through Copilot native /v1/messages - Kiro: add GPT-5.6 model family (#2596) - RTK: X-9Router-Token-Saver header to bypass token savers per request - Providers: quota visibility settings - Translator: drop temperature for all Claude models - i18n: Thai (th) + Persian (fa) translations / README Fixes: - Providers: bulk-add API keys no longer overwrite existing keys (gap-fill Key N) …
    View on GitHub ↗
  2. v0.5.20 feat: thinking level picker + suffix support across providers version 0.5.20
    Release notes excerpt
    Features: - Thinking: per-model thinking level picker on provider page, appends (level) suffix to copied model names for forced reasoning effort across all formats (openai, claude, gemini, deepseek, kimi, qwen, zai, minimax, hunyuan, step) - RTK: add JS-native git-log filter (#2423) - Caveman: add targeted upstream-aligned style rules (#2424) - i18n: add Farsi (fa) language support (#2385) Fixes: - Thinking: strip (level) suffix from upstream body.model so providers no longer reject requests - Translator: preserve developer instructions in openai-responses conversion (#2434) …
    View on GitHub ↗
  3. v0.5.18 v0.5.18: cached token tracking, provider fixes version 0.5.18
    Release notes excerpt
    Features: - Usage: track cached tokens + correct input/output/cache cost (#2209) - Codex: show reset credit expiry details (#2290) - NVIDIA: add new models and capabilities - ClinePass: add provider support Fixes: - Usage: dedupe streaming request-details log entries - Claude: drop foreign thinking signatures in passthrough - Prevent non-SSE stream pipe crash and cross-IdP account overwrites (#2244) - Kiro: route IdC auth to regional CodeWhisperer surface (#2297) - Kiro: add Claude Sonnet 5 model support (#2264) - Xiaomi-tokenplan: region selector, key validation, multi-connection (#2251) …
    View on GitHub ↗

FAQ

What port does 9Router use?
By default 9Router serves on port 20128: the dashboard is at http://localhost:20128/dashboard and the OpenAI-compatible API at http://localhost:20128/v1, which is the base URL to give your coding tools. When running from source, the README sets the port with the PORT environment variable.
Will 9Router charge me anything?
No. 9Router is free, open-source software that runs on your own machine; it never bills you. You pay providers directly (e.g., subscriptions or API fees). The dashboard's cost display is an estimate to show savings, not an invoice.
Are the free providers really free and unlimited?
The currently recommended free tiers (Kiro, OpenCode Free, Vertex) are genuinely free but have limits: Kiro AI ~50 credits/month, OpenCode Free's model list fluctuates, and Vertex AI's $300 credits are for new GCP accounts only for 90 days. Discontinued tiers (iFlow, Qwen Code, Gemini CLI) are no longer available.
What happens if my provider's quota runs out?
9Router automatically falls back to the next provider in your combo via its smart fallback mechanism (e.g., from subscription to cheap to free). You can define the order in combos and set per-provider spending limits to avoid surprises.
Can I use multiple accounts?
Yes, 9Router supports multiple accounts per provider with round-robin or priority-based routing. If one account hits its quota, it automatically switches to the next, providing redundancy.
How do I deploy 9Router for production?
Use Docker (image 'decolua/9router') or run from source on a VPS. Set environment variables like JWT_SECRET, INITIAL_PASSWORD, and DATA_DIR. For internet-exposed deployments, set REQUIRE_API_KEY=true to enforce API key authentication.
Was this page helpful?
View on GitHub ↗ Install ↓

Host ecosystems

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts