Skip to content

Guide · Open source

How to use 9router: install, connect your AI tools and tips

Updated · written with AI from the project's own documentation and checked against our catalogue data

9Router is an open-source local router that sits between your AI coding tools and AI providers. This guide shows you how to install it, connect a tool to its local endpoint, and understand what its limits are. You will be able to run it on your own computer and point a compatible tool at it.

9Routerdecolua/9router · ★ 31.8k · MIT

Quick start

  1. 1Check prerequisites. Make sure Node.js and npm are installed on your computer.
  2. 2Install 9Router. Run npm install -g 9router in your terminal.
  3. 3Start the router. Run 9router. The dashboard runs at http://localhost:20128.
  4. 4Connect a provider. In the dashboard, open Providers and connect a provider such as OpenCode Free or Kiro AI.
  5. 5Copy the endpoint and key. Use http://localhost:20128/v1 as the endpoint and copy the API key from the dashboard.
  6. 6Set the model in your tool. In Claude Code, Codex, Cursor or Cline, enter the endpoint, key and a model name shown in 9Router.

What you need before you install 9Router

9Router is installed with npm, so you need Node.js and npm on your computer. The README lists these as the prerequisites.

You also need accounts or API keys for whichever providers you plan to use. The README says 9Router forwards requests to 40+ providers, so it does not replace having access to them.

  • Node.js
  • npm
  • Accounts or API keys for the providers you want to route to

Install 9Router globally with npm

Install the package globally with npm, then start it from the terminal. The README gives these two commands.

npm install -g 9router 9router

Open the dashboard and connect a provider

When 9Router starts, the dashboard is served at http://localhost:20128. The README describes a free option for a first test: in the dashboard, go to Providers and connect Kiro AI or OpenCode Free. The README says Kiro AI gives about 50 credits per month and OpenCode Free needs no auth.

The README notes that free tiers and credits have limits, so treat them as a starting point rather than unlimited access.

  • Dashboard: http://localhost:20128/dashboard
  • Providers section: connect a provider from the dashboard

Point your coding tool at the local endpoint

In your tool's settings, set the endpoint to the OpenAI-compatible URL, paste the API key shown in the dashboard, and choose a model. The README gives Claude Code, Codex, OpenClaw, Cursor and Cline as examples. The model name in the example is a 9Router model identifier, so copy the exact name from the dashboard or README rather than guessing.

  • Endpoint: http://localhost:20128/v1
  • API Key: copy from the dashboard
  • Model: use the name shown for your chosen provider
Endpoint: http://localhost:20128/v1 API Key: [copy from dashboard] Model: kr/claude-sonnet-4.5

Run from source instead of npm

The README also describes running the repository from source. It says the repository package is private (9router-app), so source or Docker execution is the expected path for local development. Copy the example env file, install dependencies and start the dev server with the port and base URL set.

For production, the README lists a build process that uses a temporary swap file on low-memory machines. Only follow those steps if you need a source build.

  • Default dashboard: http://localhost:20128/dashboard
  • Default API: http://localhost:20128/v1
cp .env.example .env npm install PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev

How 9Router saves tokens and handles limits

The README says RTK Token Saver compresses tool_result content, which it claims saves 20-40% of tokens per request. It also describes auto-fallback that moves from a subscription to cheaper models to free models when a tier is exhausted or a budget limit is hit.

These are claims from the README. Check your own usage to see what you actually save.

  • RTK Token Saver: compresses tool output such as git diff, grep and ls results
  • Auto fallback: subscription, then cheap, then free tier
  • Multi-account: round-robin between accounts per provider
  • Quota tracking across providers

What people use it for

  • Using a coding assistant with one local endpoint for several AI providers
  • Using up subscription quota before it resets by routing requests through 9Router
  • Falling back to cheaper or free models when a primary subscription runs out
  • Trimming tool output tokens during long coding sessions with RTK Token Saver

Frequently asked questions

Is 9Router free?

9Router is released under the MIT licence, as listed in the repository. The providers it connects to have their own pricing, and the README notes that free tiers and credits have limits, so free use is not unlimited.

What do I need to install 9Router?

The README lists Node.js and npm as prerequisites. Install it globally with npm install -g 9router, then run 9router.

What address does the 9Router dashboard use?

The README says the dashboard runs at http://localhost:20128, with the dashboard path at /dashboard and the OpenAI-compatible API at http://localhost:20128/v1.

Which tools work with 9Router?

The README lists Claude Code, Codex, Cursor, Cline, GitHub Copilot, Antigravity, OpenCode and OpenClaw, among others. Any tool that lets you set a custom OpenAI-compatible endpoint should be able to use it.

How is 9Router different from LiteLLM or OpenRouter?

LiteLLM and OpenRouter are also used to route requests across model providers. 9Router runs on your own machine and focuses on coding tools, token saving and quota use, according to its README. Compare features and setup before choosing.

Does 9Router guarantee uptime?

No. The README describes no uptime guarantee or enterprise support, so it may not suit teams that need those commitments.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

9Router suits developers who already use AI coding tools, have several subscriptions or accounts, and are willing to set up providers and model names by hand. It is a poor fit if you need guaranteed uptime, enterprise support, or do not want to manage API keys and provider accounts.

Install options & downloads