9router README

The project's README from github.com/decolua/9router. As one markdown file: 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

🇧🇷 Português (Brasil) • 🇻🇳 Tiếng Việt • 🇨🇳 中文 • 🇯🇵 日本語 • 🇷🇺 Русский • 🇹🇭 ไทย • 🇮🇷 فارسی • 🇮🇩 Indonesia • 🇪🇸 Español • 🇫🇷 Français


🤔 Why 9Router?

Stop wasting money, tokens and hitting limits:

9Router solves this:


🔄 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 (~50 credits/month free: Claude 4.5 + GLM-5 + MiniMax) 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_BASE_URL=http://localhost:20128 npm run start

Default URLs:


Video Guides

Tiết kiệm chi phí LLM với 9Router
🇻🇳 Tiếng Việt
Tiết kiệm chi phí LLM cho OpenClaw với 9Router
by Mì AI
9Router + Claude Code FREE Unlimited Setup
🇵🇰 اردو / हिन्दी
9Router + Claude Code FREE Unlimited Setup
by Build AI With Hamid
9Router Setup Tutorial
🇺🇸 English
9Router + Claude Code FREE Setup
by Build AI With Hamid
9Router Setup Tutorial
🇺🇸 English
9Router + Claude Code FREE Setup
by Build AI With Hamid
Claude Code FREE Forever
🇺🇸 English
Claude Code FREE Forever — Unlimited Models
by Build AI With Hamid
Claude CLI Free Setup
🇺🇸 English
Claude CLI Free Setup with 9Router 🚀
by CodeVerse Soban
Cài đặt OpenClaw Free A-Z
🇻🇳 Tiếng Việt
Cài Đặt OpenClaw Free Từ A-Z + 9Router
by Mai Gia
FREE OpenClaw with Claude Opus
🇺🇸 English
FREE OpenClaw + Claude Opus 4.6
by Build AI With Hamid
Claude CLI Free Setup
🇮🇩 Indonesia
Koding 24 Jam Anti Rate Limit! Hemat Token AI 65% | Tutorial Quick Setup 9Router 🚀
by Krisswuh
Cara Deploy 9Router di Hugging Face GRATIS Non-Stop! | Alternatif VPS RAM 16GB
🇮🇩 Indonesia
Cara Deploy 9Router di Hugging Face GRATIS Non-Stop! | Alternatif VPS RAM 16GB
by Krisswuh
این شکلی از هر API ای استفاده کن برای هوش مصنوعی
🇮🇷 Persian-فارسی
این شکلی از هر API ای استفاده کن برای هوش مصنوعی
by Matin SenPai
Hướng Dẫn Setup OpenClaw + 9Router: Tạo Bot Zalo AI Tự Động Từ A-Z
🇻🇳 Tiếng Việt
Hướng Dẫn Setup OpenClaw + 9Router: Tạo Bot Zalo AI Tự Động Từ A-Z
by tuanminhhole

🎬 Made a video about 9Router? Submit a Pull Request adding your video to this section — we'll merge it!


🛠️ Supported CLI Tools

9Router works seamlessly with all major AI coding tools:

Claude Code
Claude-Code
OpenClaw
OpenClaw
Codex
Codex
OpenCode
OpenCode
Cursor
Cursor
Antigravity
Antigravity
Cline
Cline
Continue
Continue
Droid
Droid
Roo
Roo
Copilot
Copilot
Kilo Code
Kilo Code
OpenDesign
OpenDesign
jcode
jcode
Grok Build
Grok Build
Devin CLI
Devin CLI
DeepSeek TUI
DeepSeek TUI
Qwen Code
Qwen Code

🌐 Supported Providers

🔐 OAuth Providers

Claude Code
Claude-Code
Antigravity
Antigravity
Codex
Codex
GitHub
GitHub
Cursor
Cursor
Kimchi
Kimchi

🆓 Free Providers

Kiro
Kiro AI
Claude 4.5 + GLM-5 + MiniMax
50 credits/month free
OpenCode Free
OpenCode Free
No auth • Auto-fetch models
Free (model list varies)
Vertex AI
Vertex AI
Gemini 3 Pro + GLM-5 + DeepSeek
$300 credits free

Note: iFlow, Qwen Code and Gemini CLI free tiers were discontinued in 2026. Use Kiro / OpenCode Free / Vertex instead.

