9Router logo

9Router

Visit

Free MIT AI router and token saver that connects Claude Code, Codex, Cursor, and Cline to 40+ providers with auto-fallback and RTK token compression.

Share:

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/v1 works 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_result content 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

  1. Free and MIT: No subscription fee for the router itself, unlike hosted gateways.
  2. Zero-downtime fallback: Subscription, cheap, then free means your coding session does not stop when one provider hits a limit.
  3. Token savings built in: RTK compression attacks the token cost of large tool outputs, not just routing.

Getting Started

Quick Start Guide

  1. Install with npm install -g 9router.
  2. Run 9router. The dashboard opens at http://localhost:20128.
  3. Connect a free provider from the dashboard, such as Kiro AI or OpenCode Free. No signup is needed for these.
  4. Point your coding tool's base URL at http://localhost:20128/v1 and use the dashboard API key.
  5. 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

  1. Read the free-tier methodology: some pools are ToS-flagged. Do not assume every listed provider is allowed for your use case.
  2. Start with one coding agent: prove fallback and token savings on Claude Code or Codex before moving your whole stack.
  3. 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!