# 9Router

> A free, open-source AI router that auto-routes coding requests to 40+ AI providers with smart 3-tier fallback, quota tracking, and format translation for tools like Claude Code, Cursor, and Copilot.

9Router is a free, open-source local proxy that connects AI coding tools to 40+ AI providers and 100+ models with intelligent 3-tier fallback routing. It automatically switches between subscription, cheap, and free providers so you never hit a rate limit mid-coding session. Installed via npm and running locally on port 20128, it exposes an OpenAI-compatible API endpoint that any CLI tool can point to. The dashboard provides real-time quota tracking, usage analytics, and combo management across all connected providers.

- **Smart 3-Tier Fallback** — *Auto-routes requests through Subscription → Cheap → Free tiers; configure combos like `cc/claude-opus-4-6 → glm/glm-4.7 → if/kimi-k2-thinking` to ensure zero downtime.*
- **Real-Time Quota Tracking** — *Monitors token consumption and reset countdowns (5-hour, daily, weekly) per provider so you maximize every subscription.*
- **Format Translation** — *Seamlessly translates between OpenAI, Claude, and Gemini API formats so any CLI tool works with any provider without reconfiguration.*
- **Multi-Account Round-Robin** — *Add multiple accounts per provider for load balancing and automatic failover when one account hits its quota.*
- **Auto Token Refresh** — *OAuth tokens for Claude Code, Codex, Gemini CLI, and other OAuth providers refresh automatically with no manual re-authentication.*
- **Custom Combos** — *Create and name unlimited model combinations mixing subscription, cheap, and free tiers; sync them across devices via Cloud Sync.*
- **40+ Provider Support** — *Connects to OpenRouter, OpenAI, Anthropic, Gemini, DeepSeek, Groq, xAI, Mistral, Together AI, Fireworks, Cerebras, Cohere, NVIDIA, SiliconFlow, and 20+ more via API key.*
- **Free Provider Integration** — *Built-in support for iFlow (8 models, unlimited), Qwen (3 models, unlimited), Kiro (Claude, unlimited), and Gemini CLI (180K/month free).*
- **Usage Analytics** — *Tracks tokens, estimated costs, and spending trends over time; displays a "savings tracker" showing how much you save using free models.*
- **Flexible Deployment** — *Run on localhost, VPS, Docker, or Cloudflare Workers; configure via environment variables with full Docker and PM2 support.*
- **Request Logging** — *Enable debug mode (`ENABLE_REQUEST_LOGS=true`) for full request/response logs to troubleshoot integrations.*
- **Universal CLI Compatibility** — *Works with Claude Code, Cursor, Codex, OpenCode, Cline, Continue, Roo, Copilot, Kilo Code, OpenClaw, Droid, and any tool supporting custom OpenAI endpoints.*

## Features
- Smart 3-tier fallback routing (Subscription → Cheap → Free)
- Real-time quota tracking with reset countdowns
- OpenAI ↔ Claude ↔ Gemini format translation
- Multi-account round-robin per provider
- Auto OAuth token refresh
- Custom model combos with unlimited configurations
- Cloud sync across devices
- Usage analytics and cost tracking
- Request/response debug logging
- 40+ API key providers supported
- Free provider integration (iFlow, Qwen, Kiro, Gemini CLI)
- Docker and VPS deployment support
- OpenAI-compatible API endpoint
- Dashboard UI at localhost:20128

## Integrations
Claude Code, Cursor, OpenAI Codex, GitHub Copilot, Gemini CLI, Cline, Continue, Roo, OpenClaw, OpenCode, Antigravity, Kilo Code, Droid, OpenRouter, Anthropic, OpenAI, Gemini, DeepSeek, Groq, xAI, Mistral, Perplexity, Together AI, Fireworks, Cerebras, Cohere, NVIDIA, SiliconFlow, GLM, MiniMax, Kimi, iFlow, Qwen, Kiro

## Platforms
WINDOWS, MACOS, LINUX, WEB, API, CLI

## Pricing
Open Source

## Version
v0.3.75

## Links
- Website: https://9router.com
- Documentation: https://github.com/decolua/9router
- Repository: https://github.com/decolua/9router
- EveryDev.ai: https://www.everydev.ai/tools/9router