Kiro AI moved to a paid model in Sep 2025 — the free tier is now capped at 50 credits/month (plus 500 trial credits for new accounts in the first 30 days). Paid tiers: Pro $20/mo (1,000 credits), Pro+ $40/mo (2,000), Pro Max $100/mo (5,000), Power $200/mo (10,000). OpenCode Free model list fluctuates over time (some models free only for limited promos) — subject to change without notice. Vertex AI: the $300 free credit for new GCP accounts is still valid, but since Mar 2026 the Gemini API endpoint no longer consumes these credits — call the Vertex AI Studio endpoint instead.

🔑 API Key Providers (40+)

OpenRouter
OpenRouter
GLM
GLM
Kimi
Kimi
MiniMax
MiniMax
OpenAI
OpenAI
Anthropic
Anthropic
Gemini
Gemini
DeepSeek
DeepSeek
Groq
Groq
xAI
xAI
Mistral
Mistral
Perplexity
Perplexity
Together
Together AI
Fireworks
Fireworks
Cerebras
Cerebras
Cohere
Cohere
NVIDIA
NVIDIA
SiliconFlow
SiliconFlow

...and 20+ more providers including Nebius, Chutes, Hyperbolic, and custom OpenAI/Anthropic compatible endpoints

🏠 Self-hosted Providers

For speech and embeddings served from your own machine — whisper.cpp, faster-whisper, Speaches, Kokoro-FastAPI, openedai-speech, llama.cpp/llama-server, vLLM, Infinity, text-embeddings-inference, or anything else that speaks the OpenAI shape.

Provider Endpoint used Typical server
Self-hosted STT /v1/audio/transcriptions whisper.cpp, faster-whisper
Self-hosted TTS /v1/audio/speech Kokoro-FastAPI, openedai-speech
Self-hosted Embedding /v1/embeddings llama-server, vLLM, I

9router (decolua/9router)

llm-gateway
Searching Database…

30.9K ·GitHub
What is this?9Router is a local AI router and token saver: it connects coding tools like Claude Code, Codex, Cursor and Cline to 40+ providers and 100+ models, auto-falls back from your subscription to cheap and free models, and compresses tool output to save 20-40% of tokens.
Is this a cloud service I sign up for, or something I run on my own machine?You run it yourself. It installs globally, serves a local web dashboard plus an OpenAI-compatible API endpoint, and your CLI coding tools send requests to that endpoint instead of to each provider directly.
How do I get it running?Install 9Router globally and a dashboard opens in your browser. Connect a free provider there (Kiro AI, or OpenCode Free with no auth), then point your coding CLI at the router. Running from source or via Docker works too.
Which AI coding tools can I connect to it?Claude Code, Codex, Cursor, Cline, Antigravity, Copilot, OpenCode, OpenClaw, Continue, Roo, Droid, Kilo Code, Devin CLI, Qwen Code, DeepSeek TUI and more — the README says it works with any CLI tool.
What's the catch with the free providers?The free tiers have real limits: Kiro AI caps free usage at 50 credits/month, OpenCode Free's model list changes without notice, and iFlow, Qwen Code and Gemini CLI free tiers were discontinued in 2026. Vertex AI's $300 credit now only applies via the Vertex AI Studio endpoint.
Where can I run it — just my laptop, or a server too?Anywhere Node.js runs — macOS, Linux or Windows — and Docker images are included. Community guides also cover deploying it to Hugging Face or a VPS so it stays up around the clock.
How does the 20-40% token saving actually work?The RTK Token Saver auto-compresses tool-result content — git diff, grep and ls output that normally burns tokens fast — cutting 20-40% of tokens per request.
What happens when I hit a rate limit or run out of credits?9Router automatically fails over along a Subscription → Cheap → Free chain with zero downtime, can round-robin between multiple accounts per provider, and tracks your quota so you use every credit before it resets.
Can I connect models I host on my own machine?Yes — anything that speaks the OpenAI API shape works: llama.cpp/llama-server and vLLM for chat, whisper.cpp and faster-whisper for speech-to-text, Kokoro-FastAPI for text-to-speech.
Does 9Router itself cost anything?No — the router is free and MIT-licensed; you only pay whatever the underlying providers charge, and several of them offer free tiers.
Creator
decolua
Size
16.9 MB
Stars
30.9K
Age
9mo
Commits · 90 Days