9Router
9Router is a free, MIT-licensed AI router that sits between your coding tools and model providers. Point Claude Code, Codex, Cursor, Cline, Copilot, Antigravity, Gemini CLI, OpenCode, or OpenClaw at one local endpoint, and it routes requests with quota-aware fallback: subscription first, cheap providers second, and free tiers last. It also ships RTK token compression, which the project says cuts eligible tool-result tokens by 20-40% per request. The repository was created January 5, 2026, and shows about 26K stars.
Key Features
- Universal endpoint: One OpenAI-compatible endpoint at
http://localhost:20128/v1works with Claude Code, Codex, Cursor, Cline, Copilot, Antigravity, Gemini CLI, OpenCode, and OpenClaw. - Three-tier auto-fallback: Subscriptions drain first, then cheap providers such as GLM ($0.6/1M) and MiniMax ($0.2/1M), then free tiers like Kiro and OpenCode Free, with zero downtime.
- RTK Token Saver: Auto-compresses
tool_resultcontent to save 20-40% of eligible tokens per request, which matters most on tool-heavy coding sessions. - Multi-account round-robin: Rotates between accounts per provider to maximize each subscription before reset.
- Format translation: Translates between OpenAI, Claude, Gemini, and Responses API formats so existing tools keep their native clients.
- Dashboard: A web UI on port 20128 shows quota, routing, and provider status.
Use Cases
- Coding-agent users: Keep Claude Code or Codex running after a subscription quota is exhausted.
- Cost-sensitive teams: Drain documented free tiers first, then fall back to cheap paid models.
- Self-hosters: Run the router on localhost and keep API keys on your machine.
- Multi-tool shops: Give Cursor, Cline, Copilot, and OpenCode the same model catalog without per-app routing.
Pricing
9Router itself is free and open source under the MIT license. npm install -g 9router starts the API and dashboard with no credit card. You pay only the upstream providers you actually use. The project flags free tiers that are rate-limited or ToS-constrained.
Advantages & Unique Selling Points
- Free and MIT: No subscription fee for the router itself, unlike hosted gateways.
- Zero-downtime fallback: Subscription, cheap, then free means your coding session does not stop when one provider hits a limit.
- Token savings built in: RTK compression attacks the token cost of large tool outputs, not just routing.
Getting Started
Quick Start Guide
- Install with
npm install -g 9router. - Run
9router. The dashboard opens athttp://localhost:20128. - Connect a free provider from the dashboard, such as Kiro AI or OpenCode Free. No signup is needed for these.
- Point your coding tool's base URL at
http://localhost:20128/v1and use the dashboard API key. - Confirm with
curl localhost:20128/v1/models.
Frequently Asked Questions
Is 9Router affiliated with Anthropic?
No. It is an independent open-source project that happens to route Anthropic-compatible traffic through a local proxy.
Does it store my prompts?
Treat it as self-hosted infrastructure: the process runs on your machine. Review the project's logging and privacy settings before pointing production traffic at it.
How is this different from OpenRouter?
OpenRouter is a hosted multi-model marketplace. 9Router is an open-source local gateway that can include free tiers and subscription accounts as routing targets, with token compression built in.
Alternatives
- OmniRoute: another free MIT gateway with 339 providers and quota-aware fallback.
- Free Claude Code: a local proxy focused on pointing Claude Code at 48 providers.
- OpenRouter: hosted catalog when you want someone else to operate the router.
Tips & Best Practices
- Read the free-tier methodology: some pools are ToS-flagged. Do not assume every listed provider is allowed for your use case.
- Start with one coding agent: prove fallback and token savings on Claude Code or Codex before moving your whole stack.
- Watch compression on tool-heavy runs: token savings are largest there, but always compare output quality on a known task.
Conclusion
9Router is a practical answer to "my coding agent just hit a limit." If you want one local endpoint with subscription-first, free-tier fallback routing and token compression, install it, connect a free provider, and point your existing tool at localhost:20128/v1.
Comments
No comments yet. Be the first to comment!
Related Tools
Free Claude Code
github.com/Alishahryar1/free-claude-code
MIT local gateway that points Claude Code, Codex, Pi, OpenCode, or Cline at 48 providers. Rechecked 45,953 GitHub stars on 2026-08-19.
OmniRoute
omniroute.online
Free MIT AI gateway with one endpoint, 339 providers, 90+ free tiers, quota-aware fallback, and token compression for Claude Code, Codex, and Cursor.
T3 Code
t3.codes
Open-source agent harness control surface for Claude Code, Codex, Cursor, Grok Build, and OpenCode with desktop, web, and mobile apps.
Related Insights

Anthropic Subagent: The Multi-Agent Architecture Revolution
Deep dive into Anthropic multi-agent architecture design. Learn how Subagents break through context window limitations, achieve 90% performance improvements, and real-world applications in Claude Code.
Stop Cramming AI Assistants into Chat Boxes: Clawdbot Picked the Wrong Battlefield
Clawdbot is convenient, but putting it inside Slack or Discord was the wrong design choice from day one. Chat tools are not for operating tasks, and AI isn't for chatting.
After I Connected Obsidian to OpenClaw, It Started Helping Me Make Decisions
Once Obsidian stopped being just a place to store notes and started working with OpenClaw, it began helping me organize context, connect information, and improve real decisions.