9router: a smart AI router with auto-fallback and token compression to minimize costs and avoid rate limits
9router: a smart AI router with auto-fallback and token compression to minimize costs and avoid rate limits
What it solves
9Router is a smart AI router designed to prevent coding interruptions caused by rate limits, exhausted subscription quotas, and high API costs. It allows developers to connect multiple AI providers and models to their CLI tools while automatically managing token usage and costs.
How it works
It acts as a proxy between your AI coding tool (like Claude Code, Cursor, or Cline) and various AI providers. The router implements a three-tier fallback system: it first attempts to use a paid subscription, then falls back to cheap API models, and finally to free providers. It also includes "RTK Token Saver" to compress tool outputs (like git diffs or file lists) before they reach the LLM, reducing input token consumption.
Who it’s for
Developers using AI-powered CLI tools and IDEs who want to maximize their subscription value, avoid downtime from rate limits, and reduce their overall API spending.
Highlights
- Smart 3-Tier Fallback: Automatically routes requests from Subscription $\rightarrow$ Cheap $\rightarrow$ Free models to ensure zero downtime.
- RTK Token Saver: Compresses tool outputs (e.g.,
git diff,ls,grep) to save 20-40% of input tokens. - Universal Compatibility: Translates formats between OpenAI, Claude, Gemini, and others to work with any OpenAI-compatible CLI tool.
- Wide Provider Support: Connects to over 40 API providers and 100+ models, including OAuth and free providers.
- Quota Tracking: Provides real-time token counts and reset countdowns to maximize subscription usage.
- Prompt Injection: Includes modes like "Caveman" and "Ponytail" to force LLMs to be more terse and write minimal code, saving output tokens.
Sources
- undefineddecolua/9router