
What is 9Router?
9Router is an open-source proxy running on your machine, bringing AI programming tools like Claude Code, Codex, Cursor, Cline to many model providers through a single OpenAI-compatible API address. According to the GitHub repository (read on 25/10/2026), the project is MIT licensed, has around 31.4 thousand stars, installs via npm install -g 9router, has a dashboard, "combo" that automatically switches to the next model when one hits rate limits or fails, and tracks limits and usage. This is also the tool OPCAIOS uses internally as our AI gateway, so this post includes quite a bit of real experience. For example, someone using Claude Code (Anthropic) and Cursor can bring both together at one local address. The post has four parts:
- First, what 9Router is and how it works, supported providers.
- Next, how to install.
- Then, important risks (gateway security and provider terms) and when to use it versus OpenRouter or calling directly.
- Finally, how we use it.

One local address, many models, automatic failover; gateway security is your job. Diagram: OPCAIOS.
What is 9Router and how does it work?
9Router is a local proxy acting as a bridge between AI programming tools and many model providers. How it works, according to the README on GitHub (read on 25/10/2026): 9Router runs on the user's machine and opens an OpenAI-standard API along with a dashboard on the same port. How it works has three parts:
- First is combo: a list of models in priority order across many providers. When the first model hits rate limits or reports an error, 9Router switches to the next model, so the tool above doesn't need to know.
- Compatibility: translates between API formats of OpenAI, Claude (Anthropic), Gemini (Google) and others. The project supports multiple accounts for the same provider and auto-refreshes OAuth tokens.
- Tracking: limits and current usage show in the dashboard. Plus optional token-saving modes (RTK compresses tool output; Headroom, Caveman, Ponytail adjust input or output).
For example, when Claude Code's rate limit runs out, combo switches to a backup model without needing to change the tool's config. The cost level in the dashboard is just an estimate for comparison, not a bill. To understand the standard API interface, see What is API?; multi-model gateway as a cloud service see What is OpenRouter?.
Supported providers
According to the GitHub repository:
| Group | Example |
|---|---|
| OAuth login (subscriptions) | Claude Code, Codex, GitHub Copilot, Cursor, Antigravity |
| Free | Kiro AI (around 50 credit per month), OpenCode Free, Vertex AI (new account credit) |
| API keys (40+) | OpenRouter, OpenAI, Anthropic, Gemini, DeepSeek, Groq, plus custom OpenAI or Anthropic-compatible endpoints |
The project notes some old free plans (iFlow, Qwen Code, Gemini CLI) have stopped or changed, so old guides may be outdated.
How to install 9Router?
9Router is an npm package so it installs in a few commands, and can run via Docker. According to the decolua/9router repository (read on 25/10/2026), basic steps are:
- Install Node.js, run
npm install -g 9routerthen9router; or use Docker imagedecolua/9router(Docker Hub,ghcr.io/decolua/9router); see What is Docker?. - Open the dashboard, add providers (OAuth login or enter API key).
- Create combo in priority order. For example: best model comes first, cheap or free model as backup.
- Point tools like Claude Code (Anthropic) or Cursor to 9Router's local address instead of the provider's address.
- Track usage and set access keys for the gateway.
After installing, the first thing to do is set a password and private key, since the default config is not meant for an open gateway (details in the security section below).
What risks does 9Router have?
The biggest risk is that an AI gateway holding OAuth keys and tokens gets exposed to the Internet, and the second risk is the provider's terms of service. For example, a stranger could use up the rate limits for OpenAI or Anthropic keys stored in the gateway. Below is the full list, based on the README on GitHub (read on 25/10/2026) and our observations:
- Gateway security: set a password and private keys, don't expose to the Internet unless necessary.
- Provider terms of service: routing personal subscription logins (Claude, Codex, Copilot…) through a third-party proxy may violate the provider's terms or lead to account lockout. We haven't cross-checked the terms from each vendor; please read them yourself before using, and prioritize official API keys for business.
- Single point of failure: all tools depend on one gateway; if the gateway goes down, everything stops. Need monitoring.
- Secrets live in the gateway: protect the machine running the gateway and back up safely.
- Cost figures are estimates: don't treat the dashboard as an invoice.
- Quick guides get outdated: providers change free plans frequently.
When should you use 9Router?
| Situation | Recommendation |
|---|---|
| Using many AI tools from many providers, want one address and failover | 9Router fits |
| Want to control the gateway yourself, data doesn't go through intermediaries | Fits (but you handle security) |
| Just want to try many models quickly, don't want to run it yourself | Cloud service like OpenRouter |
| One model, one provider, light use | Call the provider directly |
| Business needs strict terms compliance | Use official API keys, avoid routing personal subscriptions |
OPCAIOS experience
This is what we know best. Our internal AI gateway is 9Router, in two versions:
- First is the local version running on the Mac we operate. When listing models on 25/10/2026, the gateway returned 765 items. Among them, 9 items declared image generation capability.
- Next is the version on our private server. According to operational documentation and source code, Paperclip and Hermes Agent use this version. The AI article writer in the website admin panel calls the gateway via the standard OpenAI API. In the AI connection section, this is the only provider actually calling AI; the other options are just sample templates.
Gateway access keys live on the server side, not in code or posts, and a previous security audit handled closing unnecessary public ports. We don't have metrics on cost savings or failover combo rates, and we haven't cross-checked each provider's terms for subscription routing, so we don't recommend that approach for business.
Read more: Running multiple AI models through one gateway; "Pulling the plug" scenario.
Frequently Asked Questions
What is 9Router?
It's an open-source proxy that runs locally, routing AI tools from many providers through a single OpenAI-standard API, with fallback options and rate limit tracking.
Is 9Router free?
The software is free under MIT license; you still pay for model costs, except for free tiers from providers.
How is 9Router different from OpenRouter?
9Router is open-source MIT-licensed software that runs on your machine, while OpenRouter is a paid cloud service platform. According to OpenRouter's pricing page (checked 25/10/2026), the service offers over 500 models from more than 80 providers and charges a 5.5% platform fee on standard credit purchases. The two differ in three ways:
- Where it runs: 9Router runs on your machine; OpenRouter runs on their infrastructure, so requests and data go through a middleman.
- Cost: 9Router charges no platform fee, you only pay model costs; OpenRouter charges 5.5% when buying credits.
- Responsibility: with 9Router, gateway security is your job; with OpenRouter, you read their data policy.
For example, if a user wants to try many models quickly without running their own infrastructure, they'd pick OpenRouter. See What is OpenRouter?.
Is using 9Router with Claude or Codex subscription plans legal?
We haven't reviewed the terms and there's risk of account lockout; please read your provider's terms, and prefer using official API keys.
What should I know about security?
The first thing to do is set a password and private key for the gateway, since it holds API keys and OAuth tokens. The code repository recommends the following steps, per the README on GitHub (checked 25/10/2026):
- Set
INITIAL_PASSWORD; if not set, the README states the default password is very weak. - Change default secrets (
API_KEY_SECRET,MACHINE_ID_SALT, JWT secret). - Enable
REQUIRE_API_KEYwhen exposing to the Internet andAUTH_COOKIE_SECURE=truebehind HTTPS.
For example, a gateway running on a private server should sit behind authentication, with an access IP allowlist. OPCAIOS's principle: don't expose an AI gateway to the Internet unless you need to; if you must, put it behind authentication and an allowlist. To learn how to build secure AI infrastructure, see OPCAIOS's AI application training course.
Source: decolua/9router GitHub repository, checked 25/10/2026; star count and provider list change rapidly; we have not reviewed provider terms regarding subscription routing. Experience is OPCAIOS's based on source code, documentation, and direct testing.
Translated from Vietnamese with AI. Read the original.
Want to apply this in your business?
Book a free 30-minute call (Vietnam time, in English or Vietnamese).


