AB
AiBoss
project

9Router - An open-source AI-powered programmable routing proxy tool with an intelligent scheduling model.

9Router is an open-source AI programming routing proxy tool that can unify the access of mainstream AI programming tools such as Claude Code, Codex, Cursor, and Cline to the local proxy layer, and intelligently schedule 40+ vendors and 100+ models.

What is 9Router?

9Router is an open-source AI programming routing proxy tool that unifies the access of mainstream AI programming tools such as Claude Code, Codex, Cursor, and Cline to a local proxy layer, intelligently scheduling 40+ vendors and 100+ models. The tool features a built-in three-layer fallback routing and RTK token compression engine, automatically and seamlessly switching when subscription limits are exhausted, saving an average of 20%-40% of input tokens. It also includes a visual dashboard to track consumption and costs in real time, ensuring zero interruption to development tasks.

9Router's main functions

  • Intelligent Layer 3 RouterAutomatically downgrades and switches in the order of "subscription quota → cheap API → free channel", and seamlessly takes over when the quota is exhausted.
  • RTK Token CompressionIt has a built-in Rust-written token compression engine that automatically reduces the output of tools such as git diff, grep, and ls, saving 20%-40% of the input tokens.
  • Caveman Mode (Simplified Mode)Injecting concise prompts makes AI responses more refined, saving up to 65% of output tokens.
  • Unified management of multiple suppliersSupports OAuth or API Key access to 60+ AI vendors, including Claude, OpenAI, GLM, MiniMax, Kiro, etc.
  • Real-time quota trackingA visual dashboard monitors each supplier's token consumption, remaining credit, reset countdown, and estimated costs.
  • Automatic format conversionAutomatic translation between OpenAI, Claude, Gemini, Cursor, Kiro and other formats, compatible with any CLI tool.
  • Multi-account pollingMultiple accounts can be added for the same supplier, supporting automatic polling and failover.
  • Request log synchronization with cloudSupports debug logging and allows for cross-device configuration synchronization.

9Router's technical principles

  • Local proxy layer architecture9Router is used as a local proxy server (default). localhost:20128All AI programming tool requests pass through this layer before being distributed to backend vendors.
  • Layer 3 fallback routing algorithmBased on quota status and error codes, automatic decision-making is implemented. The first layer prioritizes consuming subscription quota, the second layer switches to the cost-effective API, and the third layer provides a fallback to free services.
  • RTK pre-filterBefore requesting format conversion, the RTK engine scans... tool_result The first 1KB of content is automatically compressed using filters such as git-diff, grep, and tree for lossless compression.
  • Format translation middlewareIt converts OpenAI standard formats to native protocols such as Claude, Gemini, and Kiro in real time, decoupling the tools from the vendors.
  • OAuth automatic renewalAutomatically refresh the access token for the subscription service to avoid manually logging in again.

How to use 9Router

  • Installation and startup:implement npm install -g 9router Install globally, then run. 9router Activating the local agent service will automatically open the dashboard in your browser.http://localhost:20128).
  • Connecting suppliersAccess the "Providers" page of the dashboard, log in via OAuth or enter the API Key to connect to 60+ providers such as Claude, OpenAI, and GLM. You can start directly connecting to Kiro AI or OpenCode Free at zero cost.
  • Create a combinationAdd models by priority on the "Combination" page, for example, add the subscription layer first. cc/claude-opus-4-7The cheapest layer glm/glm-5.1The last free layer kr/claude-sonnet-4.5This enables automatic rollback.
  • Configure CLIChange the API base URL of tools such as Claude Code, Codex, and Cursor to... http://localhost:20128/v1And enter the API Key generated by the dashboard.
  • Start codingAfter configuration, all AI requests are automatically routed through 9Router's intelligent routing, and seamlessly switch to the lower-level model when the subscription quota is exhausted, all in a transparent and imperceptible manner.

9Router's core advantages

  • Zero-stop codingThe three-tier automatic rollback ensures that development is not interrupted when the quota is exhausted, without the need to manually switch tools or wait for a reset.
  • Significant cost reductionThe combination of RTK compression, simplified mode, and free/cheap tiers can reduce monthly AI programming costs to near zero.
  • One-stop managementManage all subscriptions, API keys, and free accounts in one dashboard, eliminating the need for manual switching between multiple platforms.
  • Transparent and controllableReal-time cost estimation and quota tracking help users maximize the value of every subscription.
  • Wide compatibilitySupports 10+ mainstream CLI/IDE tools such as Claude Code, Codex, Cursor, Cline, OpenClaw, and GitHub Copilot.

9Router project address

  • Project official websitehttps://9router.com/
  • GitHub repositoryhttps://github.com/decolua/9router

Comparison of 9Router with similar competing products

Comparison Dimensions 9Router OpenRouter LiteLLM
position Local routing proxy for AI programming tools Unified API Gateway in the Cloud Enterprise-grade LLM proxy and load balancer
Deployment method Local / Docker / VPS / Cloudflare Workers Pure cloud SaaS On-premises/cloud, enterprise-oriented deployment
Number of suppliers 60+ (including OAuth subscriptions + API Keys + free tier) 200+ models 100+ models/suppliers
Programming tool integration Deeply adapts to CLIs such as Claude Code, Codex, and Cursor. General API, requires manual configuration General SDK/Proxy, Enterprise-level Integration
Token compression Built-in RTK engine, automatically saves 20%-40% No built-in compression No built-in compression
Three-layer back Subscription → Cheap → Free, automatic and seamless switching. It supports Fallback, but lacks a layered strategy. Supports Fallback and Retry Strategies
Quota Tracking Real-time dashboard with reset countdown Basic usage statistics Enterprise-level monitoring and alerting
Cost optimization Designed specifically for cost reduction by individual developers Pay-as-you-go billing, no free tier aggregation Corporate Budget Control and Rate Limitation
Open source license Open source and free Partially open source Open source (MIT)

9Router application scenarios

  • Multiple subscribersIt also offers subscriptions to Claude Pro, Codex Plus, Cursor, etc., and avoids wasted quotas and interrupted limits through intelligent scheduling.
  • Zero-cost developersIt enables completely free AI-assisted programming by using only free layers such as Kiro AI, OpenCode Free, and Vertex AI.
  • High-frequency coding sprint: 24/7 uninterrupted coding is required during the project deadline, relying on multiple rollbacks to ensure continuity.
  • Token-sensitive projectsWhen dealing with large codebases, RTK compression significantly reduces the token overhead of git diff and log requests.
  • Team/Multi-device CollaborationBy synchronizing with cloud and deploying via VPS/Docker, a unified AI vendor configuration and routing strategy can be shared within the team.