
# OmniRoute - Free AI Router
**Never stop coding. Auto-route to FREE & cheap AI models with smart fallback.**
**28 Providers β’ Embeddings β’ Image Generation β’ Think Tag Parsing**
**Free AI Provider for OpenClaw.**
> *This project is inspired by and originally forked from [9router](https://github.com/decolua/9router) by [decolua](https://github.com/decolua). Thank you for the incredible foundation!*
[](https://www.npmjs.com/package/omniroute)
[](https://github.com/diegosouzapw/OmniRoute/blob/main/LICENSE)
[π Quick Start](#-quick-start) β’ [π‘ Features](#-key-features) β’ [π Setup](#-setup-guide)
---
## π€ Why OmniRoute?
**Stop wasting money and hitting limits:**
- β Subscription quota expires unused every month
- β Rate limits stop you mid-coding
- β Expensive APIs ($20-50/month per provider)
- β Manual switching between providers
**OmniRoute solves this:**
- β
**Maximize subscriptions** - Track quota, use every bit before reset
- β
**Auto fallback** - Subscription β Cheap β Free, zero downtime
- β
**Multi-account** - Round-robin between accounts per provider
- β
**Universal** - Works with Claude Code, Codex, Gemini CLI, Cursor, Cline, any CLI tool
---
## π How It Works
```
βββββββββββββββ
β Your CLI β (Claude Code, Codex, Gemini CLI, OpenClaw, Cursor, Cline...)
β Tool β
ββββββββ¬βββββββ
β http://localhost:20128/v1
β
βββββββββββββββββββββββββββββββββββββββββββ
β OmniRoute (Smart Router) β
β β’ Format translation (OpenAI β Claude) β
β β’ Quota tracking + Embeddings + Images β
β β’ Auto token refresh β
ββββββββ¬βββββββββββββββββββββββββββββββββββ
β
βββ [Tier 1: SUBSCRIPTION] Claude Code, Codex, Gemini CLI
β β quota exhausted
βββ [Tier 2: API KEY] DeepSeek, Groq, xAI, Mistral, Together, etc.
β β budget limit
βββ [Tier 3: CHEAP] GLM ($0.6/1M), MiniMax ($0.2/1M)
β β budget limit
βββ [Tier 4: FREE] iFlow, Qwen, Kiro (unlimited)
Result: Never stop coding, minimal cost
```
---
## β‘ Quick Start
**1. Install globally:**
```bash
npm install -g omniroute
omniroute
```
π Dashboard opens at `http://localhost:20128`
**CLI Options:**
| Command | Description |
| ----------------------- | --------------------------------- |
| `omniroute` | Start server (default port 20128) |
| `omniroute --port 3000` | Use custom port |
| `omniroute --no-open` | Don't auto-open browser |
| `omniroute --help` | Show help |
| `omniroute --version` | Show version |
**2. Connect a FREE provider (no signup needed):**
Dashboard β Providers β Connect **Claude Code** or **Antigravity** β OAuth login β Done!
**3. Use in your CLI tool:**
```
Claude Code/Codex/Gemini CLI/OpenClaw/Cursor/Cline Settings:
Endpoint: http://localhost:20128/v1
API Key: [copy from dashboard]
Model: if/kimi-k2-thinking
```
**That's it!** Start coding with FREE AI models.
**Alternative: run from source (this repository):**
```bash
cp .env.example .env
npm install
PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev
```
Production mode:
```bash
npm run build
PORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run start
```
Default URLs:
- Dashboard: `http://localhost:20128/dashboard`
- OpenAI-compatible API: `http://localhost:20128/v1`
---
## π‘ Key Features
| Feature | What It Does | Why It Matters |
| -------------------------------- | ------------------------------------------ | ----------------------------------- |
| π― **Smart 3-Tier Fallback** | Auto-route: Subscription β Cheap β Free | Never stop coding, zero downtime |
| π **Real-Time Quota Tracking** | Live token count + reset countdown | Maximize subscription value |
| π **Format Translation** | OpenAI β Claude β Gemini seamless | Works with any CLI tool |
| π₯ **Multi-Account Support** | Multiple accounts per provider | Load balancing + redundancy |
| π **Auto Token Refresh** | OAuth tokens refresh automatically | No manual re-login needed |
| π¨ **Custom Combos** | Create unlimited model combinations | Tailor fallback to your needs |
| π§© **Custom Models** | Add any model ID to any provider | No app update needed for new models |
| π£οΈ **Dedicated Provider Routes** | Per-provider API endpoints | Direct routing, model validation |
| π **Network Proxy** | Hierarchical outbound proxy + env fallback | Works behind firewalls/VPNs |
| π **Model Catalog API** | All models grouped by provider + type | Discover available models easily |
| π **Request Logging** | Debug mode with full request/response logs | Troubleshoot issues easily |
| πΎ **Cloud Sync** | Sync config across devices | Same setup everywhere |
| π **Usage Analytics** | Track tokens, cost, trends over time | Optimize spending |
| π **Deploy Anywhere** | Localhost, VPS, Docker, Cloudflare Workers | Flexible deployment options |
| π‘οΈ **IP Allowlist/Blocklist** | Restrict API access by IP address | Security for exposed deployments |
| π§ **Thinking Budget** | Control reasoning token budget per model | Optimize cost vs quality |
| π¬ **System Prompt Injection** | Global system prompt for all requests | Consistent behavior across models |
| π **Session Tracking** | Track active sessions with fingerprinting | Monitor connected clients |
| β‘ **Rate Limiting** | Per-account request rate management | Prevent abuse and quota waste |
| π° **Model Pricing** | Per-model cost tracking and calculation | Precise usage cost analytics |