SuperAPI AI Directory

9Router - Open-source AI coding routing proxy tool, intelligently schedules models

Author: AI小集 · Original source: AI工具集

What is 9Router

9Router is an open-source AI codingrouting proxy tool that can connect mainstream AI coding tools such as Claude Code、Codex、Cursor、Cline into a unified local proxy layer, intelligently scheduling 40+ providers and 100+ models. The tool features a three-tier fallback routing and RTK Token compression engine that automatically switches seamlessly when subscription quotas are exhausted, saving an average of 20%-40% of input Tokens, and comes with a visual dashboard to track consumption and costs in real time, ensuring zero interruption of development tasks.

9Router

Main Features of 9Router

  • Intelligent Three-Tier Routing: Automatically falls back and switches in the order of "subscription quota -> low-cost API -> free channels", seamlessly taking over when quotas are exhausted.
  • RTK Token Compression: Built-in Token compression engine written in Rust, automatically streamlines tool outputs such as git diff, grep, ls, saving 20%-40% of input Tokens.
  • Caveman Mode: Injects streamlined style prompts to make AI replies more concise, saving up to 65% of output Tokens.
  • Unified Multi-Provider Management: Supports OAuth or API Key access to 60+ AI providers, including Claude, OpenAI, GLM, MiniMax, Kiro, etc.
  • Real-Time Quota Tracking: Visual dashboard monitors each provider's Token consumption, remaining quota, reset countdown, and estimated cost.
  • Automatic Format Conversion: Automatically translates between formats such as OpenAI, Claude, Gemini, Cursor, Kiro, compatible with any CLI tool.
  • Multi-Account Rotation: Multiple accounts can be added for the same provider, supporting automatic rotation and failover.
  • Request Logging and Cloud Sync: Supports debug log recording and cross-device configuration sync.

Technical Principles of 9Router

  • Local Proxy Layer Architecture: 9Router acts as a local proxy server (default localhost:20128), and all AI coding tool requests first pass through this layer before being distributed to backend providers.
  • Three-Tier Fallback Routing Algorithm: Automatically makes decisions based on quota status and error codes. The first tier prioritizes consuming subscription quota, the second tier switches to cost-effective APIs, and the third tier falls back to free services.
  • RTK Pre-Filtering: Before requests enter format conversion, the RTK engine scans tool_result the first 1KB of content, automatically matching filters such as git-diff, grep, tree for lossless compression.
  • Format Translation Middleware: Converts OpenAI standard format to native protocols such as Claude, Gemini, Kiro in real time, decoupling tools from providers.
  • OAuth Auto-Renewal: Automatically refreshes access tokens for subscription services, avoiding manual re-login.

How to Use 9Router

  • Install and Start: Execute npm install -g 9router for global installation, then run 9router to start the local proxy service. The dashboard will automatically open in the browser (http://localhost:20128)。
  • Connect Providers: Go to the dashboard "Providers" page, log in via OAuth or fill in API Key to access 60+ providers such as Claude, OpenAI, GLM, etc. To start at zero cost, you can directly connect to Kiro AI or OpenCode Free.
  • Create Combinations: On the "Combinations" page, add models by priority, for example, first the subscription tier cc/claude-opus-4-7, then the cheap tier glm/glm-5.1, and finally the free tier kr/claude-sonnet-4.5, enabling automatic fallback.
  • Configure the CLI: change the API Base URL of tools such as Claude Code, Codex, and Cursor to http://localhost:20128/v1, and enter the API Key generated by the dashboard.
  • Start coding: once configuration is complete, all AI requests are automatically intelligently routed through 9Router, seamlessly switching to lower-tier models when subscription quota is exhausted, fully transparent and imperceptible throughout.

9Router's core advantages

  • Zero-downtime coding: three-tier automatic fallback ensures development is not interrupted when quota is exhausted, with no need to manually switch tools or wait for a reset.
  • Significant cost reduction: the combination of RTK compression + streamlined mode + free/cheap tiers can push monthly AI programming costs close to zero.
  • One-stop management: manage all subscriptions, API Keys, and free accounts in a single dashboard, saying goodbye to manual switching across multiple platforms.
  • Transparent and controllable: real-time cost estimation and quota tracking help users maximize the value of every subscription.
  • Broad compatibility: supports 10+ mainstream CLI/IDE tools such as Claude Code, Codex, Cursor, Cline, OpenClaw, and GitHub Copilot.

9Router's project address

  • Project website:https://9router.com/
  • GitHub repository:https://github.com/decolua/9router

Comparison of 9Router with similar competitors

Comparison dimension 9Router OpenRouter LiteLLM
Positioning Local routing proxy for AI programming tools Cloud-based unified API gateway Enterprise-grade LLM proxy and load balancing
Deployment method Local / Docker / VPS / Cloudflare Workers Pure cloud SaaS Local/cloud, leaning toward enterprise deployment
Number of providers 60+ (including OAuth subscriptions + API Key + free tier) 200+ models 100+ models/providers
Programming tool integration Deeply adapted to CLIs such as Claude Code, Codex, and Cursor General API, requires manual configuration General SDK/Proxy, enterprise-grade integration
Token compression Built-in RTK engine, automatically saves 20%-40% No built-in compression No built-in compression
Three-tier fallback Subscription → cheap → free, automatic and seamless switching Supports Fallback, but no tiered strategy Supports Fallback and retry strategies
Quota tracking Real-time dashboard, including reset countdown Basic usage statistics Enterprise-grade monitoring and alerting
Cost optimization Designed specifically to reduce costs for individual developers Pay-as-you-go billing, no free-tier aggregation Enterprise budget control and rate limiting
Open-source license Open source and free Partially open source Open source (MIT)

Use cases for 9Router

  • Multi-subscription users: Users with subscriptions to Claude Pro, Codex Plus, Cursor, etc. at the same time, using intelligent scheduling to avoid wasted quota and interruptions from hitting limits.
  • Zero-cost developers: Users who only use free tiers such as Kiro AI, OpenCode Free, and Vertex AI to achieve completely free AI-assisted programming.
  • High-frequency coding sprints: During project deadlines, 24/7 uninterrupted coding is required, relying on multi-layer fallback to ensure continuity.
  • Token-sensitive projects: When handling large codebases, RTK compression greatly reduces the Token overhead of git diff and log-type requests.
  • Team/multi-device collaboration: Through cloud sync and VPS/Docker deployment, share unified AI provider configurations and routing policies within the team.