StackMap
Subscribe
Explore / 9router
decolua

9router

Self-hosted gateway pointing any AI coding CLI (Claude Code, Codex, Cursor, Cline) at 40+ providers, with subscription→cheap→free auto-fallback and tool_result compression for 20-40% token savings.

22,348 3,794 JavaScript MITupdated 6 days ago
Curator's take

The 'never hit a rate limit again' gateway: run it on localhost, point Claude Code / Codex / Cursor / Cline / Copilot at its OpenAI-compatible endpoint, and it round-robins your accounts and cascades Subscription → cheap ($0.2-0.6/1M) → free (Kiro, OpenCode) providers so a job never dies mid-flight, while RTK compresses tool_result payloads (git diff, grep, ls) to shave 20-40% of tokens. Best when you juggle several provider subscriptions/keys and keep exhausting quota. NOT for you if you want one stable premium model (free-tier fallbacks vary in quality/availability), if routing traffic through third-party free providers raises data-privacy concerns, or if you want savings from smarter code retrieval rather than payload compression. Overlaps heavily with lynkr — pick 9router for free/multi-account fallback breadth, lynkr for tool-stripping, semantic caching and local-model routing.

Mapped by ShipWithAI editors · links verified
README.md
9Router Dashboard

9Router - FREE AI Router & Token Saver

Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE & cheap AI models.

Connect All AI Code Tools (Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, OpenClaw...) to 40+ AI Providers & 100+ Models.

npm Downloads Docker Pulls GHCR License

decolua%2F9router | Trendshift

🚀 Quick Start💡 Features📖 Setup🌐 Website

🇻🇳 Tiếng Việt🇨🇳 中文🇯🇵 日本語🇷🇺 Русский


🤔 Why 9Router?

Stop wasting money, tokens and hitting limits:

  • ❌ Subscription quota expires unused every month
  • ❌ Rate limits stop you mid-coding
  • ❌ Tool outputs (git diff, grep, ls...) burn tokens fast
  • ❌ Expensive APIs ($20-50/month per provider)
  • ❌ Manual switching between providers

9Router solves this:

  • RTK Token Saver - Auto-compress tool_result content, save 20-40% tokens per request
  • Maximize subscriptions - Track quota, use every bit before reset
  • Auto fallback - Subscription → Cheap → Free, zero downtime
  • Multi-account - Round-robin between accounts per provider
  • Universal - Works with Claude Code, Codex, Cursor, Cline, any CLI tool

🔄 How It Works

┌─────────────┐
│  Your CLI   │  (Claude Code, Codex, OpenClaw, Cursor, Cline...)
│   Tool      │
└──────┬──────┘
       │ http://localhost:20128/v1
       ↓
┌─────────────────────────────────────────────┐
│           9Router (Smart Router)            │
│  • RTK Token Saver (cut tool_result tokens) │
│  • Format translation (OpenAI ↔ Claude)     │
│  • Quota tracking                           │
│  • Auto token refresh                       │
└──────┬──────────────────────────────────────┘
       │
       ├─→ [Tier 1: SUBSCRIPTION] Claude Code, Codex, GitHub Copilot
       │   ↓ quota exhausted
       ├─→ [Tier 2: CHEAP] GLM ($0.6/1M), MiniMax ($0.2/1M)
       │   ↓ budget limit
       └─→ [Tier 3: FREE] Kiro, OpenCode Free, Vertex ($300 credits)

Result: Never stop coding, minimal cost + 20-40% token savings via RTK

⚡ Quick Start

1. Install globally:

npm install -g 9router
9router

🎉 Dashboard opens at http://localhost:20128

2. Connect a FREE provider (no signup needed):

Dashboard → Providers → Connect Kiro AI (free Claude unlimited) or OpenCode Free (no auth) → Done!

3. Use in your CLI tool:

Claude Code/Codex/OpenClaw/Cursor/Cline Settings:
  Endpoint: http://localhost:20128/v1
  API Key: [copy from dashboard]
  Model: kr/claude-sonnet-4.5

That's it! Start coding with FREE AI models.

Alternative: run from source (this repository):

This repository package is private (9router-app), so source/Docker execution is the expected local development path.

cp .env.example .env
npm install
PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev

Production mode:

npm run build
PORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_

Continue your stack

What teams reach for next — and why each earns a place beside 9router. Ranked by curator confidence.

Alternative to See all + compare →
Lynkr

Self-hosted LLM gateway wrapping Claude Code, Cursor or Codex with zero code changes — strips unused tools, compresses JSON tool results ~88%, semantic-caches, tier-routes easy work to local models.

Why it fitsBoth are self-hosted LLM gateways that wrap coding agents (Claude Code/Codex/Cursor/Cline) with zero code changes and cut tokens by compressing tool_result payloads, then route across backends. 9router optimizes for cost/uptime — 40+ providers, multi-account round-robin, subscription→cheap→free auto-fallback. lynkr optimizes for efficiency — strips unused tools, semantic-caches, and tier-routes easy work to local models. Pick by whether you need free-provider breadth or local-model routing.
freellmapi

OpenAI-compatible proxy that stacks free tiers of 18 LLM providers (~1.7B tokens/mo) behind one /v1 — smart routing, failover, per-key quota tracking; Claude Code and Codex shims included.

Why it fitsBoth are self-hosted OpenAI-compatible gateways that multiplex providers with automatic fallback for coding CLIs. 9router optimizes paid usage (subscription→cheap→free routing, token compression); FreeLLMAPI exists purely to stack and stay under 18 providers' free-tier caps.
free-claude-code

Provider-backed proxy that runs Claude Code, Codex or Pi on 25 cloud and local providers — fcc-* launchers, local Admin UI with validation, per-tier model routing, IDE/Discord/Telegram hookups.

Why it fitsBoth are self-hosted gateways pointing Claude Code/Codex-class CLIs at many providers. 9router leans on routing policy (subscription→cheap→free fallback, token compression); FCC leans on UX — launchers, validation UI, native model-picker integration, IDE configs.