9Router
github.com/decolua/9router- Category
- Developer Tools
- Rank
- No. 739Tools index
Previous survey · No. 727 ·
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Models: Train & Run
- Interfaces
- API · Web
- Builder
- decolua
- GitHub
- 31.3k stars
- Latest release
- v0.5.35
- Date
About
A self-hosted gateway that connects AI coding clients to multiple model providers. It combines request-format translation, quota tracking, provider fallback, and optional tool-output compression behind a local API and dashboard. Provider access and usage charges depend on the connected accounts.
What it does
9Router runs on your own machine and sits between a coding assistant such as Claude Code, Codex or Cursor and the services that actually answer. You point the assistant at one OpenAI-style endpoint on port 20128 with a key copied from the web panel. The router rewrites each request into whatever shape the chosen backend expects, picks a logged-in account, and when that account hits a limit it cools it down and tries the next account or the next model in a sequence you define. It can also shrink long command output before sending it upstream.
Why it's ranked here
The breadth is real and visible in the code: roughly thirty specialised backend adapters, from Kiro and Cursor to Vertex, Ollama and Windsurf, plus a generic one for anything else. Failure handling is concrete rather than promised: a written table of error texts and HTTP codes sets cooldowns, with exponential backoff capped at five minutes. MIT licensed, installable from npm or Docker. The caveat is that much of the free access it advertises comes from reusing consumer subscriptions in ways those vendors may not sanction.
What's good
Translation goes direct when a converter exists for the exact pair, instead of always pivoting through the OpenAI format, which avoids a lossy double hop. The output shrinker is conservative: it skips error results, ignores tiny or oversized text, and throws away any result that is empty or not smaller than the original. Remote access to the API needs a key, while routes that spawn processes or read host secrets are restricted to loopback requests carrying a matching origin.
Tradeoffs
Several mechanisms are aimed at getting around vendor controls. Client tool names are renamed for Claude OAuth tokens, labelled anti-ban in the code, and one Google endpoint is rewritten to a development host because production is rate limited. An optional interception mode generates its own root certificate and forwards traffic with certificate checks turned off. State, including provider tokens, lives in plain JSON files under the home directory. The command-line launcher binds to all network interfaces by default.
How to use it well
Fits a developer juggling several paid coding subscriptions and API keys who wants one endpoint and automatic failover between them. Set up a model sequence so a cheaper fallback takes over when the main account runs dry, and keep a login password on the web panel. Pass a host flag to bind locally if the machine sits on a shared network. Read each provider's terms before connecting a consumer account, and skip the interception mode unless you understand the certificate it installs.
Technical notes+
open-sse/translator/index.js translateRequest checks requestRegistry for a direct source:target translator before falling back to source to openai to target, and applies cloakClaudeTools only when a provider has the cloakToolsOnOAuth quirk and the key contains sk-ant-oat. open-sse/executors/index.js maps provider ids to specialised executors and caches a DefaultExecutor otherwise. open-sse/config/errorConfig.js orders ERROR_RULES text-first, then by status, with BACKOFF_CONFIG base 2000 ms, max 300000 ms, and MAX_RATE_LIMIT_COOLDOWN_MS of 30 minutes. open-sse/rtk/index.js compressText bails below MIN_COMPRESS_SIZE or above RAW_CAP. src/dashboardGuard.js gates LOCAL_ONLY_PATHS via isLocalRequest. src/mitm/server.js uses HOST_REWRITE and rejectUnauthorized false. cli/cli.js sets DEFAULT_HOST to 0.0.0.0.
Observed
- License
- MIT
- Language
- JavaScript (Node.js, Next.js)
- Install
- npm global package or Docker image; repository package itself is private and run from source
- Interface
- OpenAI-compatible HTTP API plus web dashboard and CLI launcher
- Default port
- 20128
- Storage
- Local JSON files for state and usage in the home data directory
- Default bind address
- 0.0.0.0 in the CLI launcher
- Optional component
- HTTPS interception proxy that generates its own root CA
Read from README.md, package.json, LICENSE, docs/ARCHITECTURE.md, open-sse/index.js, open-sse/executors/index.js, open-sse/providers/index.js, open-sse/translator/index.js, open-sse/rtk/index.js, src/mitm/server.js, cli/cli.js, src/dashboardGuard.js, open-sse/config/errorConfig.js.
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.