9Router on Railway

An OpenAI-compatible AI router and gateway with fallback and usage tracking, self-hosted on Railway.

Official site · License: MIT · 21 Railway templates

Deploy 9Router on RailwayCompare templates

9Router is an open-source AI router and gateway. It gives coding tools and apps one OpenAI-compatible endpoint, plus Anthropic- and Gemini-style routes, and forwards each request to the provider accounts and API keys you connect. It translates between API formats, can fall back to another provider or model when one fails, and tracks usage.

It is used by people who run several AI clients, such as Claude Code, Codex CLI, Cursor, Cline or Continue, and want one base URL and one key instead of configuring each provider in each tool. It can also front self-hosted models served through Ollama or any OpenAI-compatible server. A comparable hosted service is OpenRouter; the difference here is that the router and its stored provider credentials run on your own server.

9Router is released under the MIT licence.

What 9Router can do

  • One OpenAI-compatible endpoint plus Anthropic- and Gemini-style routes
  • Request format translation between OpenAI, Anthropic and Gemini styles
  • Fallback chains (combos) across providers and models
  • Usage and cost tracking in a dashboard
  • Password-protected dashboard and API key checks on /v1
  • Custom providers for Ollama or any OpenAI-compatible server

What people use it for

  • One base URL and key for several coding assistants
  • Automatic fallback when a provider rate-limits or fails
  • A shared AI gateway for internal tools and agents
  • Mixing hosted APIs with self-hosted models
  • Tracking AI usage across tools in one place

Videos

Claude Code + 9Router: How Do You Wire It Up? · Bryan Software
9 Router Setup: Connect FREE and Paid LLMs for AI Coding · Md Al Mamun

Running 9Router on Railway

The Railway template deploys a single 9Router service, pinned to a specific upstream image version, with a volume for its SQLite database. A dashboard password and an API key are generated at deploy time, and the /v1 API rejects requests without a valid key. Other services in the same Railway project can call it over the private network. The template documents about 0.1 GB of RAM at idle and near-zero CPU, so cost is mostly the small always-on service and the volume; the AI provider usage is billed by those providers.

9Router templates on Railway

9Router Self-Hosted AI Router and GatewayMaintained by Tracklayer
9Router is an open-source AI router and gateway that gives coding tools and apps one OpenAI-compatible endpoint, with Anthropic- and Gemini-style routes, and forwards requests to t
1 deployments
Deploy
9Router by codestorm
Self-hosted AI router for Claude, Gemini, Cursor & OpenAI tools.
9,741 deployments
Deploy
9Router — Self-Hosted AI Gateway for 60+ Providers by an independent creator
Route Claude Code & Cursor to 60+ LLM providers with fallback
223 deployments
Deploy
9router by A3A
Self-host 9router: OpenAI-compatible endpoint, 100+ models, fallback & more
190 deployments
Deploy
9Router V3 by codestorm
A self-hosted AI gateway: one endpoint, many providers, automatic fallback.
140 deployments
Deploy
9Router — AI Gateway by an independent creator
Self-hosted AI router for Claude Code, Cursor, Copilot & 60+ AI providers
63 deployments
Deploy
9router by an independent creator
Self-hosted AI router for Cursor, Claude, Gemini, OpenAI & 60+ AI providers
58 deployments
Deploy
9Router by an independent creator
9 Router Pro Stack: persistent 9router AI router with API keys and backups.
46 deployments
Deploy
9Router by an independent creator
Self-hosted AI router for Claude, Gemini, Cursor & OpenAI tools.
39 deployments
Deploy
9Router — Self-Hosted OpenRouter Alternative by an independent creator
Zero-markup OpenRouter alternative — self-host 60+ LLM providers
28 deployments
Deploy
9Router by an independent creator
9Router AI gateway: one OpenAI-compatible API for 40+ LLM providers
24 deployments
Deploy
9router [Updated Nov '26] by an independent creator
9Router [Nov '26] (Self-Hosted AI Gateway & LLM Router) Self Host
22 deployments
Deploy
9Router by an independent creator
Self-hosted AI gateway for Claude Code, Cursor & 40+ LLM providers
10 deployments
Deploy
9Router by an independent creator
AI gateway with provider routing, API keys and persistent SQLite.
7 deployments
Deploy
9Router by an independent creator
Route coding tools to 40+ AI providers with auto fallback
3 deployments
Deploy
9Router | Self-Hosted AI Gateway, Nothing to Configure by an independent creator
Self-hosted AI gateway. 40+ providers, one endpoint, nothing to configure.
2 deployments
Deploy
9Router Claude Code by an independent creator
Route Claude Code through 40+ providers with fallback
1 deployments
Deploy
9Router Docker by an independent creator
Pinned 9Router Docker image with a persistent volume
1 deployments
Deploy
9Router OpenCode by an independent creator
Point OpenCode CLI at your self-hosted AI router
1 deployments
Deploy
9router by an independent creator
9router | Production Self-Hosted Stack deployment stack
0 deployments
Deploy
9Router Aider by an independent creator
Run the Aider pair programmer through your own 9Router
0 deployments
Deploy

Tracklayer templates are listed first. Other 9Router templates follow, ordered by total deployments on Railway. How this works.

Deployment numbers as of 2026-11-20.

Questions about 9Router

Do I need my own provider accounts?

Yes. 9Router routes requests to the providers and API keys you add in its dashboard after deploy. It does not supply model access itself.

How do I log in and get the API key?

The dashboard password is in the INITIAL_PASSWORD variable and the API key is in NINEROUTER_API_KEY, both on the service's Variables tab. Change the password under Settings after the first login.

Is my data kept across redeploys?

Yes. Providers, keys, combos, settings and usage are stored in SQLite on a Railway volume. Treat the volume and its backups as secrets, because they hold provider credentials.

Can I run more than one replica?

No. The SQLite database lives on a single volume, so keep one replica.

How do I use it with Claude Code?

Set ANTHROPIC_BASE_URL to your service's public domain and ANTHROPIC_AUTH_TOKEN to the generated API key, as described in the template documentation.

Guides

Similar apps

Tracklayer maintains the templates marked as such; 9Router is a trademark of its owners and this site is not affiliated with them.