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.
Originally forked from decolua/9router β upstream attribution kept per MIT license.
π Quick Start β’ π‘ Features β’ π Setup
βββββββββββββββ
β Your CLI β (Claude Code, Codex, OpenClaw, Cursor, Cline...)
β Tool β
ββββββββ¬βββββββ
β http://localhost:20128/v1
β
βββββββββββββββββββββββββββββββββββββββββββββββ
β EzRouter (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
1. Install from source:
git clone https://github.com/golamrabbi696/EzRouter.git
cd EzRouter
cp .env.example .env
npm install
npm run build
PORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run startπ Dashboard opens at http://localhost:20128
EzRouter works seamlessly with all major AI coding tools:
![]() Claude-Code |
![]() OpenClaw |
![]() Codex |
![]() OpenCode |
![]() Cursor |
![]() Antigravity |
![]() Cline |
![]() Continue |
![]() Droid |
![]() Roo |
![]() Copilot |
![]() Kilo Code |
![]() OpenDesign |
![]() jcode |
![]() Grok Build |
![]() Devin CLI |
![]() DeepSeek TUI |
![]() Qwen Code |
![]() Kiro AI Claude 4.5 + GLM-5 + MiniMax 50 credits/month free |
![]() OpenCode Free No auth β’ Auto-fetch models Free (model list varies) |
![]() 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.
![]() OpenRouter |
![]() GLM |
![]() Kimi |
![]() MiniMax |
![]() OpenAI |
![]() Anthropic |
![]() Gemini |
![]() DeepSeek |
![]() Groq |
![]() xAI |
![]() Mistral |
![]() Perplexity |
![]() Together AI |
![]() Fireworks |
![]() Cerebras |
![]() Cohere |
![]() NVIDIA |
SiliconFlow |
...and 20+ more providers including Nebius, Chutes, Hyperbolic, and custom OpenAI/Anthropic compatible endpoints
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, Infinity |
Every other speech provider is a named cloud service with a fixed endpoint. These three read their address from each connection, so one provider can front several machines and load-balance across them like any other.
Set it on the connection as providerSpecificData.baseUrl:
| Provider | Give it | Result |
|---|---|---|
| Self-hosted STT | the full URL β http://host:8080/v1/audio/transcriptions |
used as-is |
| Self-hosted TTS | the server root β http://host:8880 |
+ /v1/audio/speech |
| Self-hosted Embedding | the OpenAI base, /v1 included β http://host:8080/v1 |
+ /embeddings |
Mind the
/v1on embeddings. The adapter appends/embeddings, sohttp://host:8080resolves tohttp://host:8080/embeddingsand misses the OpenAI route β llama-server answers 501. Give it the same base URL an OpenAI client would use. A full.../v1/embeddingsis also accepted, so a value pasted from acurlexample works too.
The API key is not checked by most local servers, but the field must be non-empty:
it is what gives the connection a credentials record, and baseUrl lives there.
Any placeholder works.
Self-hosted Embedding has no cloud fallback by design β a connection saved
without a baseUrl is reported as a configuration error rather than quietly
falling back to api.openai.com, which would send your input text and API key to
a third party under a provider named "Self-hosted".
| Feature | What It Does | Why It Matters |
|---|---|---|
| π RTK Token Saver (RTK β40K) | Compress tool outputs (git diff, grep, ls, tree...) before sending to LLM |
Save 20-40% input tokens per request |
| π§ Headroom Token Saver (Headroom) | Optional external /v1/compress proxy before provider routing |
Save more context tokens without changing clients |
| πͺ¨ Caveman Mode (Caveman β52K) | Inject caveman-speak prompt β LLM replies terse, technical substance preserved | Save up to 65% output tokens |
| π΄ Ponytail (Ponytail) | Inject "lazy senior dev" prompt β LLM writes minimal, YAGNI-first code (Lite/Full/Ultra) | Fewer output tokens, less refactoring |
| π― Smart 3-Tier Fallback | Auto-route: Subscription β Cheap β Free | Never stop coding, zero downtime |
| π Real-Time Quota Tracking | Live token count + reset countdown | Maximize subscription value |
| π Format Translation | OpenAI β Claude β Gemini β Cursor β Kiro β Vertex | Works with any CLI tool |
| π₯ Multi-Account Support | Multiple accounts per provider | Load balancing + redundancy |
| π Auto Token Refresh | OAuth tokens refresh automatically | No manual re-login needed |
| π¨ Custom Combos | Create unlimited model combinations | Tailor fallback to your needs |
| π Request Logging | Debug mode with full request/response logs | Troubleshoot issues easily |
| πΎ Cloud Sync | Sync config across devices | Same setup everywhere |
| π Usage Analytics | Track tokens, cost, trends over time | Optimize spending |
| π Deploy Anywhere | Localhost, VPS, Docker, Cloudflare Workers | Flexible deployment options |
Set X-9Router-Token-Saver: off to bypass all token savers for one chat request. (Header name unchanged from upstream.)
- Runtime: Node.js 20+
- Framework: Next.js 16
- UI: React 19 + Tailwind CSS 4
- Database: SQLite (better-sqlite3 / node:sqlite / sql.js fallback)
- Streaming: Server-Sent Events (SSE)
- Auth: OAuth 2.0 (PKCE) + JWT + API Keys
POST http://localhost:20128/v1/chat/completions
Authorization: Bearer your-api-key
Content-Type: application/json
{
"model": "cc/claude-opus-4-6",
"messages": [
{"role": "user", "content": "Write a function to..."}
],
"stream": true
}GET http://localhost:20128/v1/models
Authorization: Bearer your-api-key
β Returns all models + combos in OpenAI formatThanks to all contributors who helped make EzRouter better!
Built on the shoulders of giants:
- CLIProxyAPI β original Go implementation that inspired this JavaScript port.
- RTK
β Rust token-saver. EzRouter ports its compression pipeline to JS β β20-40% input tokens on every request.
- Caveman
by @JuliusBrussee β viral "why use many token when few token do trick". EzRouter adapts its prompt β β65% output tokens.
- Ponytail
by @DietrichGebert β "lazy senior dev" skill. EzRouter injects its YAGNI-first ladder β fewer tokens, less code, shorter diffs.
- decolua/9router β the upstream project this fork is based on. All core functionality originates there.
Huge thanks to these authors β without their work, EzRouter's token-saving features wouldn't exist. β them on GitHub!
MIT License - see LICENSE for details.
Maintained by Golam Rabbi





































