{"id":37899091,"url":"https://github.com/decolua/9router","last_synced_at":"2026-10-27T20:19:45.432Z","repository":{"id":331905604,"uuid":"1128025899","full_name":"decolua/9router","owner":"decolua","description":"Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits.","archived":false,"fork":false,"pushed_at":"2026-10-26T09:16:57.000Z","size":18363,"stargazers_count":31497,"open_issues_count":2712,"forks_count":6113,"subscribers_count":140,"default_branch":"master","last_synced_at":"2026-10-27T09:42:51.989Z","etag":null,"topics":["ai-agents","ai-gateway","anthropic","chatgpt","claude","claude-code","cline","codex","copilot","cursor","deepseek","free-ai","gemini","gemini-cli","llm","llm-gateway","openai","openai-proxy","qwen","token-saver"],"latest_commit_sha":null,"homepage":"https://9router.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decolua.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"accessibility":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":"CLAUDE.md","gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2026-01-05T02:59:30.000Z","updated_at":"2026-10-27T09:16:52.000Z","dependencies_parsed_at":"2026-10-18T20:26:35.191Z","dependency_job_id":null,"html_url":"https://github.com/decolua/9router","commit_stats":null,"previous_names":["decolua/9router"],"tags_count":93,"template":false,"template_full_name":null,"purl":"pkg:github/decolua/9router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decolua%2F9router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decolua%2F9router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decolua%2F9router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decolua%2F9router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decolua","download_url":"https://codeload.github.com/decolua/9router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decolua%2F9router/sbom","scorecard":null,"funding_links":[],"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":346510206,"owners_count":38561820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-27T02:00:05.503Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","ai-gateway","anthropic","chatgpt","claude","claude-code","cline","codex","copilot","cursor","deepseek","free-ai","gemini","gemini-cli","llm","llm-gateway","openai","openai-proxy","qwen","token-saver"],"created_at":"2026-01-16T17:03:01.848Z","updated_at":"2026-10-27T20:19:45.402Z","avatar_url":"https://github.com/decolua.png","language":"JavaScript","funding_links":[],"categories":["ai-agents","*Ops for AI","AI拓展工具","🛡️ AI Gateways, Proxies \u0026 Agent Security","AI开源项目","September 2026","🚀 AI Tools for Vim, Neovim, and Terminal","Agent Integration \u0026 Deployment Tools","🔓 Self-hosted open source","The latest additions 🎉","Repos","Platform Engineering","Machine Learning and AI","🏗️ Infrastructure \u0026 Proxies","Open-Source LLM \u0026 Agent Projects","Other","JavaScript","🤖 AI \u0026 Machine Learning","🏆 القائمة الكاملة Top 200","LLMOps","🤖 AI, ML \u0026 Deep Learning"],"sub_categories":["LLMOps","AI 工具","AI Agent Gateway","🆓 Free tiers that still work — the verified-limits table","AI Coding Tools","LLM and Inference","Mathematics","LLM Gateways \u0026 Proxies"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./images/9router.png?1\" alt=\"9Router Dashboard\" width=\"800\"/\u003e\n  \n  # 9Router - FREE AI Router \u0026 Token Saver\n  \n  **Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE \u0026 cheap AI models.**\n  \n  **Connect All AI Code Tools (Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, OpenClaw...) to 40+ AI Providers \u0026 100+ Models.**\n  \n  [![npm](https://img.shields.io/npm/v/9router.svg)](https://www.npmjs.com/package/9router)\n  [![Downloads](https://img.shields.io/npm/dm/9router.svg)](https://www.npmjs.com/package/9router)\n  [![Docker Pulls](https://img.shields.io/docker/pulls/decolua/9router.svg?logo=docker\u0026label=Docker%20pulls)](https://hub.docker.com/r/decolua/9router)\n  [![GHCR](https://img.shields.io/badge/GHCR-decolua%2F9router-blue?logo=github)](https://github.com/decolua/9router/pkgs/container/9router)\n  [![License](https://img.shields.io/npm/l/9router.svg)](https://github.com/decolua/9router/blob/main/LICENSE)\n\n\u003ca href=\"https://trendshift.io/repositories/22628\" target=\"_blank\"\u003e\u003cimg src=\"https://trendshift.io/api/badge/repositories/22628\" alt=\"decolua%2F9router | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"/\u003e\u003c/a\u003e\n\n[🚀 Quick Start](#-quick-start) • [💡 Features](#-key-features) • [📖 Setup](#-setup-guide) • [🌐 Website](https://9router.com)\n\n[🇧🇷 Português (Brasil)](./i18n/README.pt-BR.md) • [🇻🇳 Tiếng Việt](./i18n/README.vi.md) • [🇨🇳 中文](./i18n/README.zh-CN.md) • [🇯🇵 日本語](./i18n/README.ja-JP.md) • [🇷🇺 Русский](./i18n/README.ru.md) • [🇹🇭 ไทย](./i18n/README.th.md) • [🇮🇷 فارسی](./i18n/README.fa_IR.md) • [🇮🇩 Indonesia](./i18n/README.id-ID.md) • [🇪🇸 Español](./i18n/README.es.md) • [🇫🇷 Français](./i18n/README.fr.md)\n\n\u003c/div\u003e\n\n---\n\n## 🤔 Why 9Router?\n\n**Stop wasting money, tokens and hitting limits:**\n\n- ❌ Subscription quota expires unused every month\n- ❌ Rate limits stop you mid-coding\n- ❌ Tool outputs (git diff, grep, ls...) burn tokens fast\n- ❌ Expensive APIs ($20-50/month per provider)\n- ❌ Manual switching between providers\n\n**9Router solves this:**\n\n- ✅ **RTK Token Saver** - Auto-compress tool_result content, save 20-40% tokens per request\n- ✅ **Maximize subscriptions** - Track quota, use every bit before reset\n- ✅ **Auto fallback** - Subscription → Cheap → Free, zero downtime\n- ✅ **Multi-account** - Round-robin between accounts per provider\n- ✅ **Universal** - Works with Claude Code, Codex, Cursor, Cline, any CLI tool\n\n---\n\n## 🔄 How It Works\n\n```\n┌─────────────┐\n│  Your CLI   │  (Claude Code, Codex, OpenClaw, Cursor, Cline...)\n│   Tool      │\n└──────┬──────┘\n       │ http://localhost:20128/v1\n       ↓\n┌─────────────────────────────────────────────┐\n│           9Router (Smart Router)            │\n│  • RTK Token Saver (cut tool_result tokens) │\n│  • Format translation (OpenAI ↔ Claude)     │\n│  • Quota tracking                           │\n│  • Auto token refresh                       │\n└──────┬──────────────────────────────────────┘\n       │\n       ├─→ [Tier 1: SUBSCRIPTION] Claude Code, Codex, GitHub Copilot\n       │   ↓ quota exhausted\n       ├─→ [Tier 2: CHEAP] GLM ($0.6/1M), MiniMax ($0.2/1M)\n       │   ↓ budget limit\n       └─→ [Tier 3: FREE] Kiro, OpenCode Free, Vertex ($300 credits)\n\nResult: Never stop coding, minimal cost + 20-40% token savings via RTK\n```\n\n---\n\n## ⚡ Quick Start\n\n**1. Install globally:**\n\n```bash\nnpm install -g 9router\n9router\n```\n\n🎉 Dashboard opens at `http://localhost:20128`\n\n**2. Connect a FREE provider (no signup needed):**\n\nDashboard → Providers → Connect **Kiro AI** (~50 credits/month free: Claude 4.5 + GLM-5 + MiniMax) or **OpenCode Free** (no auth) → Done!\n\n**3. Use in your CLI tool:**\n\n```\nClaude Code/Codex/OpenClaw/Cursor/Cline Settings:\n  Endpoint: http://localhost:20128/v1\n  API Key: [copy from dashboard]\n  Model: kr/claude-sonnet-4.5\n```\n\n**That's it!** Start coding with FREE AI models.\n\n**Alternative: run from source (this repository):**\n\nThis repository package is private (`9router-app`), so source/Docker execution is the expected local development path.\n\n```bash\ncp .env.example .env\nnpm install\nPORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev\n```\n\nProduction mode:\n\n```bash\n# Create Temporary Memory For Build\nsudo fallocate -l 2G /swapfile_temp\nsudo chmod 600 /swapfile_temp\nsudo mkswap /swapfile_temp\nsudo swapon /swapfile_temp\n\nexport MAKEFLAGS=\"-j1\"\nexport DLIB_NO_GUI_SUPPORT=1\nexport CFLAGS=\"-mno-avx\"\n\nnpm run build\n\n# Clear temporary swap\nsudo swapoff /swapfile_temp\nsudo rm /swapfile_temp\n\nPORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run start\n```\n\nDefault URLs:\n\n- Dashboard: `http://localhost:20128/dashboard`\n- OpenAI-compatible API: `http://localhost:20128/v1`\n\n---\n\n## Video Guides\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=X69n5Lm06Yw\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/X69n5Lm06Yw/maxresdefault.jpg\" alt=\"Tiết kiệm chi phí LLM với 9Router\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇻🇳 Tiếng Việt\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eTiết kiệm chi phí LLM cho OpenClaw với 9Router\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/c/M%C3%ACAIblog\"\u003eMì AI\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://youtu.be/VQAw612S27Y\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/VQAw612S27Y/maxresdefault.jpg\" alt=\"9Router + Claude Code FREE Unlimited Setup\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇵🇰 اردو / हिन्दी\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003e9Router + Claude Code FREE Unlimited Setup\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@BuildAIWithHamid\"\u003eBuild AI With Hamid\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=raEyZPg5xE0\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/raEyZPg5xE0/maxresdefault.jpg\" alt=\"9Router Setup Tutorial\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇺🇸 English\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003e9Router + Claude Code FREE Setup\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@BuildAIWithHamid\"\u003eBuild AI With Hamid\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://youtu.be/3dF5GIYMrcQ?si=bAyfyiHbARJQAHj_\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/3dF5GIYMrcQ/hqdefault.jpg\" alt=\"9Router Setup Tutorial\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇺🇸 English\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003e9Router + Claude Code FREE Setup\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@BuildAIWithHamid\"\u003eBuild AI With Hamid\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=o3qYCyjrFYg\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/o3qYCyjrFYg/maxresdefault.jpg\" alt=\"Claude Code FREE Forever\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇺🇸 English\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eClaude Code FREE Forever — Unlimited Models\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@BuildAIWithHamid\"\u003eBuild AI With Hamid\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=Ttpc26m39Dw\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/Ttpc26m39Dw/maxresdefault.jpg\" alt=\"Claude CLI Free Setup\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇺🇸 English\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eClaude CLI Free Setup with 9Router 🚀\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@CodeVerseSoban\"\u003eCodeVerse Soban\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=G-5A_D5Pm6Y\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/G-5A_D5Pm6Y/maxresdefault.jpg\" alt=\"Cài đặt OpenClaw Free A-Z\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇻🇳 Tiếng Việt\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eCài Đặt OpenClaw Free Từ A-Z + 9Router\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@maigia\"\u003eMai Gia\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=JXmg8_gccgE\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/JXmg8_gccgE/maxresdefault.jpg\" alt=\"FREE OpenClaw with Claude Opus\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇺🇸 English\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eFREE OpenClaw + Claude Opus 4.6\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@BuildAIWithHamid\"\u003eBuild AI With Hamid\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=CkVZZUSTXAI\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/CkVZZUSTXAI/mqdefault.jpg\" alt=\"Claude CLI Free Setup\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇮🇩 Indonesia\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eKoding 24 Jam Anti Rate Limit! Hemat Token AI 65% | Tutorial Quick Setup 9Router 🚀\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@krisswuh\"\u003eKrisswuh\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=TXGv4eofe1I\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/TXGv4eofe1I/mqdefault.jpg\" alt=\"Cara Deploy 9Router di Hugging Face GRATIS Non-Stop! | Alternatif VPS RAM 16GB\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇮🇩 Indonesia\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eCara Deploy 9Router di Hugging Face GRATIS Non-Stop! | Alternatif VPS RAM 16GB\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@krisswuh\"\u003eKrisswuh\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=GyX-DLvePW8\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/GyX-DLvePW8/hqdefault.jpg\" alt=\"این شکلی از هر API ای استفاده کن برای هوش مصنوعی\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇮🇷 Persian-فارسی\u003c/b\u003e\u003cbr/\u003e\n      \u003csub dir=\"rtl\"\u003eاین شکلی از هر API ای استفاده کن برای هوش مصنوعی\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@Matin_SenPai\"\u003eMatin SenPai\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=hPusYX-5Pmw\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/hPusYX-5Pmw/maxresdefault.jpg\" alt=\"Hướng Dẫn Setup OpenClaw + 9Router: Tạo Bot Zalo AI Tự Động Từ A-Z\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇻🇳 Tiếng Việt\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eHướng Dẫn Setup OpenClaw + 9Router: Tạo Bot Zalo AI Tự Động Từ A-Z\u003cbr/\u003eby \u003ca href=\"https://github.com/tuanminhhole\"\u003etuanminhhole\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=hgnE7MKi3Y4\"\u003e\n        \u003cimg src=\"https://img.youtube.com/vi/hgnE7MKi3Y4/maxresdefault.jpg\" alt=\"Bye Limit! Cara Bikin Sistem 'AI Unlimited' 100% Gratis Dengan 9Router!\n\" width=\"300\"/\u003e\n      \u003c/a\u003e\u003cbr/\u003e\n      \u003cb\u003e🇮🇩 Indonesia\u003c/b\u003e\u003cbr/\u003e\n      \u003csub\u003eBye Limit! Cara Bikin Sistem \"AI Unlimited\" 100% Gratis Dengan 9Router!\u003cbr/\u003eby \u003ca href=\"https://www.youtube.com/@neptiver\"\u003eneptiver\u003c/a\u003e\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\u003c/td\u003e\n    \u003ctd align=\"center\" width=\"320\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/div\u003e\n\n\u003e 🎬 **Made a video about 9Router?** Submit a [Pull Request](https://github.com/decolua/9router/pulls) adding your video to this section — we'll merge it!\n\n---\n\n## 🛠️ Supported CLI Tools\n\n9Router works seamlessly with all major AI coding tools:\n\n\u003cdiv align=\"center\"\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/claude.png\" width=\"60\" alt=\"Claude Code\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eClaude-Code\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/openclaw.png\" width=\"60\" alt=\"OpenClaw\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eOpenClaw\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/codex.png\" width=\"60\" alt=\"Codex\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eCodex\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/opencode.png\" width=\"60\" alt=\"OpenCode\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eOpenCode\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/cursor.png\" width=\"60\" alt=\"Cursor\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eCursor\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/antigravity.png\" width=\"60\" alt=\"Antigravity\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eAntigravity\u003c/b\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/cline.png\" width=\"60\" alt=\"Cline\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eCline\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/continue.png\" width=\"60\" alt=\"Continue\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eContinue\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/droid.png\" width=\"60\" alt=\"Droid\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eDroid\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/roo.png\" width=\"60\" alt=\"Roo\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eRoo\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/copilot.png\" width=\"60\" alt=\"Copilot\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eCopilot\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/kilocode.png\" width=\"60\" alt=\"Kilo Code\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eKilo Code\u003c/b\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/opendesign.png\" width=\"60\" alt=\"OpenDesign\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eOpenDesign\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/jcode.png\" width=\"60\" alt=\"jcode\"/\u003e\u003cbr/\u003e\n        \u003cb\u003ejcode\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/grok-cli.png\" width=\"60\" alt=\"Grok Build\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eGrok Build\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/devin-cli.png\" width=\"60\" alt=\"Devin CLI\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eDevin CLI\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/deepseek-tui.png\" width=\"60\" alt=\"DeepSeek TUI\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eDeepSeek TUI\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/qwen.png\" width=\"60\" alt=\"Qwen Code\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eQwen Code\u003c/b\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n---\n\n## 🌐 Supported Providers\n\n### 🔐 OAuth Providers\n\n\u003cdiv align=\"center\"\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/claude.png\" width=\"60\" alt=\"Claude Code\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eClaude-Code\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/antigravity.png\" width=\"60\" alt=\"Antigravity\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eAntigravity\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/codex.png\" width=\"60\" alt=\"Codex\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eCodex\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/github.png\" width=\"60\" alt=\"GitHub\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eGitHub\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/cursor.png\" width=\"60\" alt=\"Cursor\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eCursor\u003c/b\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"120\"\u003e\n        \u003cimg src=\"./public/providers/kimchi.png\" width=\"60\" alt=\"Kimchi\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eKimchi\u003c/b\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n### 🆓 Free Providers\n\n\u003cdiv align=\"center\"\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"150\"\u003e\n        \u003cimg src=\"./public/providers/kiro.png\" width=\"70\" alt=\"Kiro\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eKiro AI\u003c/b\u003e\u003cbr/\u003e\n        \u003csub\u003eClaude 4.5 + GLM-5 + MiniMax\u003cbr/\u003e50 credits/month free\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"150\"\u003e\n        \u003cimg src=\"./public/providers/opencode.png\" width=\"70\" alt=\"OpenCode Free\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eOpenCode Free\u003c/b\u003e\u003cbr/\u003e\n        \u003csub\u003eNo auth • Auto-fetch models\u003cbr/\u003eFree (model list varies)\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"150\"\u003e\n        \u003cimg src=\"./public/providers/gemini.png\" width=\"70\" alt=\"Vertex AI\"/\u003e\u003cbr/\u003e\n        \u003cb\u003eVertex AI\u003c/b\u003e\u003cbr/\u003e\n        \u003csub\u003eGemini 3 Pro + GLM-5 + DeepSeek\u003cbr/\u003e$300 credits free\u003c/sub\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n\u003e **Note:** iFlow, Qwen Code and Gemini CLI free tiers were discontinued in 2026. Use Kiro / OpenCode Free / Vertex instead.\n\u003e\n\u003e **Kiro AI** moved to a paid model in Sep 2025 — the free tier is now capped at **50 credits/month** (plus 500 trial credits for new accounts in the first 30 days). Paid tiers: Pro $20/mo (1,000 credits), Pro+ $40/mo (2,000), Pro Max $100/mo (5,000), Power $200/mo (10,000).\n\u003e **OpenCode Free** model list fluctuates over time (some models free only for limited promos) — subject to change without notice.\n\u003e **Vertex AI**: the $300 free credit for new GCP accounts is still valid, but since Mar 2026 the **Gemini API endpoint no longer consumes these credits** — call the **Vertex AI Studio** endpoint instead.\n\n### 🔑 API Key Providers (40+)\n\n\u003cdiv align=\"center\"\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/openrouter.png\" width=\"50\" alt=\"OpenRouter\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eOpenRouter\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/glm.png\" width=\"50\" alt=\"GLM\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eGLM\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/kimi.png\" width=\"50\" alt=\"Kimi\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eKimi\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/minimax.png\" width=\"50\" alt=\"MiniMax\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eMiniMax\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/openai.png\" width=\"50\" alt=\"OpenAI\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eOpenAI\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/anthropic.png\" width=\"50\" alt=\"Anthropic\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eAnthropic\u003c/sub\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/gemini.png\" width=\"50\" alt=\"Gemini\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eGemini\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/deepseek.png\" width=\"50\" alt=\"DeepSeek\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eDeepSeek\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/groq.png\" width=\"50\" alt=\"Groq\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eGroq\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/xai.png\" width=\"50\" alt=\"xAI\"/\u003e\u003cbr/\u003e\n        \u003csub\u003exAI\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/mistral.png\" width=\"50\" alt=\"Mistral\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eMistral\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/perplexity.png\" width=\"50\" alt=\"Perplexity\"/\u003e\u003cbr/\u003e\n        \u003csub\u003ePerplexity\u003c/sub\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/together.png\" width=\"50\" alt=\"Together\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eTogether AI\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/fireworks.png\" width=\"50\" alt=\"Fireworks\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eFireworks\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/cerebras.png\" width=\"50\" alt=\"Cerebras\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eCerebras\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/cohere.png\" width=\"50\" alt=\"Cohere\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eCohere\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/nvidia.png\" width=\"50\" alt=\"NVIDIA\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eNVIDIA\u003c/sub\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"100\"\u003e\n        \u003cimg src=\"./public/providers/siliconflow.png\" width=\"50\" alt=\"SiliconFlow\"/\u003e\u003cbr/\u003e\n        \u003csub\u003eSiliconFlow\u003c/sub\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n  \u003cp\u003e\u003ci\u003e...and 20+ more providers including Nebius, Chutes, Hyperbolic, and custom OpenAI/Anthropic compatible endpoints\u003c/i\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n### 🏠 Self-hosted Providers\n\nFor speech and embeddings served from **your own** machine — whisper.cpp,\nfaster-whisper, Speaches, Kokoro-FastAPI, openedai-speech, llama.cpp/llama-server,\nvLLM, Infinity, text-embeddings-inference, or anything else that speaks the OpenAI\nshape.\n\n| Provider | Endpoint used | Typical server |\n| --- | --- | --- |\n| **Self-hosted STT** | `/v1/audio/transcriptions` | whisper.cpp, faster-whisper |\n| **Self-hosted TTS** | `/v1/audio/speech` | Kokoro-FastAPI, openedai-speech |\n| **Self-hosted Embedding** | `/v1/embeddings` | llama-server, vLLM, Infinity |\n\nEvery other speech provider is a named cloud service with a fixed endpoint. These\nthree read their address from **each connection**, so one provider can front\nseveral machines and load-balance across them like any other.\n\nSet it on the connection as `providerSpecificData.baseUrl`:\n\n| Provider | Give it | Result |\n| --- | --- | --- |\n| Self-hosted STT | the full URL — `http://host:8080/v1/audio/transcriptions` | used as-is |\n| Self-hosted TTS | the server root — `http://host:8880` | `+ /v1/audio/speech` |\n| Self-hosted Embedding | the **OpenAI base**, `/v1` included — `http://host:8080/v1` | `+ /embeddings` |\n\n\u003e **Mind the `/v1` on embeddings.** The adapter appends `/embeddings`, so\n\u003e `http://host:8080` resolves to `http://host:8080/embeddings` and misses the\n\u003e OpenAI route — llama-server answers **501**. Give it the same base URL an OpenAI\n\u003e client would use. A full `.../v1/embeddings` is also accepted, so a value pasted\n\u003e from a `curl` example works too.\n\nThe API key is not checked by most local servers, but the field must be non-empty:\nit is what gives the connection a credentials record, and `baseUrl` lives there.\nAny placeholder works.\n\nSelf-hosted Embedding has **no cloud fallback by design** — a connection saved\nwithout a `baseUrl` is reported as a configuration error rather than quietly\nfalling back to `api.openai.com`, which would send your input text and API key to\na third party under a provider named \"Self-hosted\".\n\n---\n\n## 💡 Key Features\n\n| Feature                                                                           | What It Does                                                                             | Why It Matters                                    |\n| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------- |\n| 🚀 **RTK Token Saver** ([RTK](https://github.com/rtk-ai/rtk) ⭐40K)               | Compress tool outputs (`git diff`, `grep`, `ls`, `tree`...) before sending to LLM        | Save **20-40% input tokens** per request          |\n| 🧠 **Headroom Token Saver** ([Headroom](https://github.com/chopratejas/headroom)) | Optional external `/v1/compress` proxy before provider routing                           | Save more context tokens without changing clients |\n| 🪨 **Caveman Mode** ([Caveman](https://github.com/JuliusBrussee/caveman) ⭐52K)   | Inject caveman-speak prompt → LLM replies terse, technical substance preserved           | Save **up to 65% output tokens**                  |\n| 🐴 **Ponytail** ([Ponytail](https://github.com/DietrichGebert/ponytail))          | Inject \"lazy senior dev\" prompt → LLM writes minimal, YAGNI-first code (Lite/Full/Ultra) | **Fewer output tokens, less refactoring**         |\n| 🎯 **Smart 3-Tier Fallback**                                                      | Auto-route: Subscription → Cheap → Free                                                  | Never stop coding, zero downtime                  |\n| 📊 **Real-Time Quota Tracking**                                                   | Live token count + reset countdown                                                       | Maximize subscription value                       |\n| 🔄 **Format Translation**                                                         | OpenAI ↔ Claude ↔ Gemini ↔ Cursor ↔ Kiro ↔ Vertex                                        | Works with any CLI tool                           |\n| 👥 **Multi-Account Support**                                                      | Multiple accounts per provider                                                           | Load balancing + redundancy                       |\n| 🔄 **Auto Token Refresh**                                                         | OAuth tokens refresh automatically                                                       | No manual re-login needed                         |\n| 🎨 **Custom Combos**                                                              | Create unlimited model combinations                                                      | Tailor fallback to your needs                     |\n| 📝 **Request Logging**                                                            | Debug mode with full request/response logs                                               | Troubleshoot issues easily                        |\n| 💾 **Cloud Sync**                                                                 | Sync config across devices                                                               | Same setup everywhere                             |\n| 📊 **Usage Analytics**                                                            | Track tokens, cost, trends over time                                                     | Optimize spending                                 |\n| 🌐 **Deploy Anywhere**                                                            | Localhost, VPS, Docker, Cloudflare Workers                                               | Flexible deployment options                       |\n\nSet `X-9Router-Token-Saver: off` to bypass all token savers for one chat request.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e📖 Feature Details\u003c/b\u003e\u003c/summary\u003e\n\n### 🚀 RTK Token Saver\n\nTool outputs (`git diff`, `grep`, `find`, `ls`, `tree`, log dumps...) often eat 30-50% of your prompt budget. RTK detects them and applies smart, lossless compression **before** the request hits the LLM:\n\n- **Filters:** `git-diff`, `git-status`, `grep`, `find`, `ls`, `tree`, `dedup-log`, `smart-truncate`, `read-numbered`, `search-list`\n- **Auto-detect:** No config needed — RTK peeks the first 1KB of each `tool_result` and picks the right filter.\n- **Safe by design:** If a filter fails, throws, or makes output bigger, RTK silently keeps the original text. Errors never break your request.\n- **Universal:** Works across all formats (OpenAI, Claude, Gemini, Cursor, Kiro, OpenAI Responses) because it runs **before** any format translation.\n- **Default ON:** Toggle anytime in Dashboard → Endpoint settings.\n\n```\nWithout RTK: 47K tokens sent to LLM\nWith RTK:    28K tokens sent to LLM   (40% saved · same context · same answer)\n```\n\n### 🧠 Headroom Token Saver\n\nHeadroom is optional and runs separately. 9Router calls Headroom's local `/v1/compress` endpoint, then keeps normal routing, fallback, auth, and usage tracking:\n\n```\nClient → 9Router → Headroom /v1/compress → 9Router → provider\n```\n\nLocal setup:\n\n```bash\npip install \"headroom-ai[proxy]\"\nheadroom proxy --port 8787\n```\n\nEnable in Dashboard → Endpoint → Token Saver → Headroom. Default URL: `http://localhost:8787`.\n\nDocker examples:\n\n```bash\n# Headroom service in same Docker network\nhttp://headroom:8787\n\n# Headroom running on host machine\nhttp://host.docker.internal:8787\n```\n\nIf Headroom is down or returns an error, 9Router fails open and sends the original request.\n\n### 🐴 Ponytail (Lazy Senior Dev)\n\nPonytail injects a _\"lazy senior dev\"_ system prompt into every request, biasing the LLM toward minimal, YAGNI-first code — deletion over addition, stdlib over new deps, one-liners over abstractions. Adapted from [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail).\n\n- **Lite** — Build what's asked, name the lazier alternative.\n- **Full** — YAGNI ladder enforced: stdlib → native → existing deps → one-liner → minimal code.\n- **Ultra** — YAGNI extremist: deletion first, ship the one-liner, challenge the rest of the requirement in the same response.\n\n```\nWithout Ponytail: verbose code, extra abstractions, \"just in case\" scaffolding\nWith Ponytail:    shortest working diff, no unrequested abstractions, fewer tokens\n```\n\nNever trades away: input validation, error handling that prevents data loss, security, accessibility, or anything explicitly requested. Enable in Dashboard → Endpoint → Ponytail. Stacks with Caveman (output terseness) and RTK (input compression).\n\n### 🎯 Smart 3-Tier Fallback\n\nCreate combos with automatic fallback:\n\n```\nCombo: \"my-coding-stack\"\n  1. cc/claude-opus-4-6        (your subscription)\n  2. glm/glm-4.7               (cheap backup, $0.6/1M)\n  3. if/kimi-k2-thinking       (free fallback)\n\n→ Auto switches when quota runs out or errors occur\n```\n\n### 📊 Real-Time Quota Tracking\n\n- Token consumption per provider\n- Reset countdown (5-hour, daily, weekly)\n- Cost estimation for paid tiers\n- Monthly spending reports\n\n### 🔄 Format Translation\n\nSeamless translation between formats:\n\n- **OpenAI** ↔ **Claude** ↔ **Gemini** ↔ **Cursor** ↔ **Kiro** ↔ **Vertex** ↔ **Antigravity** ↔ **Ollama** ↔ **OpenAI Responses**\n- Your CLI tool sends OpenAI format → 9Router translates → Provider receives native format\n- Works with any tool that supports custom OpenAI endpoints\n\n### 👥 Multi-Account Support\n\n- Add multiple accounts per provider\n- Auto round-robin or priority-based routing\n- Fallback to next account when one hits quota\n\n### 🔄 Auto Token Refresh\n\n- OAuth tokens automatically refresh before expiration\n- No manual re-authentication needed\n- Seamless experience across all providers\n\n### 🎨 Custom Combos\n\n- Create unlimited model combinations\n- Mix subscription, cheap, and free tiers\n- Name your combos for easy access\n- Share combos across devices with Cloud Sync\n\n### 📝 Request Logging\n\n- Enable debug mode for full request/response logs\n- Track API calls, headers, and payloads\n- Troubleshoot integration issues\n- Export logs for analysis\n\n### 💾 Cloud Sync\n\n- Sync providers, combos, and settings across devices\n- Automatic background sync\n- Secure encrypted storage\n- Access your setup from anywhere\n\n#### Cloud Runtime Notes\n\n- Prefer server-side cloud variables in production:\n  - `BASE_URL` (internal callback URL used by sync scheduler)\n  - `CLOUD_URL` (cloud sync endpoint base)\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`.\n- Cloud sync requests now use timeout + fail-fast behavior to avoid UI hanging when cloud DNS/network is unavailable.\n\n### 📊 Usage Analytics\n\n- Track token usage per provider and model\n- Cost estimation and spending trends\n- Monthly reports and insights\n- Optimize your AI spending\n\n\u003e **💡 IMPORTANT - Understanding Dashboard Costs:**\n\u003e\n\u003e The \"cost\" displayed in Usage Analytics is **for tracking and comparison purposes only**.\n\u003e 9Router itself **never charges** you anything. You only pay providers directly (if using paid services).\n\u003e\n\u003e **Example:** If your dashboard shows \"$290 total cost\" while using Kiro free models, this represents\n\u003e what you would have paid using paid APIs directly. Your actual cost = **$0** (Kiro free tier: ~50 credits/mo).\n\u003e\n\u003e Think of it as a \"savings tracker\" showing how much you're saving by using free models or\n\u003e routing through 9Router!\n\n### 🌐 Deploy Anywhere\n\n- 💻 **Localhost** - Default, works offline\n- ☁️ **VPS/Cloud** - Share across devices\n- 🐳 **Docker** - One-command deployment\n- 🚀 **Cloudflare Workers** - Global edge network\n\n\u003c/details\u003e\n\n---\n\n## 💰 Pricing at a Glance\n\n| Tier                | Provider              | Cost         | Quota Reset      | Best For                                |\n| ------------------- | --------------------- | ------------ | ---------------- | --------------------------------------- |\n| **🚀 TOKEN SAVER**  | **RTK (built-in)**    | **FREE**     | Always on        | **Save 20-40% tokens on EVERY request** |\n| **💳 SUBSCRIPTION** | Claude Code (Pro/Max) | $20-200/mo   | 5h + weekly      | Already subscribed                      |\n|                     | Codex (Plus/Pro)      | $20-200/mo   | 5h + weekly      | OpenAI users                            |\n|                     | GitHub Copilot        | $10-19/mo    | Monthly          | GitHub users                            |\n|                     | Cursor IDE            | $20/mo       | Monthly          | Cursor users                            |\n| **💰 CHEAP**        | GLM-5.1 / GLM-4.7     | $0.6/1M      | Daily 10AM       | Budget backup                           |\n|                     | MiniMax M2.7          | $0.2/1M      | 5-hour rolling   | Cheapest option                         |\n|                     | Kimi K2.5             | $9/mo flat   | 10M tokens/mo    | Predictable cost                        |\n | **🆓 FREE**         | Kiro AI               | $0           | 50 credits/mo    | Claude 4.5 + GLM-5 + MiniMax free (paid tiers above) |\n |                     | OpenCode Free         | $0           | Varies*          | No auth, auto-fetch models (list changes over time) |\n |                     | Vertex AI             | $300 credits | New GCP accounts | Gemini 3 Pro + DeepSeek + GLM-5 (use Vertex AI Studio endpoint for free credits) |\n\n**💡 Pro Tip:** RTK + Kiro AI + OpenCode Free combo = **$0 cost + 20-40% token savings**!\n\n---\n\n### 📊 Understanding 9Router Costs \u0026 Billing\n\n**9Router Billing Reality:**\n\n✅ **9Router software = FREE forever** (open source, never charges)  \n✅ **Dashboard \"costs\" = Display/tracking only** (not actual bills)  \n✅ **You pay providers directly** (subscriptions or API fees)  \n✅ **FREE providers stay FREE** (Kiro ~50 credits/mo, OpenCode Free, Vertex $300 credits = $0 within free-tier limits) — note iFlow/Qwen/Gemini CLI free tiers were discontinued in 2026\n❌ **9Router never sends invoices** or charges your card\n\n**How Cost Display Works:**\n\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.\n\n**Example Scenario:**\n\n```\nDashboard Display:\n• Total Requests: 1,662\n• Total Tokens: 47M\n• Display Cost: $290\n\nReality Check:\n• Provider: Kiro (free tier: ~50 credits/mo)\n• Actual Payment: $0.00\n• What $290 Means: Amount you SAVED by using free models!\n```\n\n**Payment Rules:**\n\n- **Subscription providers** (Claude Code, Codex): Pay them directly via their websites\n- **Cheap providers** (GLM, MiniMax): Pay them directly, 9Router just routes\n- **FREE providers** (iFlow, Kiro, Qwen): Genuinely free forever, no hidden charges\n- **9Router**: Never charges anything, ever\n\n---\n\n## 🎯 Use Cases\n\n### Case 1: \"I have Claude Pro subscription\"\n\n**Problem:** Quota expires unused, rate limits during heavy coding\n\n**Solution:**\n\n```\nCombo: \"maximize-claude\"\n  1. cc/claude-opus-4-7        (use subscription fully)\n  2. glm/glm-5.1               (cheap backup when quota out)\n  3. kr/claude-sonnet-4.5      (free emergency fallback)\n\nMonthly cost: $20 (subscription) + ~$5 (backup) = $25 total\nvs. $20 + hitting limits = frustration\n```\n\n### Case 2: \"I want zero cost\"\n\n**Problem:** Can't afford subscriptions, need reliable AI coding\n\n**Solution:**\n\n```\nCombo: \"free-forever\"\n  1. kr/claude-sonnet-4.5      (Claude 4.5 free via Kiro, ~50 credits/mo)\n  2. kr/glm-5                  (GLM-5 free via Kiro)\n  3. oc/\u003cauto\u003e                 (OpenCode Free, no auth)\n\nMonthly cost: $0\nQuality: Production-ready models + RTK saves 20-40% tokens\n```\n\n### Case 3: \"I need 24/7 coding, no interruptions\"\n\n**Problem:** Deadlines, can't afford downtime\n\n**Solution:**\n\n```\nCombo: \"always-on\"\n  1. cc/claude-opus-4-7        (best quality)\n  2. cx/gpt-5.5                (second subscription)\n  3. glm/glm-5.1               (cheap, resets daily)\n  4. minimax/MiniMax-M2.7      (cheapest, 5h reset)\n  5. kr/claude-sonnet-4.5      (free via Kiro, ~50 credits/mo)\n\nResult: 5 layers of fallback = zero downtime\nMonthly cost: $20-200 (subscriptions) + $10-20 (backup)\n```\n\n### Case 4: \"I want FREE AI in OpenClaw\"\n\n**Problem:** Need AI assistant in messaging apps (WhatsApp, Telegram, Slack...), completely free\n\n**Solution:**\n\n```\nCombo: \"openclaw-free\"\n  1. kr/claude-sonnet-4.5      (Claude 4.5 free)\n  2. kr/glm-5                  (GLM-5 free)\n  3. kr/MiniMax-M2.5           (MiniMax free)\n\nMonthly cost: $0\nAccess via: WhatsApp, Telegram, Slack, Discord, iMessage, Signal...\n```\n\n---\n\n## ❓ Frequently Asked Questions\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e📊 Why does my dashboard show high costs?\u003c/b\u003e\u003c/summary\u003e\n\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.\n\n**Example:**\n\n- **Dashboard shows:** \"$290 total cost\"\n- **Reality:** You're using Kiro free models (~50 credits/mo)\n- **Your actual cost:** **$0.00**\n- **What $290 means:** Amount you **saved** by using free models instead of paid APIs!\n\nThe cost display is a \"savings tracker\" to help you understand your usage patterns and optimization opportunities.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e💳 Will I be charged by 9Router?\u003c/b\u003e\u003c/summary\u003e\n\n**No.** 9Router is free, open-source software that runs on your own computer. It never charges you anything.\n\n**You only pay:**\n\n- ✅ **Subscription providers** (Claude Code $20/mo, Codex $20-200/mo) → Pay them directly on their websites\n- ✅ **Cheap providers** (GLM, MiniMax) → Pay them directly, 9Router just routes your requests\n- ❌ **9Router itself** → **Never charges anything, ever**\n\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.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🆓 Are FREE providers really unlimited?\u003c/b\u003e\u003c/summary\u003e\n\n**Mostly!** The current FREE providers (Kiro, OpenCode Free, Vertex) are genuinely free, but free tiers have limits:\n\nThese are free services offered by those respective companies:\n\n- **Kiro AI**: ~50 credits/month free (plus 500 trial credits for new accounts in the first 30 days) via AWS Builder ID / Google / GitHub OAuth. Paid tiers available above that.\n- **OpenCode Free**: No-auth passthrough proxy, models auto-fetched from `opencode.ai/zen/v1/models`. The free model list fluctuates over time (some models free only for limited promos) — subject to change without notice.\n- **Vertex AI**: $300 free credits for new Google Cloud accounts (90 days). Since Mar 2026 the Gemini API endpoint no longer consumes these credits — use the **Vertex AI Studio** endpoint instead.\n\n9Router just routes your requests to them - there's no \"catch\" or future billing from 9Router itself. They're truly free services, and 9Router makes them easy to use with fallback support.\n\n**Discontinued free tiers (no longer recommended):**\n\n- ❌ **iFlow**: Was free unlimited, now changed to paid (2026)\n- ❌ **Qwen Code**: Free OAuth tier fully discontinued by Alibaba on 2026-04-15\n- ❌ **Gemini CLI**: Service fully shut down by Google on 2026-06-18 (replaced by the closed-source Antigravity CLI). Discontinued — do not use.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e💰 How do I minimize my actual AI costs?\u003c/b\u003e\u003c/summary\u003e\n\n**Free-First Strategy:**\n\n1. **Start with 100% free combo:**\n\n   ```\n   1. kr/glm-5 (GLM-5 free via Kiro, ~50 credits/mo)\n   2. OpenCode Free models (no auth, auto-fetched)\n   3. Vertex AI Gemini 3 Pro (using the Vertex AI Studio endpoint with $300 credits)\n   ```\n\n   **Cost: $0/month** (within Kiro's free credit cap; OpenCode/Vertex subject to their free-tier limits)\n\n2. **Add cheap backup** only if you need it:\n\n   ```\n   4. glm/glm-4.7 ($0.6/1M tokens)\n   ```\n\n   **Additional cost: Only pay for what you actually use**\n\n3. **Use subscription providers last:**\n   - Only if you already have them\n   - 9Router helps maximize their value through quota tracking\n\n**Result:** Most users can operate at $0/month using only free tiers!\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e📈 What if my usage suddenly spikes?\u003c/b\u003e\u003c/summary\u003e\n\n9Router's smart fallback prevents surprise charges:\n\n**Scenario:** You're on a coding sprint and blow through your quotas\n\n**Without 9Router:**\n\n- ❌ Hit rate limit → Work stops → Frustration\n- ❌ Or: Accidentally rack up huge API bills\n\n**With 9Router:**\n\n- ✅ Subscription hits limit → Auto-fallback to cheap tier\n- ✅ Cheap tier gets expensive → Auto-fallback to free tier\n- ✅ Never stop coding → Predictable costs\n\n**You're in control:** Set spending limits per provider in dashboard, and 9Router respects them.\n\n\u003c/details\u003e\n\n---\n\n## 📖 Setup Guide\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🔐 Subscription Providers (Maximize Value)\u003c/b\u003e\u003c/summary\u003e\n\n### Claude Code (Pro/Max)\n\n```bash\nDashboard → Providers → Connect Claude Code\n→ OAuth login → Auto token refresh\n→ 5-hour + weekly quota tracking\n\nModels:\n  cc/claude-opus-4-7\n  cc/claude-opus-4-6\n  cc/claude-sonnet-4-6\n  cc/claude-haiku-4-5-20251001\n```\n\n**Pro Tip:** Use Opus for complex tasks, Sonnet for speed. 9Router tracks quota per model!\n\n### OpenAI Codex (Plus/Pro)\n\n```bash\nDashboard → Providers → Connect Codex\n→ OAuth login (port 1455)\n→ 5-hour + weekly reset\n\nModels:\n  cx/gpt-5.5\n  cx/gpt-5.4\n  cx/gpt-5.3-codex\n  cx/gpt-5.2-codex\n```\n\n### GitHub Copilot\n\n```bash\nDashboard → Providers → Connect GitHub\n→ OAuth via GitHub\n→ Monthly reset (1st of month)\n\nModels:\n  gh/gpt-5.4\n  gh/claude-opus-4.7\n  gh/claude-sonnet-4.6\n  gh/gemini-3.1-pro-preview\n  gh/grok-code-fast-1\n```\n\n### Cursor IDE\n\n```bash\nDashboard → Providers → Connect Cursor\n→ OAuth login\n→ Monthly subscription\n\nModels:\n  cu/claude-4.6-opus-max\n  cu/claude-4.5-sonnet-thinking\n  cu/gpt-5.3-codex\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e💰 Cheap Providers (Backup)\u003c/b\u003e\u003c/summary\u003e\n\n### GLM-5.1 / GLM-4.7 (Daily reset, $0.6/1M)\n\n1. Sign up: [Zhipu AI](https://open.bigmodel.cn/)\n2. Get API key from Coding Plan\n3. Dashboard → Add API Key:\n   - Provider: `glm`\n   - API Key: `your-key`\n\n**Use:** `glm/glm-5.1`, `glm/glm-5`, `glm/glm-4.7`\n\n**Pro Tip:** Coding Plan offers 3× quota at 1/7 cost! Reset daily 10:00 AM.\n\n### MiniMax M2.7 (5h reset, $0.20/1M)\n\n1. Sign up: [MiniMax](https://www.minimax.io/)\n2. Get API key\n3. Dashboard → Add API Key\n\n**Use:** `minimax/MiniMax-M2.7`, `minimax/MiniMax-M2.5`\n\n**Pro Tip:** Cheapest option for long context (1M tokens)!\n\n### Kimi K2.5 ($9/month flat)\n\n1. Subscribe: [Moonshot AI](https://platform.moonshot.ai/)\n2. Get API key\n3. Dashboard → Add API Key\n\n**Use:** `kimi/kimi-k2.5`, `kimi/kimi-k2.5-thinking`\n\n**Pro Tip:** Fixed $9/month for 10M tokens = $0.90/1M effective cost!\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🆓 FREE Providers (Recommended)\u003c/b\u003e\u003c/summary\u003e\n\n### Kiro AI (Claude 4.5 + GLM-5 + MiniMax FREE)\n\n```bash\nDashboard → Connect Kiro\n→ AWS Builder ID, AWS IAM Identity Center, Google, or GitHub\n→ Unlimited usage\n\nModels:\n  kr/claude-sonnet-4.5\n  kr/claude-haiku-4.5\n  kr/glm-5\n  kr/MiniMax-M2.5\n  kr/qwen3-coder-next\n  kr/deepseek-3.2\n```\n\n**Pro Tip:** Best free option for Claude. No API key, no payment, fully unlimited.\n\n### OpenCode Free (No auth, auto-fetch models)\n\n```bash\nDashboard → Connect OpenCode Free\n→ No login required (passthrough proxy)\n→ Models auto-fetched from opencode.ai/zen/v1/models\n```\n\n**Pro Tip:** Fastest setup. Just connect and start coding.\n\n### Vertex AI ($300 free credits for new GCP accounts)\n\n```bash\nDashboard → Connect Vertex AI\n→ Upload Google Cloud Service Account JSON\n→ Enable Vertex AI API in your GCP project\n\nModels:\n  vertex/gemini-3.1-pro-preview\n  vertex/gemini-3-flash-preview\n  vertex/gemini-2.5-flash\n\nVertex Partner (Anthropic / DeepSeek / GLM / Qwen via Vertex):\n  vertex-partner/glm-5-maas\n  vertex-partner/deepseek-v3.2-maas\n  vertex-partner/qwen3-next-80b-a3b-thinking-maas\n```\n\nFor a raw Google Cloud API-key connection, set the following through\n`PUT /api/providers/\u003cconnection-id\u003e` to select the global endpoint:\n\n```json\n{\n  \"providerSpecificData\": {\n    \"projectId\": \"YOUR_GOOGLE_CLOUD_PROJECT_ID\",\n    \"location\": \"global\"\n  }\n}\n```\n\nWith an explicit project, API-key requests honor `location` and default to\n`global` when it is omitted. Connections without an explicit project retain\nthe projectless endpoint. Gemini 4 Argon supports `global`, `us`, and `eu`,\nnot regional locations such as `europe-west1`; see\n[Google's supported locations](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-argon).\n\n**Pro Tip:** New Google Cloud accounts get $300 credits free for 90 days. Plenty for daily coding.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🎨 Create Combos\u003c/b\u003e\u003c/summary\u003e\n\n### Example 1: Maximize Subscription → Cheap Backup\n\n```\nDashboard → Combos → Create New\n\nName: premium-coding\nModels:\n  1. cc/claude-opus-4-7 (Subscription primary)\n  2. glm/glm-5.1 (Cheap backup, $0.6/1M)\n  3. minimax/MiniMax-M2.7 (Cheapest fallback, $0.20/1M)\n\nUse in CLI: premium-coding\n\nMonthly cost example (100M tokens):\n  80M via Claude (subscription): $0 extra\n  15M via GLM: $9\n  5M via MiniMax: $1\n  Total: $10 + your subscription\n```\n\n### Example 2: Free-Only (Zero Cost)\n\n```\nName: free-combo\nModels:\n  1. kr/claude-sonnet-4.5 (Claude 4.5 free via Kiro, ~50 credits/mo)\n  2. kr/glm-5 (GLM-5 free via Kiro)\n  3. vertex/gemini-3.1-pro-preview ($300 free credits)\n\nCost: $0 forever (+ 20-40% token savings via RTK)!\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🔧 CLI Integration\u003c/b\u003e\u003c/summary\u003e\n\n### Cursor IDE\n\n```\nSettings → Models → Advanced:\n  OpenAI API Base URL: http://localhost:20128/v1\n  OpenAI API Key: [from 9router dashboard]\n  Model: cc/claude-opus-4-7\n```\n\nOr use combo: `premium-coding`\n\n### Claude Code\n\nEdit `~/.claude/config.json`:\n\n```json\n{\n  \"anthropic_api_base\": \"http://localhost:20128/v1\",\n  \"anthropic_api_key\": \"your-9router-api-key\"\n}\n```\n\n### Codex CLI\n\n```bash\nexport OPENAI_BASE_URL=\"http://localhost:20128\"\nexport OPENAI_API_KEY=\"your-9router-api-key\"\n\ncodex \"your prompt\"\n```\n\n### OpenClaw\n\n**Option 1 — Dashboard (recommended):**\n\n```\nDashboard → CLI Tools → OpenClaw → Select Model → Apply\n```\n\n**Option 2 — Manual:** Edit `~/.openclaw/openclaw.json`:\n\n```json\n{\n  \"agents\": {\n    \"defaults\": {\n      \"model\": {\n        \"primary\": \"9router/kr/claude-sonnet-4.5\"\n      }\n    }\n  },\n  \"models\": {\n    \"providers\": {\n      \"9router\": {\n        \"baseUrl\": \"http://127.0.0.1:20128/v1\",\n        \"apiKey\": \"sk_9router\",\n        \"api\": \"openai-completions\",\n        \"models\": [\n          {\n            \"id\": \"kr/claude-sonnet-4.5\",\n            \"name\": \"Claude Sonnet 4.5 (Kiro Free)\"\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n\u003e **Note:** OpenClaw only works with local 9Router. Use `127.0.0.1` instead of `localhost` to avoid IPv6 resolution issues.\n\n### Cline / Continue / RooCode\n\n```\nProvider: OpenAI Compatible\nBase URL: http://localhost:20128/v1\nAPI Key: [from dashboard]\nModel: cc/claude-opus-4-7\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🚀 Deployment\u003c/b\u003e\u003c/summary\u003e\n\n### VPS Deployment\n\n```bash\n# Clone and install\ngit clone https://github.com/decolua/9router.git\ncd 9router\nnpm install\nnpm run build\n\n# Configure\nexport JWT_SECRET=\"your-secure-secret-change-this\"\nexport INITIAL_PASSWORD=\"your-password\"\nexport DATA_DIR=\"/var/lib/9router\"\nexport PORT=\"20128\"\nexport HOSTNAME=\"0.0.0.0\"\nexport NODE_ENV=\"production\"\nexport NEXT_PUBLIC_BASE_URL=\"http://localhost:20128\"\nexport NEXT_PUBLIC_CLOUD_URL=\"https://9router.com\"\nexport API_KEY_SECRET=\"endpoint-proxy-api-key-secret\"\nexport MACHINE_ID_SALT=\"endpoint-proxy-salt\"\n\n# Start\nnpm run start\n\n# Or use PM2\nnpm install -g pm2\npm2 start npm --name 9router -- start\npm2 save\npm2 startup\n```\n\n### Docker\n\nPublished images (multi-platform `linux/amd64` + `linux/arm64`):\n\n- Docker Hub: [`decolua/9router`](https://hub.docker.com/r/decolua/9router)\n- GHCR: [`ghcr.io/decolua/9router`](https://github.com/decolua/9router/pkgs/container/9router)\n\n**Quick start (use published image):**\n\n```bash\ndocker run -d \\\n  --name 9router \\\n  -p 20128:20128 \\\n  -v \"$HOME/.9router:/app/data\" \\\n  -e DATA_DIR=/app/data \\\n  decolua/9router:latest\n```\n\n→ Open http://localhost:20128\n\n**Build from source (dev):**\n\n```bash\ngit clone https://github.com/decolua/9router.git\ncd 9router/app\ndocker build -t 9router .\ndocker run -d --name 9router -p 20128:20128 \\\n  -v \"$HOME/.9router:/app/data\" -e DATA_DIR=/app/data 9router\n```\n\n**Container defaults:**\n\n- `PORT=20128`\n- `HOSTNAME=0.0.0.0`\n\n**Useful commands:**\n\n```bash\ndocker logs -f 9router\ndocker restart 9router\ndocker stop 9router \u0026\u0026 docker rm 9router\ndocker pull decolua/9router:latest   # update to latest\n```\n\n**Data persistence:** `$HOME/.9router/db/data.sqlite` on host ↔ `/app/data/db/data.sqlite` in container.\n\n### Environment Variables\n\n| Variable                                             | Default                                  | Description                                                                         |\n| ---------------------------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------- |\n| `JWT_SECRET`                                         | Auto-generated (`~/.9router/jwt-secret`) | JWT signing secret for dashboard auth cookie (override to share across instances)   |\n| `INITIAL_PASSWORD`                                   | `123456`                                 | First login password when no saved hash exists                                      |\n| `DATA_DIR`                                           | `~/.9router`                             | Main app data location (SQLite at `$DATA_DIR/db/data.sqlite`)                       |\n| `PORT`                                               | framework default                        | Service port (`20128` in examples)                                                  |\n| `HOSTNAME`                                           | framework default                        | Bind host (Docker defaults to `0.0.0.0`)                                            |\n| `NODE_ENV`                                           | runtime default                          | Set `production` for deploy                                                         |\n| `BASE_URL`                                           | `http://localhost:20128`                 | Server-side internal base URL used by cloud sync jobs                               |\n| `CLOUD_URL`                                          | `https://9router.com`                    | Server-side cloud sync endpoint base URL                                            |\n| `NEXT_PUBLIC_BASE_URL`                               | `http://localhost:3000`                  | Backward-compatible/public base URL (prefer `BASE_URL` for server runtime)          |\n| `NEXT_PUBLIC_CLOUD_URL`                              | `https://9router.com`                    | Backward-compatible/public cloud URL (prefer `CLOUD_URL` for server runtime)        |\n| `API_KEY_SECRET`                                     | `endpoint-proxy-api-key-secret`          | HMAC secret for generated API keys                                                  |\n| `MACHINE_ID_SALT`                                    | `endpoint-proxy-salt`                    | Salt for stable machine ID hashing                                                  |\n| `ENABLE_REQUEST_LOGS`                                | `false`                                  | Enables request/response logs under `logs/`                                         |\n| `AUTH_COOKIE_SECURE`                                 | `false`                                  | Force `Secure` auth cookie (set `true` behind HTTPS reverse proxy)                  |\n| `REQUIRE_API_KEY`                                    | `false`                                  | Enforce Bearer API key on `/v1/*` routes (recommended for internet-exposed deploys) |\n| `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY` | empty                                    | Optional outbound proxy for upstream provider calls                                 |\n| `SEARXNG_URL`                                        | `http://localhost:8888/search`           | Endpoint for the built-in unauthenticated SearXNG web-search provider               |\n\nNotes:\n\n- Lowercase proxy variables are also supported: `http_proxy`, `https_proxy`, `all_proxy`, `no_proxy`.\n- `.env` is not baked into Docker image (`.dockerignore`); inject runtime config with `--env-file` or `-e`.\n- On Windows, `APPDATA` can be used for local storage path resolution.\n- `INSTANCE_NAME` appears in older docs/env templates, but is currently not used at runtime.\n\n### Runtime Files and Storage\n\n- Main app state: `${DATA_DIR}/db/data.sqlite` (SQLite — providers, combos, aliases, keys, settings, usage history)\n- Auto backups: `${DATA_DIR}/db/backups/`\n- Optional request/translator logs: `\u003crepo\u003e/logs/...` when `ENABLE_REQUEST_LOGS=true`\n- Both `${DATA_DIR}` and `~/.9router` resolve to the same location in a Docker container — the symlink `/root/.9router -\u003e /app/data` is created at build time.\n\n\u003c/details\u003e\n\n---\n\n## 📊 Available Models\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eView all available models\u003c/b\u003e\u003c/summary\u003e\n\n**Claude Code (`cc/`)** - Pro/Max:\n\n- `cc/claude-opus-4-7`\n- `cc/claude-opus-4-6`\n- `cc/claude-sonnet-4-6`\n- `cc/claude-sonnet-4-5-20250929`\n- `cc/claude-haiku-4-5-20251001`\n\n**Codex (`cx/`)** - Plus/Pro:\n\n- `cx/gpt-5.5`\n- `cx/gpt-5.4`\n- `cx/gpt-5.3-codex`\n- `cx/gpt-5.2-codex`\n- `cx/gpt-5.1-codex-max`\n\n**GitHub Copilot (`gh/`)**:\n\n- `gh/gpt-5.4`\n- `gh/claude-opus-4.7`\n- `gh/claude-sonnet-4.6`\n- `gh/gemini-3.1-pro-preview`\n- `gh/grok-code-fast-1`\n\n**Cursor (`cu/`)** - Subscription:\n\n- `cu/claude-4.6-opus-max`\n- `cu/claude-4.5-sonnet-thinking`\n- `cu/gpt-5.3-codex`\n- `cu/kimi-k2.5`\n\n**GLM (`glm/`)** - $0.6/1M:\n\n- `glm/glm-5.1`\n- `glm/glm-5`\n- `glm/glm-4.7`\n\n**MiniMax (`minimax/`)** - $0.2/1M:\n\n- `minimax/MiniMax-M2.7`\n- `minimax/MiniMax-M2.5`\n\n**Kimi (`kimi/`)** - $9/mo flat:\n\n- `kimi/kimi-k2.5`\n- `kimi/kimi-k2.5-thinking`\n\n**Kiro (`kr/`)** - Free (~50 credits/month, paid tiers above):\n\n- `kr/claude-sonnet-4.5`\n- `kr/claude-haiku-4.5`\n- `kr/glm-5`\n- `kr/MiniMax-M2.5`\n- `kr/qwen3-coder-next`\n- `kr/deepseek-3.2`\n\n**OpenCode Free (`oc/`)** - FREE no-auth:\n\n- Auto-fetched from `opencode.ai/zen/v1/models`\n\n**Vertex AI (`vertex/`)** - $300 free credits:\n\n- `vertex/gemini-3.1-pro-preview`\n- `vertex/gemini-3-flash-preview`\n- `vertex/gemini-2.5-flash`\n- `vertex-partner/glm-5-maas`\n- `vertex-partner/deepseek-v3.2-maas`\n\n\u003c/details\u003e\n\n---\n\n## 🐛 Troubleshooting\n\n**\"Language model did not provide messages\"**\n\n- Provider quota exhausted → Check dashboard quota tracker\n- Solution: Use combo fallback or switch to cheaper tier\n\n**Rate limiting**\n\n- Subscription quota out → Fallback to GLM/MiniMax\n- Add combo: `cc/claude-opus-4-7 → glm/glm-5.1 → kr/claude-sonnet-4.5`\n\n**OAuth token expired**\n\n- Auto-refreshed by 9Router\n- If issues persist: Dashboard → Provider → Reconnect\n\n**High costs**\n\n- Enable RTK in Dashboard → Endpoint settings (default ON, saves 20-40% tokens)\n- Check usage stats in Dashboard\n- Switch primary model to GLM/MiniMax\n- Use free tier (Kiro, OpenCode Free, Vertex) for non-critical tasks\n\n**Dashboard opens on wrong port**\n\n- Set `PORT=20128` and `NEXT_PUBLIC_BASE_URL=http://localhost:20128`\n\n**First login not working**\n\n- Check `INITIAL_PASSWORD` in `.env`\n- If unset, fallback password is `123456`\n\n**No request logs under `logs/`**\n\n- Set `ENABLE_REQUEST_LOGS=true`\n\n---\n\n## 🛠️ Tech Stack\n\n- **Runtime**: Node.js 20+\n- **Framework**: Next.js 16\n- **UI**: React 19 + Tailwind CSS 4\n- **Database**: SQLite (better-sqlite3 / node:sqlite / sql.js fallback)\n- **Streaming**: Server-Sent Events (SSE)\n- **Auth**: OAuth 2.0 (PKCE) + JWT + API Keys\n\n---\n\n## 📝 API Reference\n\n### Chat Completions\n\n```bash\nPOST http://localhost:20128/v1/chat/completions\nAuthorization: Bearer your-api-key\nContent-Type: application/json\n\n{\n  \"model\": \"cc/claude-opus-4-6\",\n  \"messages\": [\n    {\"role\": \"user\", \"content\": \"Write a function to...\"}\n  ],\n  \"stream\": true\n}\n```\n\n### List Models\n\n```bash\nGET http://localhost:20128/v1/models\nAuthorization: Bearer your-api-key\n\n→ Returns all models + combos in OpenAI format\n```\n\n## 📧 Support\n\n- **Website**: [9router.com](https://9router.com)\n- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)\n- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)\n\n---\n\n## 👥 Contributors\n\nThanks to all contributors who helped make 9Router better!\n\n[![Contributors](https://contrib.rocks/image?repo=decolua/9router\u0026max=150\u0026columns=15\u0026anon=1\u0026v=20260309)](https://github.com/decolua/9router/graphs/contributors)\n\n---\n\n## 📊 Star Chart\n\n[![Star Chart](https://starchart.cc/decolua/9router.svg?variant=adaptive)](https://starchart.cc/decolua/9router)\n\n## 🔀 Forks\n\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.\n\n---\n\n## 🙏 Acknowledgments\n\nBuilt on the shoulders of giants:\n\n- **[CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)** — original Go implementation that inspired this JavaScript port.\n- **[RTK](https://github.com/rtk-ai/rtk)** ![Stars](https://img.shields.io/github/stars/rtk-ai/rtk?style=flat\u0026color=yellow) — Rust token-saver. 9Router ports its compression pipeline to JS → **−20-40% input tokens** on every request.\n- **[Caveman](https://github.com/JuliusBrussee/caveman)** ![Stars](https://img.shields.io/github/stars/JuliusBrussee/caveman?style=flat\u0026color=yellow) by **[@JuliusBrussee](https://github.com/JuliusBrussee)** — viral _\"why use many token when few token do trick\"_. 9Router adapts its prompt → **−65% output tokens**.\n- **[Ponytail](https://github.com/DietrichGebert/ponytail)** ![Stars](https://img.shields.io/github/stars/DietrichGebert/ponytail?style=flat\u0026color=yellow) by **[@DietrichGebert](https://github.com/DietrichGebert)** — _\"lazy senior dev\"_ skill. 9Router injects its YAGNI-first ladder → **fewer tokens, less code, shorter diffs**.\n\nHuge thanks to these authors — without their work, 9Router's token-saving features wouldn't exist. ⭐ them on GitHub!\n\n---\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eBuilt with ❤️ for developers who code 24/7\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecolua%2F9router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecolua%2F9router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecolua%2F9router/lists"}