{"_id":"9router-custom","name":"9router-custom","dist-tags":{"latest":"0.3.55"},"versions":{"0.3.55":{"name":"9router-custom","version":"0.3.55","description":"9Router - AI API Router & Dashboard with multi-provider support","private":false,"license":"MIT","engines":{"node":">=18.0.0"},"scripts":{"dev":"next dev --webpack --port 20128","build":"NODE_ENV=production next build --webpack","start":"NODE_ENV=production next start","dev:bun":"bun --bun next dev --webpack --port 20128","build:bun":"NODE_ENV=production bun --bun next build --webpack","start:bun":"NODE_ENV=production bun ./.next/standalone/server.js"},"dependencies":{"@monaco-editor/react":"^4.7.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","confbox":"^0.2.4","express":"^5.2.1","fs":"^0.0.1-security","http-proxy-middleware":"^3.0.5","jose":"^6.1.3","lowdb":"^7.0.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^16.13.1","recharts":"^3.7.0","selfsigned":"^5.5.0","socks-proxy-agent":"^8.0.5","undici":"^7.19.2","uuid":"^13.0.0","zustand":"^5.0.10"},"devDependencies":{"@tailwindcss/postcss":"^4.1.18","eslint":"^9","eslint-config-next":"16.1.6","postcss":"^8.5.6","tailwindcss":"^4"},"_id":"9router-custom@0.3.55","gitHead":"38f83821270caef214223228e8becf4762a8b356","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-viqcEDEgGIhHdBc96D8w+NuKEMjK7h6tyd98Ur0LCVj9WrrRG2UwalIqNuf0wi1X35L8VElelulPcyBCZ+pqFQ==","shasum":"40cf6279c6123784de25bb4c0832391af2928af9","tarball":"https://registry.npmjs.org/9router-custom/-/9router-custom-0.3.55.tgz","fileCount":416,"unpackedSize":2598663,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE/0iFKeO9xgBPY5DVNj7y2Hg+nT0VLRdwqN/sVMV32vAiAntllJ1ZkbH+j9+FVbKnY00awuxqugKkvszQ34Ox/U5g=="}]},"_npmUser":{"name":"ninhnv","email":"ninh.buzzle@gmail.com"},"directories":{},"maintainers":[{"name":"ninhnv","email":"ninh.buzzle@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/9router-custom_0.3.55_1773744610198_0.06505055048074349"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-17T10:50:10.197Z","0.3.55":"2026-03-17T10:50:10.396Z","modified":"2026-03-17T10:50:10.628Z"},"maintainers":[{"name":"ninhnv","email":"ninh.buzzle@gmail.com"}],"description":"9Router - AI API Router & Dashboard with multi-provider support","license":"MIT","readme":"<div align=\"center\">\r\n  <img src=\"./images/9router.png?1\" alt=\"9Router Dashboard\" width=\"800\"/>\r\n  \r\n  # 9Router - Free AI Router\r\n  \r\n  **Never stop coding. Auto-route to FREE & cheap AI models with smart fallback.**\r\n  \r\n  **Connect All AI Code Tools (Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, OpenClaw...) to 40+ AI Providers & 100+ Models.**\r\n  \r\n  [![npm](https://img.shields.io/npm/v/9router.svg)](https://www.npmjs.com/package/9router)\r\n  [![Downloads](https://img.shields.io/npm/dm/9router.svg)](https://www.npmjs.com/package/9router)\r\n  [![License](https://img.shields.io/npm/l/9router.svg)](https://github.com/decolua/9router/blob/main/LICENSE)\r\n  \r\n  [🚀 Quick Start](#-quick-start) • [💡 Features](#-key-features) • [📖 Setup](#-setup-guide) • [🌐 Website](https://9router.com)\r\n\r\n  [🇻🇳 Tiếng Việt](./i18n/README.vi.md) • [🇨🇳 中文](./i18n/README.zh-CN.md)\r\n</div>\r\n\r\n---\r\n\r\n## 🤔 Why 9Router?\r\n\r\n**Stop wasting money and hitting limits:**\r\n\r\n- ❌ Subscription quota expires unused every month\r\n- ❌ Rate limits stop you mid-coding\r\n- ❌ Expensive APIs ($20-50/month per provider)\r\n- ❌ Manual switching between providers\r\n\r\n**9Router solves this:**\r\n\r\n- ✅ **Maximize subscriptions** - Track quota, use every bit before reset\r\n- ✅ **Auto fallback** - Subscription → Cheap → Free, zero downtime\r\n- ✅ **Multi-account** - Round-robin between accounts per provider\r\n- ✅ **Universal** - Works with Claude Code, Codex, Gemini CLI, Cursor, Cline, any CLI tool\r\n\r\n---\r\n\r\n## 🔄 How It Works\r\n\r\n```\r\n┌─────────────┐\r\n│  Your CLI   │  (Claude Code, Codex, Gemini CLI, OpenClaw, Cursor, Cline...)\r\n│   Tool      │\r\n└──────┬──────┘\r\n       │ http://localhost:20128/v1\r\n       ↓\r\n┌─────────────────────────────────────────┐\r\n│           9Router (Smart Router)        │\r\n│  • Format translation (OpenAI ↔ Claude) │\r\n│  • Quota tracking                       │\r\n│  • Auto token refresh                   │\r\n└──────┬──────────────────────────────────┘\r\n       │\r\n       ├─→ [Tier 1: SUBSCRIPTION] Claude Code, Codex, Gemini CLI\r\n       │   ↓ quota exhausted\r\n       ├─→ [Tier 2: CHEAP] GLM ($0.6/1M), MiniMax ($0.2/1M)\r\n       │   ↓ budget limit\r\n       └─→ [Tier 3: FREE] iFlow, Qwen, Kiro (unlimited)\r\n\r\nResult: Never stop coding, minimal cost\r\n```\r\n\r\n---\r\n\r\n## ⚡ Quick Start\r\n\r\n**1. Install globally:**\r\n\r\n```bash\r\nnpm install -g 9router\r\n9router\r\n```\r\n\r\n🎉 Dashboard opens at `http://localhost:20128`\r\n\r\n**2. Connect a FREE provider (no signup needed):**\r\n\r\nDashboard → Providers → Connect **Claude Code** or **Antigravity** → OAuth login → Done!\r\n\r\n**3. Use in your CLI tool:**\r\n\r\n```\r\nClaude Code/Codex/Gemini CLI/OpenClaw/Cursor/Cline Settings:\r\n  Endpoint: http://localhost:20128/v1\r\n  API Key: [copy from dashboard]\r\n  Model: if/kimi-k2-thinking\r\n```\r\n\r\n**That's it!** Start coding with FREE AI models.\r\n\r\n**Alternative: run from source (this repository):**\r\n\r\nThis repository package is private (`9router-app`), so source/Docker execution is the expected local development path.\r\n\r\n```bash\r\ncp .env.example .env\r\nnpm install\r\nPORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev\r\n```\r\n\r\nProduction mode:\r\n\r\n```bash\r\nnpm run build\r\nPORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run start\r\n```\r\n\r\nDefault URLs:\r\n- Dashboard: `http://localhost:20128/dashboard`\r\n- OpenAI-compatible API: `http://localhost:20128/v1`\r\n\r\n---\r\n\r\n## 🎥 Video Tutorial\r\n\r\n<div align=\"center\">\r\n  \r\n### 📺 Complete Setup Guide - 9Router + Claude Code FREE\r\n  \r\n[![9Router + Claude Code Setup](https://img.youtube.com/vi/raEyZPg5xE0/maxresdefault.jpg)](https://www.youtube.com/watch?v=raEyZPg5xE0)\r\n\r\n**🎬 Watch the complete step-by-step tutorial:**\r\n- ✅ 9Router installation & setup\r\n- ✅ FREE Claude Sonnet 4.5 configuration\r\n- ✅ Claude Code integration\r\n- ✅ Live coding demonstration\r\n\r\n**⏱️ Duration:** 20 minutes | **👥 By:** Developer Community\r\n\r\n[▶️ Watch on YouTube](https://www.youtube.com/watch?v=o3qYCyjrFYg)\r\n\r\n</div>\r\n\r\n---\r\n\r\n## 🛠️ Supported CLI Tools\r\n\r\n9Router works seamlessly with all major AI coding tools:\r\n\r\n<div align=\"center\">\r\n  <table>\r\n    <tr>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/claude.png\" width=\"60\" alt=\"Claude Code\"/><br/>\r\n        <b>Claude-Code</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/openclaw.png\" width=\"60\" alt=\"OpenClaw\"/><br/>\r\n        <b>OpenClaw</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/codex.png\" width=\"60\" alt=\"Codex\"/><br/>\r\n        <b>Codex</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/opencode.png\" width=\"60\" alt=\"OpenCode\"/><br/>\r\n        <b>OpenCode</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/cursor.png\" width=\"60\" alt=\"Cursor\"/><br/>\r\n        <b>Cursor</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/antigravity.png\" width=\"60\" alt=\"Antigravity\"/><br/>\r\n        <b>Antigravity</b>\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/cline.png\" width=\"60\" alt=\"Cline\"/><br/>\r\n        <b>Cline</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/continue.png\" width=\"60\" alt=\"Continue\"/><br/>\r\n        <b>Continue</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/droid.png\" width=\"60\" alt=\"Droid\"/><br/>\r\n        <b>Droid</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/roo.png\" width=\"60\" alt=\"Roo\"/><br/>\r\n        <b>Roo</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/copilot.png\" width=\"60\" alt=\"Copilot\"/><br/>\r\n        <b>Copilot</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/kilocode.png\" width=\"60\" alt=\"Kilo Code\"/><br/>\r\n        <b>Kilo Code</b>\r\n      </td>\r\n    </tr>\r\n  </table>\r\n</div>\r\n\r\n---\r\n\r\n## 🌐 Supported Providers\r\n\r\n### 🔐 OAuth Providers\r\n\r\n<div align=\"center\">\r\n  <table>\r\n    <tr>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/claude.png\" width=\"60\" alt=\"Claude Code\"/><br/>\r\n        <b>Claude-Code</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/antigravity.png\" width=\"60\" alt=\"Antigravity\"/><br/>\r\n        <b>Antigravity</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/codex.png\" width=\"60\" alt=\"Codex\"/><br/>\r\n        <b>Codex</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/github.png\" width=\"60\" alt=\"GitHub\"/><br/>\r\n        <b>GitHub</b>\r\n      </td>\r\n      <td align=\"center\" width=\"120\">\r\n        <img src=\"./public/providers/cursor.png\" width=\"60\" alt=\"Cursor\"/><br/>\r\n        <b>Cursor</b>\r\n      </td>\r\n    </tr>\r\n  </table>\r\n</div>\r\n\r\n### 🆓 Free Providers\r\n\r\n<div align=\"center\">\r\n  <table>\r\n    <tr>\r\n      <td align=\"center\" width=\"150\">\r\n        <img src=\"./public/providers/iflow.png\" width=\"70\" alt=\"iFlow\"/><br/>\r\n        <b>iFlow AI</b><br/>\r\n        <sub>8+ models • Unlimited</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"150\">\r\n        <img src=\"./public/providers/qwen.png\" width=\"70\" alt=\"Qwen\"/><br/>\r\n        <b>Qwen Code</b><br/>\r\n        <sub>3+ models • Unlimited</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"150\">\r\n        <img src=\"./public/providers/gemini-cli.png\" width=\"70\" alt=\"Gemini CLI\"/><br/>\r\n        <b>Gemini CLI</b><br/>\r\n        <sub>180K/month FREE</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"150\">\r\n        <img src=\"./public/providers/kiro.png\" width=\"70\" alt=\"Kiro\"/><br/>\r\n        <b>Kiro AI</b><br/>\r\n        <sub>Claude • Unlimited</sub>\r\n      </td>\r\n    </tr>\r\n  </table>\r\n</div>\r\n\r\n### 🔑 API Key Providers (40+)\r\n\r\n<div align=\"center\">\r\n  <table>\r\n    <tr>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/openrouter.png\" width=\"50\" alt=\"OpenRouter\"/><br/>\r\n        <sub>OpenRouter</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/glm.png\" width=\"50\" alt=\"GLM\"/><br/>\r\n        <sub>GLM</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/kimi.png\" width=\"50\" alt=\"Kimi\"/><br/>\r\n        <sub>Kimi</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/minimax.png\" width=\"50\" alt=\"MiniMax\"/><br/>\r\n        <sub>MiniMax</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/openai.png\" width=\"50\" alt=\"OpenAI\"/><br/>\r\n        <sub>OpenAI</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/anthropic.png\" width=\"50\" alt=\"Anthropic\"/><br/>\r\n        <sub>Anthropic</sub>\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/gemini.png\" width=\"50\" alt=\"Gemini\"/><br/>\r\n        <sub>Gemini</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/deepseek.png\" width=\"50\" alt=\"DeepSeek\"/><br/>\r\n        <sub>DeepSeek</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/groq.png\" width=\"50\" alt=\"Groq\"/><br/>\r\n        <sub>Groq</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/xai.png\" width=\"50\" alt=\"xAI\"/><br/>\r\n        <sub>xAI</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/mistral.png\" width=\"50\" alt=\"Mistral\"/><br/>\r\n        <sub>Mistral</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/perplexity.png\" width=\"50\" alt=\"Perplexity\"/><br/>\r\n        <sub>Perplexity</sub>\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/together.png\" width=\"50\" alt=\"Together\"/><br/>\r\n        <sub>Together AI</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/fireworks.png\" width=\"50\" alt=\"Fireworks\"/><br/>\r\n        <sub>Fireworks</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/cerebras.png\" width=\"50\" alt=\"Cerebras\"/><br/>\r\n        <sub>Cerebras</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/cohere.png\" width=\"50\" alt=\"Cohere\"/><br/>\r\n        <sub>Cohere</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/nvidia.png\" width=\"50\" alt=\"NVIDIA\"/><br/>\r\n        <sub>NVIDIA</sub>\r\n      </td>\r\n      <td align=\"center\" width=\"100\">\r\n        <img src=\"./public/providers/siliconflow.png\" width=\"50\" alt=\"SiliconFlow\"/><br/>\r\n        <sub>SiliconFlow</sub>\r\n      </td>\r\n    </tr>\r\n  </table>\r\n  <p><i>...and 20+ more providers including Nebius, Chutes, Hyperbolic, and custom OpenAI/Anthropic compatible endpoints</i></p>\r\n</div>\r\n\r\n---\r\n\r\n## 💡 Key Features\r\n\r\n| Feature | What It Does | Why It Matters |\r\n|---------|--------------|----------------|\r\n| 🎯 **Smart 3-Tier Fallback** | Auto-route: Subscription → Cheap → Free | Never stop coding, zero downtime |\r\n| 📊 **Real-Time Quota Tracking** | Live token count + reset countdown | Maximize subscription value |\r\n| 🔄 **Format Translation** | OpenAI ↔ Claude ↔ Gemini seamless | Works with any CLI tool |\r\n| 👥 **Multi-Account Support** | Multiple accounts per provider | Load balancing + redundancy |\r\n| 🔄 **Auto Token Refresh** | OAuth tokens refresh automatically | No manual re-login needed |\r\n| 🎨 **Custom Combos** | Create unlimited model combinations | Tailor fallback to your needs |\r\n| 📝 **Request Logging** | Debug mode with full request/response logs | Troubleshoot issues easily |\r\n| 💾 **Cloud Sync** | Sync config across devices | Same setup everywhere |\r\n| 📊 **Usage Analytics** | Track tokens, cost, trends over time | Optimize spending |\r\n| 🌐 **Deploy Anywhere** | Localhost, VPS, Docker, Cloudflare Workers | Flexible deployment options |\r\n\r\n<details>\r\n<summary><b>📖 Feature Details</b></summary>\r\n\r\n### 🎯 Smart 3-Tier Fallback\r\n\r\nCreate combos with automatic fallback:\r\n\r\n```\r\nCombo: \"my-coding-stack\"\r\n  1. cc/claude-opus-4-6        (your subscription)\r\n  2. glm/glm-4.7               (cheap backup, $0.6/1M)\r\n  3. if/kimi-k2-thinking       (free fallback)\r\n\r\n→ Auto switches when quota runs out or errors occur\r\n```\r\n\r\n### 📊 Real-Time Quota Tracking\r\n\r\n- Token consumption per provider\r\n- Reset countdown (5-hour, daily, weekly)\r\n- Cost estimation for paid tiers\r\n- Monthly spending reports\r\n\r\n### 🔄 Format Translation\r\n\r\nSeamless translation between formats:\r\n- **OpenAI** ↔ **Claude** ↔ **Gemini** ↔ **OpenAI Responses**\r\n- Your CLI tool sends OpenAI format → 9Router translates → Provider receives native format\r\n- Works with any tool that supports custom OpenAI endpoints\r\n\r\n### 👥 Multi-Account Support\r\n\r\n- Add multiple accounts per provider\r\n- Auto round-robin or priority-based routing\r\n- Fallback to next account when one hits quota\r\n\r\n### 🔄 Auto Token Refresh\r\n\r\n- OAuth tokens automatically refresh before expiration\r\n- No manual re-authentication needed\r\n- Seamless experience across all providers\r\n\r\n### 🎨 Custom Combos\r\n\r\n- Create unlimited model combinations\r\n- Mix subscription, cheap, and free tiers\r\n- Name your combos for easy access\r\n- Share combos across devices with Cloud Sync\r\n\r\n### 📝 Request Logging\r\n\r\n- Enable debug mode for full request/response logs\r\n- Track API calls, headers, and payloads\r\n- Troubleshoot integration issues\r\n- Export logs for analysis\r\n\r\n### 💾 Cloud Sync\r\n\r\n- Sync providers, combos, and settings across devices\r\n- Automatic background sync\r\n- Secure encrypted storage\r\n- Access your setup from anywhere\r\n\r\n#### Cloud Runtime Notes\r\n\r\n- Prefer server-side cloud variables in production:\r\n  - `BASE_URL` (internal callback URL used by sync scheduler)\r\n  - `CLOUD_URL` (cloud sync endpoint base)\r\n- `NEXT_PUBLIC_BASE_URL` and `NEXT_PUBLIC_CLOUD_URL` are still supported for compatibility/UI, but server runtime now prioritizes `BASE_URL`/`CLOUD_URL`.\r\n- Cloud sync requests now use timeout + fail-fast behavior to avoid UI hanging when cloud DNS/network is unavailable.\r\n\r\n### 📊 Usage Analytics\r\n\r\n- Track token usage per provider and model\r\n- Cost estimation and spending trends\r\n- Monthly reports and insights\r\n- Optimize your AI spending\r\n\r\n> **💡 IMPORTANT - Understanding Dashboard Costs:**\r\n> \r\n> The \"cost\" displayed in Usage Analytics is **for tracking and comparison purposes only**. \r\n> 9Router itself **never charges** you anything. You only pay providers directly (if using paid services).\r\n> \r\n> **Example:** If your dashboard shows \"$290 total cost\" while using iFlow models, this represents \r\n> what you would have paid using paid APIs directly. Your actual cost = **$0** (iFlow is free unlimited).\r\n> \r\n> Think of it as a \"savings tracker\" showing how much you're saving by using free models or \r\n> routing through 9Router!\r\n\r\n### 🌐 Deploy Anywhere\r\n\r\n- 💻 **Localhost** - Default, works offline\r\n- ☁️ **VPS/Cloud** - Share across devices\r\n- 🐳 **Docker** - One-command deployment\r\n- 🚀 **Cloudflare Workers** - Global edge network\r\n\r\n</details>\r\n\r\n---\r\n\r\n## 💰 Pricing at a Glance\r\n\r\n| Tier | Provider | Cost | Quota Reset | Best For |\r\n|------|----------|------|-------------|----------|\r\n| **💳 SUBSCRIPTION** | Claude Code (Pro) | $20/mo | 5h + weekly | Already subscribed |\r\n| | Codex (Plus/Pro) | $20-200/mo | 5h + weekly | OpenAI users |\r\n| | Gemini CLI | **FREE** | 180K/mo + 1K/day | Everyone! |\r\n| | GitHub Copilot | $10-19/mo | Monthly | GitHub users |\r\n| **💰 CHEAP** | GLM-4.7 | $0.6/1M | Daily 10AM | Budget backup |\r\n| | MiniMax M2.1 | $0.2/1M | 5-hour rolling | Cheapest option |\r\n| | Kimi K2 | $9/mo flat | 10M tokens/mo | Predictable cost |\r\n| **🆓 FREE** | iFlow | $0 | Unlimited | 8 models free |\r\n| | Qwen | $0 | Unlimited | 3 models free |\r\n| | Kiro | $0 | Unlimited | Claude free |\r\n\r\n**💡 Pro Tip:** Start with Gemini CLI (180K free/month) + iFlow (unlimited free) combo = $0 cost!\r\n\r\n---\r\n\r\n### 📊 Understanding 9Router Costs & Billing\r\n\r\n**9Router Billing Reality:**\r\n\r\n✅ **9Router software = FREE forever** (open source, never charges)  \r\n✅ **Dashboard \"costs\" = Display/tracking only** (not actual bills)  \r\n✅ **You pay providers directly** (subscriptions or API fees)  \r\n✅ **FREE providers stay FREE** (iFlow, Kiro, Qwen = $0 unlimited)  \r\n❌ **9Router never sends invoices** or charges your card\r\n\r\n**How Cost Display Works:**\r\n\r\nThe dashboard shows **estimated costs** as if you were using paid APIs directly. This is **not billing** - it's a comparison tool to show your savings.\r\n\r\n**Example Scenario:**\r\n```\r\nDashboard Display:\r\n• Total Requests: 1,662\r\n• Total Tokens: 47M\r\n• Display Cost: $290\r\n\r\nReality Check:\r\n• Provider: iFlow (FREE unlimited)\r\n• Actual Payment: $0.00\r\n• What $290 Means: Amount you SAVED by using free models!\r\n```\r\n\r\n**Payment Rules:**\r\n- **Subscription providers** (Claude Code, Codex): Pay them directly via their websites\r\n- **Cheap providers** (GLM, MiniMax): Pay them directly, 9Router just routes\r\n- **FREE providers** (iFlow, Kiro, Qwen): Genuinely free forever, no hidden charges\r\n- **9Router**: Never charges anything, ever\r\n\r\n---\r\n\r\n## 🎯 Use Cases\r\n\r\n### Case 1: \"I have Claude Pro subscription\"\r\n\r\n**Problem:** Quota expires unused, rate limits during heavy coding\r\n\r\n**Solution:**\r\n```\r\nCombo: \"maximize-claude\"\r\n  1. cc/claude-opus-4-6        (use subscription fully)\r\n  2. glm/glm-4.7               (cheap backup when quota out)\r\n  3. if/kimi-k2-thinking       (free emergency fallback)\r\n\r\nMonthly cost: $20 (subscription) + ~$5 (backup) = $25 total\r\nvs. $20 + hitting limits = frustration\r\n```\r\n\r\n### Case 2: \"I want zero cost\"\r\n\r\n**Problem:** Can't afford subscriptions, need reliable AI coding\r\n\r\n**Solution:**\r\n```\r\nCombo: \"free-forever\"\r\n  1. gc/gemini-3-flash         (180K free/month)\r\n  2. if/kimi-k2-thinking       (unlimited free)\r\n  3. qw/qwen3-coder-plus       (unlimited free)\r\n\r\nMonthly cost: $0\r\nQuality: Production-ready models\r\n```\r\n\r\n### Case 3: \"I need 24/7 coding, no interruptions\"\r\n\r\n**Problem:** Deadlines, can't afford downtime\r\n\r\n**Solution:**\r\n```\r\nCombo: \"always-on\"\r\n  1. cc/claude-opus-4-6        (best quality)\r\n  2. cx/gpt-5.2-codex          (second subscription)\r\n  3. glm/glm-4.7               (cheap, resets daily)\r\n  4. minimax/MiniMax-M2.1      (cheapest, 5h reset)\r\n  5. if/kimi-k2-thinking       (free unlimited)\r\n\r\nResult: 5 layers of fallback = zero downtime\r\nMonthly cost: $20-200 (subscriptions) + $10-20 (backup)\r\n```\r\n\r\n### Case 4: \"I want FREE AI in OpenClaw\"\r\n\r\n**Problem:** Need AI assistant in messaging apps (WhatsApp, Telegram, Slack...), completely free\r\n\r\n**Solution:**\r\n```\r\nCombo: \"openclaw-free\"\r\n  1. if/glm-4.7                (unlimited free)\r\n  2. if/minimax-m2.1           (unlimited free)\r\n  3. if/kimi-k2-thinking       (unlimited free)\r\n\r\nMonthly cost: $0\r\nAccess via: WhatsApp, Telegram, Slack, Discord, iMessage, Signal...\r\n```\r\n\r\n---\r\n\r\n## ❓ Frequently Asked Questions\r\n\r\n<details>\r\n<summary><b>📊 Why does my dashboard show high costs?</b></summary>\r\n\r\nThe dashboard tracks your token usage and displays **estimated costs** as if you were using paid APIs directly. This is **not actual billing** - it's a reference to show how much you're saving by using free models or existing subscriptions through 9Router.\r\n\r\n**Example:**\r\n- **Dashboard shows:** \"$290 total cost\"\r\n- **Reality:** You're using iFlow (FREE unlimited)\r\n- **Your actual cost:** **$0.00**\r\n- **What $290 means:** Amount you **saved** by using free models instead of paid APIs!\r\n\r\nThe cost display is a \"savings tracker\" to help you understand your usage patterns and optimization opportunities.\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>💳 Will I be charged by 9Router?</b></summary>\r\n\r\n**No.** 9Router is free, open-source software that runs on your own computer. It never charges you anything.\r\n\r\n**You only pay:**\r\n- ✅ **Subscription providers** (Claude Code $20/mo, Codex $20-200/mo) → Pay them directly on their websites\r\n- ✅ **Cheap providers** (GLM, MiniMax) → Pay them directly, 9Router just routes your requests\r\n- ❌ **9Router itself** → **Never charges anything, ever**\r\n\r\n9Router is a local proxy/router. It doesn't have your credit card, can't send invoices, and has no billing system. It's completely free software.\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>🆓 Are FREE providers really unlimited?</b></summary>\r\n\r\n**Yes!** Providers marked as FREE (iFlow, Kiro, Qwen) are genuinely unlimited with **no hidden charges**. \r\n\r\nThese are free services offered by those respective companies:\r\n- **iFlow**: Free unlimited access to 8+ models via OAuth\r\n- **Kiro**: Free unlimited Claude models via AWS Builder ID  \r\n- **Qwen**: Free unlimited access to Qwen models via device auth\r\n\r\n9Router just routes your requests to them - there's no \"catch\" or future billing. They're truly free services, and 9Router makes them easy to use with fallback support.\r\n\r\n**Note:** Some subscription providers (Antigravity, GitHub Copilot) may have free preview periods that could become paid later, but this would be clearly announced by those providers, not 9Router.\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>💰 How do I minimize my actual AI costs?</b></summary>\r\n\r\n**Free-First Strategy:**\r\n\r\n1. **Start with 100% free combo:**\r\n   ```\r\n   1. gc/gemini-3-flash (180K/month free from Google)\r\n   2. if/kimi-k2-thinking (unlimited free from iFlow)\r\n   3. qw/qwen3-coder-plus (unlimited free from Qwen)\r\n   ```\r\n   **Cost: $0/month**\r\n\r\n2. **Add cheap backup** only if you need it:\r\n   ```\r\n   4. glm/glm-4.7 ($0.6/1M tokens)\r\n   ```\r\n   **Additional cost: Only pay for what you actually use**\r\n\r\n3. **Use subscription providers last:**\r\n   - Only if you already have them\r\n   - 9Router helps maximize their value through quota tracking\r\n\r\n**Result:** Most users can operate at $0/month using only free tiers!\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>📈 What if my usage suddenly spikes?</b></summary>\r\n\r\n9Router's smart fallback prevents surprise charges:\r\n\r\n**Scenario:** You're on a coding sprint and blow through your quotas\r\n\r\n**Without 9Router:**\r\n- ❌ Hit rate limit → Work stops → Frustration\r\n- ❌ Or: Accidentally rack up huge API bills\r\n\r\n**With 9Router:**\r\n- ✅ Subscription hits limit → Auto-fallback to cheap tier\r\n- ✅ Cheap tier gets expensive → Auto-fallback to free tier\r\n- ✅ Never stop coding → Predictable costs\r\n\r\n**You're in control:** Set spending limits per provider in dashboard, and 9Router respects them.\r\n\r\n</details>\r\n\r\n---\r\n\r\n## 📖 Setup Guide\r\n\r\n<details>\r\n<summary><b>🔐 Subscription Providers (Maximize Value)</b></summary>\r\n\r\n### Claude Code (Pro/Max)\r\n\r\n```bash\r\nDashboard → Providers → Connect Claude Code\r\n→ OAuth login → Auto token refresh\r\n→ 5-hour + weekly quota tracking\r\n\r\nModels:\r\n  cc/claude-opus-4-6\r\n  cc/claude-sonnet-4-5-20250929\r\n  cc/claude-haiku-4-5-20251001\r\n```\r\n\r\n**Pro Tip:** Use Opus for complex tasks, Sonnet for speed. 9Router tracks quota per model!\r\n\r\n### OpenAI Codex (Plus/Pro)\r\n\r\n```bash\r\nDashboard → Providers → Connect Codex\r\n→ OAuth login (port 1455)\r\n→ 5-hour + weekly reset\r\n\r\nModels:\r\n  cx/gpt-5.2-codex\r\n  cx/gpt-5.1-codex-max\r\n```\r\n\r\n### Gemini CLI (FREE 180K/month!)\r\n\r\n```bash\r\nDashboard → Providers → Connect Gemini CLI\r\n→ Google OAuth\r\n→ 180K completions/month + 1K/day\r\n\r\nModels:\r\n  gc/gemini-3-flash-preview\r\n  gc/gemini-2.5-pro\r\n```\r\n\r\n**Best Value:** Huge free tier! Use this before paid tiers.\r\n\r\n### GitHub Copilot\r\n\r\n```bash\r\nDashboard → Providers → Connect GitHub\r\n→ OAuth via GitHub\r\n→ Monthly reset (1st of month)\r\n\r\nModels:\r\n  gh/gpt-5\r\n  gh/claude-4.5-sonnet\r\n  gh/gemini-3-pro\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>💰 Cheap Providers (Backup)</b></summary>\r\n\r\n### GLM-4.7 (Daily reset, $0.6/1M)\r\n\r\n1. Sign up: [Zhipu AI](https://open.bigmodel.cn/)\r\n2. Get API key from Coding Plan\r\n3. Dashboard → Add API Key:\r\n   - Provider: `glm`\r\n   - API Key: `your-key`\r\n\r\n**Use:** `glm/glm-4.7`\r\n\r\n**Pro Tip:** Coding Plan offers 3× quota at 1/7 cost! Reset daily 10:00 AM.\r\n\r\n### MiniMax M2.1 (5h reset, $0.20/1M)\r\n\r\n1. Sign up: [MiniMax](https://www.minimax.io/)\r\n2. Get API key\r\n3. Dashboard → Add API Key\r\n\r\n**Use:** `minimax/MiniMax-M2.1`\r\n\r\n**Pro Tip:** Cheapest option for long context (1M tokens)!\r\n\r\n### Kimi K2 ($9/month flat)\r\n\r\n1. Subscribe: [Moonshot AI](https://platform.moonshot.ai/)\r\n2. Get API key\r\n3. Dashboard → Add API Key\r\n\r\n**Use:** `kimi/kimi-latest`\r\n\r\n**Pro Tip:** Fixed $9/month for 10M tokens = $0.90/1M effective cost!\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>🆓 FREE Providers (Emergency Backup)</b></summary>\r\n\r\n### iFlow (8 FREE models)\r\n\r\n```bash\r\nDashboard → Connect iFlow\r\n→ iFlow OAuth login\r\n→ Unlimited usage\r\n\r\nModels:\r\n  if/kimi-k2-thinking\r\n  if/qwen3-coder-plus\r\n  if/glm-4.7\r\n  if/minimax-m2\r\n  if/deepseek-r1\r\n```\r\n\r\n### Qwen (3 FREE models)\r\n\r\n```bash\r\nDashboard → Connect Qwen\r\n→ Device code authorization\r\n→ Unlimited usage\r\n\r\nModels:\r\n  qw/qwen3-coder-plus\r\n  qw/qwen3-coder-flash\r\n```\r\n\r\n### Kiro (Claude FREE)\r\n\r\n```bash\r\nDashboard → Connect Kiro\r\n→ AWS Builder ID or Google/GitHub\r\n→ Unlimited usage\r\n\r\nModels:\r\n  kr/claude-sonnet-4.5\r\n  kr/claude-haiku-4.5\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>🎨 Create Combos</b></summary>\r\n\r\n### Example 1: Maximize Subscription → Cheap Backup\r\n\r\n```\r\nDashboard → Combos → Create New\r\n\r\nName: premium-coding\r\nModels:\r\n  1. cc/claude-opus-4-6 (Subscription primary)\r\n  2. glm/glm-4.7 (Cheap backup, $0.6/1M)\r\n  3. minimax/MiniMax-M2.1 (Cheapest fallback, $0.20/1M)\r\n\r\nUse in CLI: premium-coding\r\n\r\nMonthly cost example (100M tokens):\r\n  80M via Claude (subscription): $0 extra\r\n  15M via GLM: $9\r\n  5M via MiniMax: $1\r\n  Total: $10 + your subscription\r\n```\r\n\r\n### Example 2: Free-Only (Zero Cost)\r\n\r\n```\r\nName: free-combo\r\nModels:\r\n  1. gc/gemini-3-flash-preview (180K free/month)\r\n  2. if/kimi-k2-thinking (unlimited)\r\n  3. qw/qwen3-coder-plus (unlimited)\r\n\r\nCost: $0 forever!\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>🔧 CLI Integration</b></summary>\r\n\r\n### Cursor IDE\r\n\r\n```\r\nSettings → Models → Advanced:\r\n  OpenAI API Base URL: http://localhost:20128/v1\r\n  OpenAI API Key: [from 9router dashboard]\r\n  Model: cc/claude-opus-4-6\r\n```\r\n\r\nOr use combo: `premium-coding`\r\n\r\n### Claude Code\r\n\r\nEdit `~/.claude/config.json`:\r\n\r\n```json\r\n{\r\n  \"anthropic_api_base\": \"http://localhost:20128/v1\",\r\n  \"anthropic_api_key\": \"your-9router-api-key\"\r\n}\r\n```\r\n\r\n### Codex CLI\r\n\r\n```bash\r\nexport OPENAI_BASE_URL=\"http://localhost:20128\"\r\nexport OPENAI_API_KEY=\"your-9router-api-key\"\r\n\r\ncodex \"your prompt\"\r\n```\r\n\r\n### OpenClaw\r\n\r\n**Option 1 — Dashboard (recommended):**\r\n\r\n```\r\nDashboard → CLI Tools → OpenClaw → Select Model → Apply\r\n```\r\n\r\n**Option 2 — Manual:** Edit `~/.openclaw/openclaw.json`:\r\n\r\n```json\r\n{\r\n  \"agents\": {\r\n    \"defaults\": {\r\n      \"model\": {\r\n        \"primary\": \"9router/if/glm-4.7\"\r\n      }\r\n    }\r\n  },\r\n  \"models\": {\r\n    \"providers\": {\r\n      \"9router\": {\r\n        \"baseUrl\": \"http://127.0.0.1:20128/v1\",\r\n        \"apiKey\": \"sk_9router\",\r\n        \"api\": \"openai-completions\",\r\n        \"models\": [\r\n          {\r\n            \"id\": \"if/glm-4.7\",\r\n            \"name\": \"glm-4.7\"\r\n          }\r\n        ]\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n> **Note:** OpenClaw only works with local 9Router. Use `127.0.0.1` instead of `localhost` to avoid IPv6 resolution issues.\r\n\r\n### Cline / Continue / RooCode\r\n\r\n```\r\nProvider: OpenAI Compatible\r\nBase URL: http://localhost:20128/v1\r\nAPI Key: [from dashboard]\r\nModel: cc/claude-opus-4-6\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><b>🚀 Deployment</b></summary>\r\n\r\n### VPS Deployment\r\n\r\n```bash\r\n# Clone and install\r\ngit clone https://github.com/decolua/9router.git\r\ncd 9router\r\nnpm install\r\nnpm run build\r\n\r\n# Configure\r\nexport JWT_SECRET=\"your-secure-secret-change-this\"\r\nexport INITIAL_PASSWORD=\"your-password\"\r\nexport DATA_DIR=\"/var/lib/9router\"\r\nexport PORT=\"20128\"\r\nexport HOSTNAME=\"0.0.0.0\"\r\nexport NODE_ENV=\"production\"\r\nexport NEXT_PUBLIC_BASE_URL=\"http://localhost:20128\"\r\nexport NEXT_PUBLIC_CLOUD_URL=\"https://9router.com\"\r\nexport API_KEY_SECRET=\"endpoint-proxy-api-key-secret\"\r\nexport MACHINE_ID_SALT=\"endpoint-proxy-salt\"\r\n\r\n# Start\r\nnpm run start\r\n\r\n# Or use PM2\r\nnpm install -g pm2\r\npm2 start npm --name 9router -- start\r\npm2 save\r\npm2 startup\r\n```\r\n\r\n### Docker\r\n\r\n```bash\r\n# Build image (from repository root)\r\ndocker build -t 9router .\r\n\r\n# Run container (command used in current setup)\r\ndocker run -d \\\r\n  --name 9router \\\r\n  -p 20128:20128 \\\r\n  --env-file /root/dev/9router/.env \\\r\n  -v 9router-data:/app/data \\\r\n  -v 9router-usage:/root/.9router \\\r\n  9router\r\n```\r\n\r\nPortable command (if you are already at repository root):\r\n\r\n```bash\r\ndocker run -d \\\r\n  --name 9router \\\r\n  -p 20128:20128 \\\r\n  --env-file ./.env \\\r\n  -v 9router-data:/app/data \\\r\n  -v 9router-usage:/root/.9router \\\r\n  9router\r\n```\r\n\r\nContainer defaults:\r\n- `PORT=20128`\r\n- `HOSTNAME=0.0.0.0`\r\n\r\nUseful commands:\r\n\r\n```bash\r\ndocker logs -f 9router\r\ndocker restart 9router\r\ndocker stop 9router && docker rm 9router\r\n```\r\n\r\n### Environment Variables\r\n\r\n| Variable | Default | Description |\r\n|----------|---------|-------------|\r\n| `JWT_SECRET` | `9router-default-secret-change-me` | JWT signing secret for dashboard auth cookie (**change in production**) |\r\n| `INITIAL_PASSWORD` | `123456` | First login password when no saved hash exists |\r\n| `DATA_DIR` | `~/.9router` | Main app database location (`db.json`) |\r\n| `PORT` | framework default | Service port (`20128` in examples) |\r\n| `HOSTNAME` | framework default | Bind host (Docker defaults to `0.0.0.0`) |\r\n| `NODE_ENV` | runtime default | Set `production` for deploy |\r\n| `BASE_URL` | `http://localhost:20128` | Server-side internal base URL used by cloud sync jobs |\r\n| `CLOUD_URL` | `https://9router.com` | Server-side cloud sync endpoint base URL |\r\n| `NEXT_PUBLIC_BASE_URL` | `http://localhost:3000` | Backward-compatible/public base URL (prefer `BASE_URL` for server runtime) |\r\n| `NEXT_PUBLIC_CLOUD_URL` | `https://9router.com` | Backward-compatible/public cloud URL (prefer `CLOUD_URL` for server runtime) |\r\n| `API_KEY_SECRET` | `endpoint-proxy-api-key-secret` | HMAC secret for generated API keys |\r\n| `MACHINE_ID_SALT` | `endpoint-proxy-salt` | Salt for stable machine ID hashing |\r\n| `ENABLE_REQUEST_LOGS` | `false` | Enables request/response logs under `logs/` |\r\n| `AUTH_COOKIE_SECURE` | `false` | Force `Secure` auth cookie (set `true` behind HTTPS reverse proxy) |\r\n| `REQUIRE_API_KEY` | `false` | Enforce Bearer API key on `/v1/*` routes (recommended for internet-exposed deploys) |\r\n| `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY` | empty | Optional outbound proxy for upstream provider calls |\r\n\r\nNotes:\r\n- Lowercase proxy variables are also supported: `http_proxy`, `https_proxy`, `all_proxy`, `no_proxy`.\r\n- `.env` is not baked into Docker image (`.dockerignore`); inject runtime config with `--env-file` or `-e`.\r\n- On Windows, `APPDATA` can be used for local storage path resolution.\r\n- `INSTANCE_NAME` appears in older docs/env templates, but is currently not used at runtime.\r\n\r\n### Runtime Files and Storage\r\n\r\n- Main app state: `${DATA_DIR}/db.json` (providers, combos, aliases, keys, settings), managed by `src/lib/localDb.js`.\r\n- Usage history and logs: `~/.9router/usage.json` and `~/.9router/log.txt`, managed by `src/lib/usageDb.js`.\r\n- Optional request/translator logs: `<repo>/logs/...` when `ENABLE_REQUEST_LOGS=true`.\r\n- Usage storage currently follows `~/.9router` path logic and is independent from `DATA_DIR`.\r\n\r\n</details>\r\n\r\n---\r\n\r\n## 📊 Available Models\r\n\r\n<details>\r\n<summary><b>View all available models</b></summary>\r\n\r\n**Claude Code (`cc/`)** - Pro/Max:\r\n- `cc/claude-opus-4-6`\r\n- `cc/claude-sonnet-4-5-20250929`\r\n- `cc/claude-haiku-4-5-20251001`\r\n\r\n**Codex (`cx/`)** - Plus/Pro:\r\n- `cx/gpt-5.2-codex`\r\n- `cx/gpt-5.1-codex-max`\r\n\r\n**Gemini CLI (`gc/`)** - FREE:\r\n- `gc/gemini-3-flash-preview`\r\n- `gc/gemini-2.5-pro`\r\n\r\n**GitHub Copilot (`gh/`)**:\r\n- `gh/gpt-5`\r\n- `gh/claude-4.5-sonnet`\r\n\r\n**GLM (`glm/`)** - $0.6/1M:\r\n- `glm/glm-4.7`\r\n\r\n**MiniMax (`minimax/`)** - $0.2/1M:\r\n- `minimax/MiniMax-M2.1`\r\n\r\n**iFlow (`if/`)** - FREE:\r\n- `if/kimi-k2-thinking`\r\n- `if/qwen3-coder-plus`\r\n- `if/deepseek-r1`\r\n\r\n**Qwen (`qw/`)** - FREE:\r\n- `qw/qwen3-coder-plus`\r\n- `qw/qwen3-coder-flash`\r\n\r\n**Kiro (`kr/`)** - FREE:\r\n- `kr/claude-sonnet-4.5`\r\n- `kr/claude-haiku-4.5`\r\n\r\n</details>\r\n\r\n---\r\n\r\n## 🐛 Troubleshooting\r\n\r\n**\"Language model did not provide messages\"**\r\n- Provider quota exhausted → Check dashboard quota tracker\r\n- Solution: Use combo fallback or switch to cheaper tier\r\n\r\n**Rate limiting**\r\n- Subscription quota out → Fallback to GLM/MiniMax\r\n- Add combo: `cc/claude-opus-4-6 → glm/glm-4.7 → if/kimi-k2-thinking`\r\n\r\n**OAuth token expired**\r\n- Auto-refreshed by 9Router\r\n- If issues persist: Dashboard → Provider → Reconnect\r\n\r\n**High costs**\r\n- Check usage stats in Dashboard\r\n- Switch primary model to GLM/MiniMax\r\n- Use free tier (Gemini CLI, iFlow) for non-critical tasks\r\n\r\n**Dashboard opens on wrong port**\r\n- Set `PORT=20128` and `NEXT_PUBLIC_BASE_URL=http://localhost:20128`\r\n\r\n**First login not working**\r\n- Check `INITIAL_PASSWORD` in `.env`\r\n- If unset, fallback password is `123456`\r\n\r\n**No request logs under `logs/`**\r\n- Set `ENABLE_REQUEST_LOGS=true`\r\n\r\n---\r\n\r\n## 🛠️ Tech Stack\r\n\r\n- **Runtime**: Node.js 20+\r\n- **Framework**: Next.js 16\r\n- **UI**: React 19 + Tailwind CSS 4\r\n- **Database**: LowDB (JSON file-based)\r\n- **Streaming**: Server-Sent Events (SSE)\r\n- **Auth**: OAuth 2.0 (PKCE) + JWT + API Keys\r\n\r\n---\r\n\r\n## 📝 API Reference\r\n\r\n### Chat Completions\r\n\r\n```bash\r\nPOST http://localhost:20128/v1/chat/completions\r\nAuthorization: Bearer your-api-key\r\nContent-Type: application/json\r\n\r\n{\r\n  \"model\": \"cc/claude-opus-4-6\",\r\n  \"messages\": [\r\n    {\"role\": \"user\", \"content\": \"Write a function to...\"}\r\n  ],\r\n  \"stream\": true\r\n}\r\n```\r\n\r\n### List Models\r\n\r\n```bash\r\nGET http://localhost:20128/v1/models\r\nAuthorization: Bearer your-api-key\r\n\r\n→ Returns all models + combos in OpenAI format\r\n```\r\n\r\n## 📧 Support\r\n\r\n- **Website**: [9router.com](https://9router.com)\r\n- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)\r\n- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)\r\n\r\n---\r\n\r\n## 👥 Contributors\r\n\r\nThanks to all contributors who helped make 9Router better!\r\n\r\n[![Contributors](https://contrib.rocks/image?repo=decolua/9router&max=150&columns=15&anon=1&v=20260309)](https://github.com/decolua/9router/graphs/contributors)\r\n\r\n---\r\n\r\n## 📊 Star Chart\r\n\r\n[![Star Chart](https://starchart.cc/decolua/9router.svg?variant=adaptive)](https://starchart.cc/decolua/9router)\r\n\r\n\r\n\r\n## 🔀 Forks\r\n\r\n**[OmniRoute](https://github.com/diegosouzapw/OmniRoute)** — A full-featured TypeScript fork of 9Router. Adds 36+ providers, 4-tier auto-fallback, multi-modal APIs (images, embeddings, audio, TTS), circuit breaker, semantic cache, LLM evaluations, and a polished dashboard. 368+ unit tests. Available via npm and Docker.\r\n\r\n---\r\n\r\n## 🙏 Acknowledgments\r\n\r\nSpecial thanks to **CLIProxyAPI** - the original Go implementation that inspired this JavaScript port.\r\n\r\n---\r\n\r\n## 📄 License\r\n\r\nMIT License - see [LICENSE](LICENSE) for details.\r\n\r\n---\r\n\r\n<div align=\"center\">\r\n  <sub>Built with ❤️ for developers who code 24/7</sub>\r\n</div>\r\n\r\n","readmeFilename":"README.md","_rev":"1-fbb761a2646faeaee31dd8753c3c0ba7"}