kentutai-app 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/.dockerignore +32 -0
  2. package/Dockerfile +52 -0
  3. package/LICENSE +21 -0
  4. package/README.md +1318 -0
  5. package/README.zh-CN.md +1311 -0
  6. package/captain-definition +4 -0
  7. package/check-connections.js +20 -0
  8. package/check-db.js +41 -0
  9. package/check-key.js +20 -0
  10. package/check-key2.js +21 -0
  11. package/check-mimo-conn.js +29 -0
  12. package/check-mimo.js +22 -0
  13. package/check-nodes.js +26 -0
  14. package/check-nodes2.js +29 -0
  15. package/check-providers.js +48 -0
  16. package/dev.log +15 -0
  17. package/next-env.d.ts +6 -0
  18. package/opencode.json +22 -0
  19. package/package.json +65 -0
  20. package/public/favicon.png +0 -0
  21. package/public/file.svg +1 -0
  22. package/public/globe.svg +1 -0
  23. package/public/i18n/literals/ar.json +194 -0
  24. package/public/i18n/literals/bn.json +194 -0
  25. package/public/i18n/literals/cs.json +194 -0
  26. package/public/i18n/literals/da.json +194 -0
  27. package/public/i18n/literals/de.json +194 -0
  28. package/public/i18n/literals/el.json +194 -0
  29. package/public/i18n/literals/es.json +194 -0
  30. package/public/i18n/literals/fi.json +194 -0
  31. package/public/i18n/literals/fr.json +194 -0
  32. package/public/i18n/literals/he.json +194 -0
  33. package/public/i18n/literals/hi.json +194 -0
  34. package/public/i18n/literals/hu.json +194 -0
  35. package/public/i18n/literals/id.json +194 -0
  36. package/public/i18n/literals/it.json +194 -0
  37. package/public/i18n/literals/ja.json +194 -0
  38. package/public/i18n/literals/ko.json +194 -0
  39. package/public/i18n/literals/nl.json +194 -0
  40. package/public/i18n/literals/no.json +194 -0
  41. package/public/i18n/literals/pl.json +194 -0
  42. package/public/i18n/literals/pt-BR.json +194 -0
  43. package/public/i18n/literals/pt-PT.json +194 -0
  44. package/public/i18n/literals/ro.json +194 -0
  45. package/public/i18n/literals/ru.json +194 -0
  46. package/public/i18n/literals/sv.json +194 -0
  47. package/public/i18n/literals/th.json +194 -0
  48. package/public/i18n/literals/tl.json +194 -0
  49. package/public/i18n/literals/tr.json +194 -0
  50. package/public/i18n/literals/uk.json +194 -0
  51. package/public/i18n/literals/ur.json +194 -0
  52. package/public/i18n/literals/vi.json +194 -0
  53. package/public/i18n/literals/zh-CN.json +768 -0
  54. package/public/i18n/literals/zh-TW.json +194 -0
  55. package/public/icon.ico +0 -0
  56. package/public/icons/icon-192.svg +4 -0
  57. package/public/icons/icon-512.svg +4 -0
  58. package/public/kentutai-icon.png +0 -0
  59. package/public/kentutai-logo.png +0 -0
  60. package/public/next.svg +1 -0
  61. package/public/providers/alicode-intl.png +0 -0
  62. package/public/providers/alicode.png +0 -0
  63. package/public/providers/amp.png +0 -0
  64. package/public/providers/anthropic-m.png +0 -0
  65. package/public/providers/anthropic.png +0 -0
  66. package/public/providers/antigravity.png +0 -0
  67. package/public/providers/assemblyai.png +0 -0
  68. package/public/providers/aws-polly.png +0 -0
  69. package/public/providers/azure.png +0 -0
  70. package/public/providers/black-forest-labs.png +0 -0
  71. package/public/providers/blackbox.png +0 -0
  72. package/public/providers/brave-search.png +0 -0
  73. package/public/providers/byteplus.png +0 -0
  74. package/public/providers/cartesia.png +0 -0
  75. package/public/providers/cerebras.png +0 -0
  76. package/public/providers/chutes.png +0 -0
  77. package/public/providers/claude.png +0 -0
  78. package/public/providers/cline.png +0 -0
  79. package/public/providers/cloudflare-ai.png +0 -0
  80. package/public/providers/codex.png +0 -0
  81. package/public/providers/cohere.png +0 -0
  82. package/public/providers/comfyui.png +0 -0
  83. package/public/providers/commandcode.png +0 -0
  84. package/public/providers/continue.png +0 -0
  85. package/public/providers/copilot.png +0 -0
  86. package/public/providers/coqui.png +0 -0
  87. package/public/providers/cursor.png +0 -0
  88. package/public/providers/deepgram.png +0 -0
  89. package/public/providers/deepseek-tui.png +0 -0
  90. package/public/providers/deepseek.png +0 -0
  91. package/public/providers/droid.png +0 -0
  92. package/public/providers/edge-tts.png +0 -0
  93. package/public/providers/elevenlabs.png +0 -0
  94. package/public/providers/exa.png +0 -0
  95. package/public/providers/fal-ai.png +0 -0
  96. package/public/providers/firecrawl.png +0 -0
  97. package/public/providers/fireworks.png +0 -0
  98. package/public/providers/gemini-cli.png +0 -0
  99. package/public/providers/gemini.png +0 -0
  100. package/public/providers/github.png +0 -0
  101. package/public/providers/glm-cn.png +0 -0
  102. package/public/providers/glm.png +0 -0
  103. package/public/providers/google-pse.png +0 -0
  104. package/public/providers/google-tts.png +0 -0
  105. package/public/providers/grok-web.png +0 -0
  106. package/public/providers/groq.png +0 -0
  107. package/public/providers/hermes.png +0 -0
  108. package/public/providers/huggingface.png +0 -0
  109. package/public/providers/hyperbolic.png +0 -0
  110. package/public/providers/iflow.png +0 -0
  111. package/public/providers/inworld.png +0 -0
  112. package/public/providers/jcode.png +0 -0
  113. package/public/providers/jina-ai.png +0 -0
  114. package/public/providers/jina-reader.png +0 -0
  115. package/public/providers/kilocode.png +0 -0
  116. package/public/providers/kimi-coding.png +0 -0
  117. package/public/providers/kimi.png +0 -0
  118. package/public/providers/kiro.png +0 -0
  119. package/public/providers/linkup.png +0 -0
  120. package/public/providers/local-device.png +0 -0
  121. package/public/providers/minimax-cn.png +0 -0
  122. package/public/providers/minimax.png +0 -0
  123. package/public/providers/mistral.png +0 -0
  124. package/public/providers/nanobanana.png +0 -0
  125. package/public/providers/nebius.png +0 -0
  126. package/public/providers/nvidia.png +0 -0
  127. package/public/providers/oai-cc.png +0 -0
  128. package/public/providers/oai-r.png +0 -0
  129. package/public/providers/ollama-local.png +0 -0
  130. package/public/providers/ollama.png +0 -0
  131. package/public/providers/openai.png +0 -0
  132. package/public/providers/openclaw.png +0 -0
  133. package/public/providers/opencode-go.png +0 -0
  134. package/public/providers/opencode.png +0 -0
  135. package/public/providers/openrouter.png +0 -0
  136. package/public/providers/perplexity-web.png +0 -0
  137. package/public/providers/perplexity.png +0 -0
  138. package/public/providers/playht.png +0 -0
  139. package/public/providers/qwen.png +0 -0
  140. package/public/providers/recraft.png +0 -0
  141. package/public/providers/roo.png +0 -0
  142. package/public/providers/runwayml.png +0 -0
  143. package/public/providers/sdwebui.png +0 -0
  144. package/public/providers/searchapi.png +0 -0
  145. package/public/providers/searxng.png +0 -0
  146. package/public/providers/serper.png +0 -0
  147. package/public/providers/siliconflow.png +0 -0
  148. package/public/providers/stability-ai.png +0 -0
  149. package/public/providers/tavily.png +0 -0
  150. package/public/providers/together.png +0 -0
  151. package/public/providers/topaz.png +0 -0
  152. package/public/providers/tortoise.png +0 -0
  153. package/public/providers/vertex-partner.png +0 -0
  154. package/public/providers/vertex.png +0 -0
  155. package/public/providers/volcengine-ark.png +0 -0
  156. package/public/providers/voyage-ai.png +0 -0
  157. package/public/providers/xai.png +0 -0
  158. package/public/providers/xiaomi-mimo.png +0 -0
  159. package/public/providers/xiaomi-tokenplan.png +0 -0
  160. package/public/providers/youcom.png +0 -0
  161. package/public/sw.js +22 -0
  162. package/public/vercel.svg +1 -0
  163. package/public/window.svg +1 -0
  164. package/start.sh +4 -0
  165. package/vitest.config.js +21 -0
package/README.md ADDED
@@ -0,0 +1,1318 @@
1
+ <div align="center">
2
+ <img src="./images/9router.png?1" alt="9Router Dashboard" width="800"/>
3
+
4
+ # 9Router - FREE AI Router & Token Saver
5
+
6
+ **Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE & cheap AI models.**
7
+
8
+ **Connect All AI Code Tools (Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, OpenClaw...) to 40+ AI Providers & 100+ Models.**
9
+
10
+ [![npm](https://img.shields.io/npm/v/9router.svg)](https://www.npmjs.com/package/9router)
11
+ [![Downloads](https://img.shields.io/npm/dm/9router.svg)](https://www.npmjs.com/package/9router)
12
+ [![Docker Pulls](https://img.shields.io/docker/pulls/decolua/9router.svg?logo=docker&label=Docker%20pulls)](https://hub.docker.com/r/decolua/9router)
13
+ [![GHCR](https://img.shields.io/badge/GHCR-decolua%2F9router-blue?logo=github)](https://github.com/decolua/9router/pkgs/container/9router)
14
+ [![License](https://img.shields.io/npm/l/9router.svg)](https://github.com/decolua/9router/blob/main/LICENSE)
15
+
16
+ <a href="https://trendshift.io/repositories/22628" target="_blank"><img src="https://trendshift.io/api/badge/repositories/22628" alt="decolua%2F9router | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
17
+
18
+ [🚀 Quick Start](#-quick-start) • [💡 Features](#-key-features) • [📖 Setup](#-setup-guide) • [🌐 Website](https://9router.com)
19
+
20
+ [🇻🇳 Tiếng Việt](./i18n/README.vi.md) • [🇨🇳 中文](./i18n/README.zh-CN.md) • [🇯🇵 日本語](./i18n/README.ja-JP.md)
21
+ </div>
22
+
23
+ ---
24
+
25
+ ## 🤔 Why 9Router?
26
+
27
+ **Stop wasting money, tokens and hitting limits:**
28
+
29
+ - ❌ Subscription quota expires unused every month
30
+ - ❌ Rate limits stop you mid-coding
31
+ - ❌ Tool outputs (git diff, grep, ls...) burn tokens fast
32
+ - ❌ Expensive APIs ($20-50/month per provider)
33
+ - ❌ Manual switching between providers
34
+
35
+ **9Router solves this:**
36
+
37
+ - ✅ **RTK Token Saver** - Auto-compress tool_result content, save 20-40% tokens per request
38
+ - ✅ **Maximize subscriptions** - Track quota, use every bit before reset
39
+ - ✅ **Auto fallback** - Subscription → Cheap → Free, zero downtime
40
+ - ✅ **Multi-account** - Round-robin between accounts per provider
41
+ - ✅ **Universal** - Works with Claude Code, Codex, Cursor, Cline, any CLI tool
42
+
43
+ ---
44
+
45
+ ## 🔄 How It Works
46
+
47
+ ```
48
+ ┌─────────────┐
49
+ │ Your CLI │ (Claude Code, Codex, OpenClaw, Cursor, Cline...)
50
+ │ Tool │
51
+ └──────┬──────┘
52
+ │ http://localhost:20128/v1
53
+
54
+ ┌─────────────────────────────────────────────┐
55
+ │ 9Router (Smart Router) │
56
+ │ • RTK Token Saver (cut tool_result tokens) │
57
+ │ • Format translation (OpenAI ↔ Claude) │
58
+ │ • Quota tracking │
59
+ │ • Auto token refresh │
60
+ └──────┬──────────────────────────────────────┘
61
+
62
+ ├─→ [Tier 1: SUBSCRIPTION] Claude Code, Codex, GitHub Copilot
63
+ │ ↓ quota exhausted
64
+ ├─→ [Tier 2: CHEAP] GLM ($0.6/1M), MiniMax ($0.2/1M)
65
+ │ ↓ budget limit
66
+ └─→ [Tier 3: FREE] Kiro, OpenCode Free, Vertex ($300 credits)
67
+
68
+ Result: Never stop coding, minimal cost + 20-40% token savings via RTK
69
+ ```
70
+
71
+ ---
72
+
73
+ ## ⚡ Quick Start
74
+
75
+ **1. Install globally:**
76
+
77
+ ```bash
78
+ npm install -g 9router
79
+ 9router
80
+ ```
81
+
82
+ 🎉 Dashboard opens at `http://localhost:20128`
83
+
84
+ **2. Connect a FREE provider (no signup needed):**
85
+
86
+ Dashboard → Providers → Connect **Kiro AI** (free Claude unlimited) or **OpenCode Free** (no auth) → Done!
87
+
88
+ **3. Use in your CLI tool:**
89
+
90
+ ```
91
+ Claude Code/Codex/OpenClaw/Cursor/Cline Settings:
92
+ Endpoint: http://localhost:20128/v1
93
+ API Key: [copy from dashboard]
94
+ Model: kr/claude-sonnet-4.5
95
+ ```
96
+
97
+ **That's it!** Start coding with FREE AI models.
98
+
99
+ **Alternative: run from source (this repository):**
100
+
101
+ This repository package is private (`9router-app`), so source/Docker execution is the expected local development path.
102
+
103
+ ```bash
104
+ cp .env.example .env
105
+ npm install
106
+ PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev
107
+ ```
108
+
109
+ Production mode:
110
+
111
+ ```bash
112
+ npm run build
113
+ PORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run start
114
+ ```
115
+
116
+ Default URLs:
117
+ - Dashboard: `http://localhost:20128/dashboard`
118
+ - OpenAI-compatible API: `http://localhost:20128/v1`
119
+
120
+ ---
121
+
122
+ ## Video Guides
123
+
124
+ <div align="center">
125
+
126
+ <table>
127
+ <tr>
128
+ <td align="center" width="320">
129
+ <a href="https://www.youtube.com/watch?v=raEyZPg5xE0">
130
+ <img src="https://img.youtube.com/vi/raEyZPg5xE0/maxresdefault.jpg" alt="9Router Setup Tutorial" width="300"/>
131
+ </a><br/>
132
+ <b>🇺🇸 English</b><br/>
133
+ <sub>9Router + Claude Code FREE Setup<br/>by <a href="https://www.youtube.com/@BuildAIWithHamid">Build AI With Hamid</a></sub>
134
+ </td>
135
+ <td align="center" width="320">
136
+ <a href="https://www.youtube.com/watch?v=X69n5Lm06Yw">
137
+ <img src="https://img.youtube.com/vi/X69n5Lm06Yw/maxresdefault.jpg" alt="Tiết kiệm chi phí LLM với 9Router" width="300"/>
138
+ </a><br/>
139
+ <b>🇻🇳 Tiếng Việt</b><br/>
140
+ <sub>Tiết kiệm chi phí LLM cho OpenClaw với 9Router<br/>by <a href="https://www.youtube.com/c/M%C3%ACAIblog">Mì AI</a></sub>
141
+ </td>
142
+ <td align="center" width="320">
143
+ <a href="https://www.youtube.com/watch?v=o3qYCyjrFYg">
144
+ <img src="https://img.youtube.com/vi/o3qYCyjrFYg/maxresdefault.jpg" alt="Claude Code FREE Forever" width="300"/>
145
+ </a><br/>
146
+ <b>🇺🇸 English</b><br/>
147
+ <sub>Claude Code FREE Forever — Unlimited Models<br/>by <a href="https://www.youtube.com/@BuildAIWithHamid">Build AI With Hamid</a></sub>
148
+ </td>
149
+ </tr>
150
+ <tr>
151
+ <td align="center" width="320">
152
+ <a href="https://www.youtube.com/watch?v=Ttpc26m39Dw">
153
+ <img src="https://img.youtube.com/vi/Ttpc26m39Dw/maxresdefault.jpg" alt="Claude CLI Free Setup" width="300"/>
154
+ </a><br/>
155
+ <b>🇺🇸 English</b><br/>
156
+ <sub>Claude CLI Free Setup with 9Router 🚀<br/>by <a href="https://www.youtube.com/@CodeVerseSoban">CodeVerse Soban</a></sub>
157
+ </td>
158
+ <td align="center" width="320">
159
+ <a href="https://www.youtube.com/watch?v=G-5A_D5Pm6Y">
160
+ <img src="https://img.youtube.com/vi/G-5A_D5Pm6Y/maxresdefault.jpg" alt="Cài đặt OpenClaw Free A-Z" width="300"/>
161
+ </a><br/>
162
+ <b>🇻🇳 Tiếng Việt</b><br/>
163
+ <sub>Cài Đặt OpenClaw Free Từ A-Z + 9Router<br/>by <a href="https://www.youtube.com/@maigia">Mai Gia</a></sub>
164
+ </td>
165
+ <td align="center" width="320">
166
+ <a href="https://www.youtube.com/watch?v=JXmg8_gccgE">
167
+ <img src="https://img.youtube.com/vi/JXmg8_gccgE/maxresdefault.jpg" alt="FREE OpenClaw with Claude Opus" width="300"/>
168
+ </a><br/>
169
+ <b>🇺🇸 English</b><br/>
170
+ <sub>FREE OpenClaw + Claude Opus 4.6<br/>by <a href="https://www.youtube.com/@BuildAIWithHamid">Build AI With Hamid</a></sub>
171
+ </td>
172
+ </tr>
173
+ </table>
174
+
175
+ </div>
176
+
177
+ > 🎬 **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!
178
+
179
+ ---
180
+
181
+ ## 🛠️ Supported CLI Tools
182
+
183
+ 9Router works seamlessly with all major AI coding tools:
184
+
185
+ <div align="center">
186
+ <table>
187
+ <tr>
188
+ <td align="center" width="120">
189
+ <img src="./public/providers/claude.png" width="60" alt="Claude Code"/><br/>
190
+ <b>Claude-Code</b>
191
+ </td>
192
+ <td align="center" width="120">
193
+ <img src="./public/providers/openclaw.png" width="60" alt="OpenClaw"/><br/>
194
+ <b>OpenClaw</b>
195
+ </td>
196
+ <td align="center" width="120">
197
+ <img src="./public/providers/codex.png" width="60" alt="Codex"/><br/>
198
+ <b>Codex</b>
199
+ </td>
200
+ <td align="center" width="120">
201
+ <img src="./public/providers/opencode.png" width="60" alt="OpenCode"/><br/>
202
+ <b>OpenCode</b>
203
+ </td>
204
+ <td align="center" width="120">
205
+ <img src="./public/providers/cursor.png" width="60" alt="Cursor"/><br/>
206
+ <b>Cursor</b>
207
+ </td>
208
+ <td align="center" width="120">
209
+ <img src="./public/providers/antigravity.png" width="60" alt="Antigravity"/><br/>
210
+ <b>Antigravity</b>
211
+ </td>
212
+ </tr>
213
+ <tr>
214
+ <td align="center" width="120">
215
+ <img src="./public/providers/cline.png" width="60" alt="Cline"/><br/>
216
+ <b>Cline</b>
217
+ </td>
218
+ <td align="center" width="120">
219
+ <img src="./public/providers/continue.png" width="60" alt="Continue"/><br/>
220
+ <b>Continue</b>
221
+ </td>
222
+ <td align="center" width="120">
223
+ <img src="./public/providers/droid.png" width="60" alt="Droid"/><br/>
224
+ <b>Droid</b>
225
+ </td>
226
+ <td align="center" width="120">
227
+ <img src="./public/providers/roo.png" width="60" alt="Roo"/><br/>
228
+ <b>Roo</b>
229
+ </td>
230
+ <td align="center" width="120">
231
+ <img src="./public/providers/copilot.png" width="60" alt="Copilot"/><br/>
232
+ <b>Copilot</b>
233
+ </td>
234
+ <td align="center" width="120">
235
+ <img src="./public/providers/kilocode.png" width="60" alt="Kilo Code"/><br/>
236
+ <b>Kilo Code</b>
237
+ </td>
238
+ </tr>
239
+ </table>
240
+ </div>
241
+
242
+ ---
243
+
244
+ ## 🌐 Supported Providers
245
+
246
+ ### 🔐 OAuth Providers
247
+
248
+ <div align="center">
249
+ <table>
250
+ <tr>
251
+ <td align="center" width="120">
252
+ <img src="./public/providers/claude.png" width="60" alt="Claude Code"/><br/>
253
+ <b>Claude-Code</b>
254
+ </td>
255
+ <td align="center" width="120">
256
+ <img src="./public/providers/antigravity.png" width="60" alt="Antigravity"/><br/>
257
+ <b>Antigravity</b>
258
+ </td>
259
+ <td align="center" width="120">
260
+ <img src="./public/providers/codex.png" width="60" alt="Codex"/><br/>
261
+ <b>Codex</b>
262
+ </td>
263
+ <td align="center" width="120">
264
+ <img src="./public/providers/github.png" width="60" alt="GitHub"/><br/>
265
+ <b>GitHub</b>
266
+ </td>
267
+ <td align="center" width="120">
268
+ <img src="./public/providers/cursor.png" width="60" alt="Cursor"/><br/>
269
+ <b>Cursor</b>
270
+ </td>
271
+ </tr>
272
+ </table>
273
+ </div>
274
+
275
+ ### 🆓 Free Providers
276
+
277
+ <div align="center">
278
+ <table>
279
+ <tr>
280
+ <td align="center" width="150">
281
+ <img src="./public/providers/kiro.png" width="70" alt="Kiro"/><br/>
282
+ <b>Kiro AI</b><br/>
283
+ <sub>Claude 4.5 + GLM-5 + MiniMax<br/>Unlimited FREE</sub>
284
+ </td>
285
+ <td align="center" width="150">
286
+ <img src="./public/providers/opencode.png" width="70" alt="OpenCode Free"/><br/>
287
+ <b>OpenCode Free</b><br/>
288
+ <sub>No auth • Auto-fetch models<br/>Unlimited FREE</sub>
289
+ </td>
290
+ <td align="center" width="150">
291
+ <img src="./public/providers/gemini.png" width="70" alt="Vertex AI"/><br/>
292
+ <b>Vertex AI</b><br/>
293
+ <sub>Gemini 3 Pro + GLM-5 + DeepSeek<br/>$300 credits free</sub>
294
+ </td>
295
+ </tr>
296
+ </table>
297
+ </div>
298
+
299
+ > **Note:** iFlow, Qwen and Gemini CLI free tiers were discontinued in 2026. Use Kiro / OpenCode Free / Vertex instead.
300
+
301
+ ### 🔑 API Key Providers (40+)
302
+
303
+ <div align="center">
304
+ <table>
305
+ <tr>
306
+ <td align="center" width="100">
307
+ <img src="./public/providers/openrouter.png" width="50" alt="OpenRouter"/><br/>
308
+ <sub>OpenRouter</sub>
309
+ </td>
310
+ <td align="center" width="100">
311
+ <img src="./public/providers/glm.png" width="50" alt="GLM"/><br/>
312
+ <sub>GLM</sub>
313
+ </td>
314
+ <td align="center" width="100">
315
+ <img src="./public/providers/kimi.png" width="50" alt="Kimi"/><br/>
316
+ <sub>Kimi</sub>
317
+ </td>
318
+ <td align="center" width="100">
319
+ <img src="./public/providers/minimax.png" width="50" alt="MiniMax"/><br/>
320
+ <sub>MiniMax</sub>
321
+ </td>
322
+ <td align="center" width="100">
323
+ <img src="./public/providers/openai.png" width="50" alt="OpenAI"/><br/>
324
+ <sub>OpenAI</sub>
325
+ </td>
326
+ <td align="center" width="100">
327
+ <img src="./public/providers/anthropic.png" width="50" alt="Anthropic"/><br/>
328
+ <sub>Anthropic</sub>
329
+ </td>
330
+ </tr>
331
+ <tr>
332
+ <td align="center" width="100">
333
+ <img src="./public/providers/gemini.png" width="50" alt="Gemini"/><br/>
334
+ <sub>Gemini</sub>
335
+ </td>
336
+ <td align="center" width="100">
337
+ <img src="./public/providers/deepseek.png" width="50" alt="DeepSeek"/><br/>
338
+ <sub>DeepSeek</sub>
339
+ </td>
340
+ <td align="center" width="100">
341
+ <img src="./public/providers/groq.png" width="50" alt="Groq"/><br/>
342
+ <sub>Groq</sub>
343
+ </td>
344
+ <td align="center" width="100">
345
+ <img src="./public/providers/xai.png" width="50" alt="xAI"/><br/>
346
+ <sub>xAI</sub>
347
+ </td>
348
+ <td align="center" width="100">
349
+ <img src="./public/providers/mistral.png" width="50" alt="Mistral"/><br/>
350
+ <sub>Mistral</sub>
351
+ </td>
352
+ <td align="center" width="100">
353
+ <img src="./public/providers/perplexity.png" width="50" alt="Perplexity"/><br/>
354
+ <sub>Perplexity</sub>
355
+ </td>
356
+ </tr>
357
+ <tr>
358
+ <td align="center" width="100">
359
+ <img src="./public/providers/together.png" width="50" alt="Together"/><br/>
360
+ <sub>Together AI</sub>
361
+ </td>
362
+ <td align="center" width="100">
363
+ <img src="./public/providers/fireworks.png" width="50" alt="Fireworks"/><br/>
364
+ <sub>Fireworks</sub>
365
+ </td>
366
+ <td align="center" width="100">
367
+ <img src="./public/providers/cerebras.png" width="50" alt="Cerebras"/><br/>
368
+ <sub>Cerebras</sub>
369
+ </td>
370
+ <td align="center" width="100">
371
+ <img src="./public/providers/cohere.png" width="50" alt="Cohere"/><br/>
372
+ <sub>Cohere</sub>
373
+ </td>
374
+ <td align="center" width="100">
375
+ <img src="./public/providers/nvidia.png" width="50" alt="NVIDIA"/><br/>
376
+ <sub>NVIDIA</sub>
377
+ </td>
378
+ <td align="center" width="100">
379
+ <img src="./public/providers/siliconflow.png" width="50" alt="SiliconFlow"/><br/>
380
+ <sub>SiliconFlow</sub>
381
+ </td>
382
+ </tr>
383
+ </table>
384
+ <p><i>...and 20+ more providers including Nebius, Chutes, Hyperbolic, and custom OpenAI/Anthropic compatible endpoints</i></p>
385
+ </div>
386
+
387
+ ---
388
+
389
+ ## 💡 Key Features
390
+
391
+ | Feature | What It Does | Why It Matters |
392
+ |---------|--------------|----------------|
393
+ | 🚀 **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 |
394
+ | 🪨 **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** |
395
+ | 🎯 **Smart 3-Tier Fallback** | Auto-route: Subscription → Cheap → Free | Never stop coding, zero downtime |
396
+ | 📊 **Real-Time Quota Tracking** | Live token count + reset countdown | Maximize subscription value |
397
+ | 🔄 **Format Translation** | OpenAI ↔ Claude ↔ Gemini ↔ Cursor ↔ Kiro ↔ Vertex | Works with any CLI tool |
398
+ | 👥 **Multi-Account Support** | Multiple accounts per provider | Load balancing + redundancy |
399
+ | 🔄 **Auto Token Refresh** | OAuth tokens refresh automatically | No manual re-login needed |
400
+ | 🎨 **Custom Combos** | Create unlimited model combinations | Tailor fallback to your needs |
401
+ | 📝 **Request Logging** | Debug mode with full request/response logs | Troubleshoot issues easily |
402
+ | 💾 **Cloud Sync** | Sync config across devices | Same setup everywhere |
403
+ | 📊 **Usage Analytics** | Track tokens, cost, trends over time | Optimize spending |
404
+ | 🌐 **Deploy Anywhere** | Localhost, VPS, Docker, Cloudflare Workers | Flexible deployment options |
405
+
406
+ <details>
407
+ <summary><b>📖 Feature Details</b></summary>
408
+
409
+ ### 🚀 RTK Token Saver
410
+
411
+ Tool 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:
412
+
413
+ - **Filters:** `git-diff`, `git-status`, `grep`, `find`, `ls`, `tree`, `dedup-log`, `smart-truncate`, `read-numbered`, `search-list`
414
+ - **Auto-detect:** No config needed — RTK peeks the first 1KB of each `tool_result` and picks the right filter.
415
+ - **Safe by design:** If a filter fails, throws, or makes output bigger, RTK silently keeps the original text. Errors never break your request.
416
+ - **Universal:** Works across all formats (OpenAI, Claude, Gemini, Cursor, Kiro, OpenAI Responses) because it runs **before** any format translation.
417
+ - **Default ON:** Toggle anytime in Dashboard → Endpoint settings.
418
+
419
+ ```
420
+ Without RTK: 47K tokens sent to LLM
421
+ With RTK: 28K tokens sent to LLM (40% saved · same context · same answer)
422
+ ```
423
+
424
+ ### 🎯 Smart 3-Tier Fallback
425
+
426
+ Create combos with automatic fallback:
427
+
428
+ ```
429
+ Combo: "my-coding-stack"
430
+ 1. cc/claude-opus-4-6 (your subscription)
431
+ 2. glm/glm-4.7 (cheap backup, $0.6/1M)
432
+ 3. if/kimi-k2-thinking (free fallback)
433
+
434
+ → Auto switches when quota runs out or errors occur
435
+ ```
436
+
437
+ ### 📊 Real-Time Quota Tracking
438
+
439
+ - Token consumption per provider
440
+ - Reset countdown (5-hour, daily, weekly)
441
+ - Cost estimation for paid tiers
442
+ - Monthly spending reports
443
+
444
+ ### 🔄 Format Translation
445
+
446
+ Seamless translation between formats:
447
+ - **OpenAI** ↔ **Claude** ↔ **Gemini** ↔ **Cursor** ↔ **Kiro** ↔ **Vertex** ↔ **Antigravity** ↔ **Ollama** ↔ **OpenAI Responses**
448
+ - Your CLI tool sends OpenAI format → 9Router translates → Provider receives native format
449
+ - Works with any tool that supports custom OpenAI endpoints
450
+
451
+ ### 👥 Multi-Account Support
452
+
453
+ - Add multiple accounts per provider
454
+ - Auto round-robin or priority-based routing
455
+ - Fallback to next account when one hits quota
456
+
457
+ ### 🔄 Auto Token Refresh
458
+
459
+ - OAuth tokens automatically refresh before expiration
460
+ - No manual re-authentication needed
461
+ - Seamless experience across all providers
462
+
463
+ ### 🎨 Custom Combos
464
+
465
+ - Create unlimited model combinations
466
+ - Mix subscription, cheap, and free tiers
467
+ - Name your combos for easy access
468
+ - Share combos across devices with Cloud Sync
469
+
470
+ ### 📝 Request Logging
471
+
472
+ - Enable debug mode for full request/response logs
473
+ - Track API calls, headers, and payloads
474
+ - Troubleshoot integration issues
475
+ - Export logs for analysis
476
+
477
+ ### 💾 Cloud Sync
478
+
479
+ - Sync providers, combos, and settings across devices
480
+ - Automatic background sync
481
+ - Secure encrypted storage
482
+ - Access your setup from anywhere
483
+
484
+ #### Cloud Runtime Notes
485
+
486
+ - Prefer server-side cloud variables in production:
487
+ - `BASE_URL` (internal callback URL used by sync scheduler)
488
+ - `CLOUD_URL` (cloud sync endpoint base)
489
+ - `NEXT_PUBLIC_BASE_URL` and `NEXT_PUBLIC_CLOUD_URL` are still supported for compatibility/UI, but server runtime now prioritizes `BASE_URL`/`CLOUD_URL`.
490
+ - Cloud sync requests now use timeout + fail-fast behavior to avoid UI hanging when cloud DNS/network is unavailable.
491
+
492
+ ### 📊 Usage Analytics
493
+
494
+ - Track token usage per provider and model
495
+ - Cost estimation and spending trends
496
+ - Monthly reports and insights
497
+ - Optimize your AI spending
498
+
499
+ > **💡 IMPORTANT - Understanding Dashboard Costs:**
500
+ >
501
+ > The "cost" displayed in Usage Analytics is **for tracking and comparison purposes only**.
502
+ > 9Router itself **never charges** you anything. You only pay providers directly (if using paid services).
503
+ >
504
+ > **Example:** If your dashboard shows "$290 total cost" while using iFlow models, this represents
505
+ > what you would have paid using paid APIs directly. Your actual cost = **$0** (iFlow is free unlimited).
506
+ >
507
+ > Think of it as a "savings tracker" showing how much you're saving by using free models or
508
+ > routing through 9Router!
509
+
510
+ ### 🌐 Deploy Anywhere
511
+
512
+ - 💻 **Localhost** - Default, works offline
513
+ - ☁️ **VPS/Cloud** - Share across devices
514
+ - 🐳 **Docker** - One-command deployment
515
+ - 🚀 **Cloudflare Workers** - Global edge network
516
+
517
+ </details>
518
+
519
+ ---
520
+
521
+ ## 💰 Pricing at a Glance
522
+
523
+ | Tier | Provider | Cost | Quota Reset | Best For |
524
+ |------|----------|------|-------------|----------|
525
+ | **🚀 TOKEN SAVER** | **RTK (built-in)** | **FREE** | Always on | **Save 20-40% tokens on EVERY request** |
526
+ | **💳 SUBSCRIPTION** | Claude Code (Pro/Max) | $20-200/mo | 5h + weekly | Already subscribed |
527
+ | | Codex (Plus/Pro) | $20-200/mo | 5h + weekly | OpenAI users |
528
+ | | GitHub Copilot | $10-19/mo | Monthly | GitHub users |
529
+ | | Cursor IDE | $20/mo | Monthly | Cursor users |
530
+ | **💰 CHEAP** | GLM-5.1 / GLM-4.7 | $0.6/1M | Daily 10AM | Budget backup |
531
+ | | MiniMax M2.7 | $0.2/1M | 5-hour rolling | Cheapest option |
532
+ | | Kimi K2.5 | $9/mo flat | 10M tokens/mo | Predictable cost |
533
+ | **🆓 FREE** | Kiro AI | $0 | Unlimited | Claude 4.5 + GLM-5 + MiniMax free |
534
+ | | OpenCode Free | $0 | Unlimited | No auth, auto-fetch models |
535
+ | | Vertex AI | $300 credits | New GCP accounts | Gemini 3 Pro + DeepSeek + GLM-5 |
536
+
537
+ **💡 Pro Tip:** RTK + Kiro AI + OpenCode Free combo = **$0 cost + 20-40% token savings**!
538
+
539
+ ---
540
+
541
+ ### 📊 Understanding 9Router Costs & Billing
542
+
543
+ **9Router Billing Reality:**
544
+
545
+ ✅ **9Router software = FREE forever** (open source, never charges)
546
+ ✅ **Dashboard "costs" = Display/tracking only** (not actual bills)
547
+ ✅ **You pay providers directly** (subscriptions or API fees)
548
+ ✅ **FREE providers stay FREE** (iFlow, Kiro, Qwen = $0 unlimited)
549
+ ❌ **9Router never sends invoices** or charges your card
550
+
551
+ **How Cost Display Works:**
552
+
553
+ The 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.
554
+
555
+ **Example Scenario:**
556
+ ```
557
+ Dashboard Display:
558
+ • Total Requests: 1,662
559
+ • Total Tokens: 47M
560
+ • Display Cost: $290
561
+
562
+ Reality Check:
563
+ • Provider: iFlow (FREE unlimited)
564
+ • Actual Payment: $0.00
565
+ • What $290 Means: Amount you SAVED by using free models!
566
+ ```
567
+
568
+ **Payment Rules:**
569
+ - **Subscription providers** (Claude Code, Codex): Pay them directly via their websites
570
+ - **Cheap providers** (GLM, MiniMax): Pay them directly, 9Router just routes
571
+ - **FREE providers** (iFlow, Kiro, Qwen): Genuinely free forever, no hidden charges
572
+ - **9Router**: Never charges anything, ever
573
+
574
+ ---
575
+
576
+ ## 🎯 Use Cases
577
+
578
+ ### Case 1: "I have Claude Pro subscription"
579
+
580
+ **Problem:** Quota expires unused, rate limits during heavy coding
581
+
582
+ **Solution:**
583
+ ```
584
+ Combo: "maximize-claude"
585
+ 1. cc/claude-opus-4-7 (use subscription fully)
586
+ 2. glm/glm-5.1 (cheap backup when quota out)
587
+ 3. kr/claude-sonnet-4.5 (free emergency fallback)
588
+
589
+ Monthly cost: $20 (subscription) + ~$5 (backup) = $25 total
590
+ vs. $20 + hitting limits = frustration
591
+ ```
592
+
593
+ ### Case 2: "I want zero cost"
594
+
595
+ **Problem:** Can't afford subscriptions, need reliable AI coding
596
+
597
+ **Solution:**
598
+ ```
599
+ Combo: "free-forever"
600
+ 1. kr/claude-sonnet-4.5 (Claude 4.5 free unlimited)
601
+ 2. kr/glm-5 (GLM-5 free via Kiro)
602
+ 3. oc/<auto> (OpenCode Free, no auth)
603
+
604
+ Monthly cost: $0
605
+ Quality: Production-ready models + RTK saves 20-40% tokens
606
+ ```
607
+
608
+ ### Case 3: "I need 24/7 coding, no interruptions"
609
+
610
+ **Problem:** Deadlines, can't afford downtime
611
+
612
+ **Solution:**
613
+ ```
614
+ Combo: "always-on"
615
+ 1. cc/claude-opus-4-7 (best quality)
616
+ 2. cx/gpt-5.5 (second subscription)
617
+ 3. glm/glm-5.1 (cheap, resets daily)
618
+ 4. minimax/MiniMax-M2.7 (cheapest, 5h reset)
619
+ 5. kr/claude-sonnet-4.5 (free unlimited)
620
+
621
+ Result: 5 layers of fallback = zero downtime
622
+ Monthly cost: $20-200 (subscriptions) + $10-20 (backup)
623
+ ```
624
+
625
+ ### Case 4: "I want FREE AI in OpenClaw"
626
+
627
+ **Problem:** Need AI assistant in messaging apps (WhatsApp, Telegram, Slack...), completely free
628
+
629
+ **Solution:**
630
+ ```
631
+ Combo: "openclaw-free"
632
+ 1. kr/claude-sonnet-4.5 (Claude 4.5 free)
633
+ 2. kr/glm-5 (GLM-5 free)
634
+ 3. kr/MiniMax-M2.5 (MiniMax free)
635
+
636
+ Monthly cost: $0
637
+ Access via: WhatsApp, Telegram, Slack, Discord, iMessage, Signal...
638
+ ```
639
+
640
+ ---
641
+
642
+ ## ❓ Frequently Asked Questions
643
+
644
+ <details>
645
+ <summary><b>📊 Why does my dashboard show high costs?</b></summary>
646
+
647
+ The 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.
648
+
649
+ **Example:**
650
+ - **Dashboard shows:** "$290 total cost"
651
+ - **Reality:** You're using iFlow (FREE unlimited)
652
+ - **Your actual cost:** **$0.00**
653
+ - **What $290 means:** Amount you **saved** by using free models instead of paid APIs!
654
+
655
+ The cost display is a "savings tracker" to help you understand your usage patterns and optimization opportunities.
656
+
657
+ </details>
658
+
659
+ <details>
660
+ <summary><b>💳 Will I be charged by 9Router?</b></summary>
661
+
662
+ **No.** 9Router is free, open-source software that runs on your own computer. It never charges you anything.
663
+
664
+ **You only pay:**
665
+ - ✅ **Subscription providers** (Claude Code $20/mo, Codex $20-200/mo) → Pay them directly on their websites
666
+ - ✅ **Cheap providers** (GLM, MiniMax) → Pay them directly, 9Router just routes your requests
667
+ - ❌ **9Router itself** → **Never charges anything, ever**
668
+
669
+ 9Router 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.
670
+
671
+ </details>
672
+
673
+ <details>
674
+ <summary><b>🆓 Are FREE providers really unlimited?</b></summary>
675
+
676
+ **Yes!** The current FREE providers (Kiro, OpenCode Free, Vertex) are genuinely free with **no hidden charges**.
677
+
678
+ These are free services offered by those respective companies:
679
+ - **Kiro AI**: Free unlimited Claude 4.5 + GLM-5 + MiniMax via AWS Builder ID / Google / GitHub OAuth
680
+ - **OpenCode Free**: No-auth passthrough proxy, models auto-fetched from `opencode.ai/zen/v1/models`
681
+ - **Vertex AI**: $300 free credits for new Google Cloud accounts (90 days)
682
+
683
+ 9Router 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.
684
+
685
+ **Discontinued free tiers (no longer recommended):**
686
+ - ❌ **iFlow**: Was free unlimited, now changed to paid (2026)
687
+ - ❌ **Qwen Code**: Free OAuth tier discontinued by Alibaba on 2026-04-15
688
+ - ❌ **Gemini CLI**: Still works, but using it with non-CLI tools (Claude, Codex, Cursor...) may result in account bans — only use if you stick to Gemini CLI itself
689
+
690
+ </details>
691
+
692
+ <details>
693
+ <summary><b>💰 How do I minimize my actual AI costs?</b></summary>
694
+
695
+ **Free-First Strategy:**
696
+
697
+ 1. **Start with 100% free combo:**
698
+ ```
699
+ 1. gc/gemini-3-flash (180K/month free from Google)
700
+ 2. if/kimi-k2-thinking (unlimited free from iFlow)
701
+ 3. qw/qwen3-coder-plus (unlimited free from Qwen)
702
+ ```
703
+ **Cost: $0/month**
704
+
705
+ 2. **Add cheap backup** only if you need it:
706
+ ```
707
+ 4. glm/glm-4.7 ($0.6/1M tokens)
708
+ ```
709
+ **Additional cost: Only pay for what you actually use**
710
+
711
+ 3. **Use subscription providers last:**
712
+ - Only if you already have them
713
+ - 9Router helps maximize their value through quota tracking
714
+
715
+ **Result:** Most users can operate at $0/month using only free tiers!
716
+
717
+ </details>
718
+
719
+ <details>
720
+ <summary><b>📈 What if my usage suddenly spikes?</b></summary>
721
+
722
+ 9Router's smart fallback prevents surprise charges:
723
+
724
+ **Scenario:** You're on a coding sprint and blow through your quotas
725
+
726
+ **Without 9Router:**
727
+ - ❌ Hit rate limit → Work stops → Frustration
728
+ - ❌ Or: Accidentally rack up huge API bills
729
+
730
+ **With 9Router:**
731
+ - ✅ Subscription hits limit → Auto-fallback to cheap tier
732
+ - ✅ Cheap tier gets expensive → Auto-fallback to free tier
733
+ - ✅ Never stop coding → Predictable costs
734
+
735
+ **You're in control:** Set spending limits per provider in dashboard, and 9Router respects them.
736
+
737
+ </details>
738
+
739
+ ---
740
+
741
+ ## 📖 Setup Guide
742
+
743
+ <details>
744
+ <summary><b>🔐 Subscription Providers (Maximize Value)</b></summary>
745
+
746
+ ### Claude Code (Pro/Max)
747
+
748
+ ```bash
749
+ Dashboard → Providers → Connect Claude Code
750
+ → OAuth login → Auto token refresh
751
+ → 5-hour + weekly quota tracking
752
+
753
+ Models:
754
+ cc/claude-opus-4-7
755
+ cc/claude-opus-4-6
756
+ cc/claude-sonnet-4-6
757
+ cc/claude-haiku-4-5-20251001
758
+ ```
759
+
760
+ **Pro Tip:** Use Opus for complex tasks, Sonnet for speed. 9Router tracks quota per model!
761
+
762
+ ### OpenAI Codex (Plus/Pro)
763
+
764
+ ```bash
765
+ Dashboard → Providers → Connect Codex
766
+ → OAuth login (port 1455)
767
+ → 5-hour + weekly reset
768
+
769
+ Models:
770
+ cx/gpt-5.5
771
+ cx/gpt-5.4
772
+ cx/gpt-5.3-codex
773
+ cx/gpt-5.2-codex
774
+ ```
775
+
776
+ ### GitHub Copilot
777
+
778
+ ```bash
779
+ Dashboard → Providers → Connect GitHub
780
+ → OAuth via GitHub
781
+ → Monthly reset (1st of month)
782
+
783
+ Models:
784
+ gh/gpt-5.4
785
+ gh/claude-opus-4.7
786
+ gh/claude-sonnet-4.6
787
+ gh/gemini-3.1-pro-preview
788
+ gh/grok-code-fast-1
789
+ ```
790
+
791
+ ### Cursor IDE
792
+
793
+ ```bash
794
+ Dashboard → Providers → Connect Cursor
795
+ → OAuth login
796
+ → Monthly subscription
797
+
798
+ Models:
799
+ cu/claude-4.6-opus-max
800
+ cu/claude-4.5-sonnet-thinking
801
+ cu/gpt-5.3-codex
802
+ ```
803
+
804
+ </details>
805
+
806
+ <details>
807
+ <summary><b>💰 Cheap Providers (Backup)</b></summary>
808
+
809
+ ### GLM-5.1 / GLM-4.7 (Daily reset, $0.6/1M)
810
+
811
+ 1. Sign up: [Zhipu AI](https://open.bigmodel.cn/)
812
+ 2. Get API key from Coding Plan
813
+ 3. Dashboard → Add API Key:
814
+ - Provider: `glm`
815
+ - API Key: `your-key`
816
+
817
+ **Use:** `glm/glm-5.1`, `glm/glm-5`, `glm/glm-4.7`
818
+
819
+ **Pro Tip:** Coding Plan offers 3× quota at 1/7 cost! Reset daily 10:00 AM.
820
+
821
+ ### MiniMax M2.7 (5h reset, $0.20/1M)
822
+
823
+ 1. Sign up: [MiniMax](https://www.minimax.io/)
824
+ 2. Get API key
825
+ 3. Dashboard → Add API Key
826
+
827
+ **Use:** `minimax/MiniMax-M2.7`, `minimax/MiniMax-M2.5`
828
+
829
+ **Pro Tip:** Cheapest option for long context (1M tokens)!
830
+
831
+ ### Kimi K2.5 ($9/month flat)
832
+
833
+ 1. Subscribe: [Moonshot AI](https://platform.moonshot.ai/)
834
+ 2. Get API key
835
+ 3. Dashboard → Add API Key
836
+
837
+ **Use:** `kimi/kimi-k2.5`, `kimi/kimi-k2.5-thinking`
838
+
839
+ **Pro Tip:** Fixed $9/month for 10M tokens = $0.90/1M effective cost!
840
+
841
+ </details>
842
+
843
+ <details>
844
+ <summary><b>🆓 FREE Providers (Recommended)</b></summary>
845
+
846
+ ### Kiro AI (Claude 4.5 + GLM-5 + MiniMax FREE)
847
+
848
+ ```bash
849
+ Dashboard → Connect Kiro
850
+ → AWS Builder ID, AWS IAM Identity Center, Google, or GitHub
851
+ → Unlimited usage
852
+
853
+ Models:
854
+ kr/claude-sonnet-4.5
855
+ kr/claude-haiku-4.5
856
+ kr/glm-5
857
+ kr/MiniMax-M2.5
858
+ kr/qwen3-coder-next
859
+ kr/deepseek-3.2
860
+ ```
861
+
862
+ **Pro Tip:** Best free option for Claude. No API key, no payment, fully unlimited.
863
+
864
+ ### OpenCode Free (No auth, auto-fetch models)
865
+
866
+ ```bash
867
+ Dashboard → Connect OpenCode Free
868
+ → No login required (passthrough proxy)
869
+ → Models auto-fetched from opencode.ai/zen/v1/models
870
+ ```
871
+
872
+ **Pro Tip:** Fastest setup. Just connect and start coding.
873
+
874
+ ### Vertex AI ($300 free credits for new GCP accounts)
875
+
876
+ ```bash
877
+ Dashboard → Connect Vertex AI
878
+ → Upload Google Cloud Service Account JSON
879
+ → Enable Vertex AI API in your GCP project
880
+
881
+ Models:
882
+ vertex/gemini-3.1-pro-preview
883
+ vertex/gemini-3-flash-preview
884
+ vertex/gemini-2.5-flash
885
+
886
+ Vertex Partner (Anthropic / DeepSeek / GLM / Qwen via Vertex):
887
+ vertex-partner/glm-5-maas
888
+ vertex-partner/deepseek-v3.2-maas
889
+ vertex-partner/qwen3-next-80b-a3b-thinking-maas
890
+ ```
891
+
892
+ **Pro Tip:** New Google Cloud accounts get $300 credits free for 90 days. Plenty for daily coding.
893
+
894
+ </details>
895
+
896
+ <details>
897
+ <summary><b>🎨 Create Combos</b></summary>
898
+
899
+ ### Example 1: Maximize Subscription → Cheap Backup
900
+
901
+ ```
902
+ Dashboard → Combos → Create New
903
+
904
+ Name: premium-coding
905
+ Models:
906
+ 1. cc/claude-opus-4-7 (Subscription primary)
907
+ 2. glm/glm-5.1 (Cheap backup, $0.6/1M)
908
+ 3. minimax/MiniMax-M2.7 (Cheapest fallback, $0.20/1M)
909
+
910
+ Use in CLI: premium-coding
911
+
912
+ Monthly cost example (100M tokens):
913
+ 80M via Claude (subscription): $0 extra
914
+ 15M via GLM: $9
915
+ 5M via MiniMax: $1
916
+ Total: $10 + your subscription
917
+ ```
918
+
919
+ ### Example 2: Free-Only (Zero Cost)
920
+
921
+ ```
922
+ Name: free-combo
923
+ Models:
924
+ 1. kr/claude-sonnet-4.5 (Claude 4.5 free unlimited)
925
+ 2. kr/glm-5 (GLM-5 free via Kiro)
926
+ 3. vertex/gemini-3.1-pro-preview ($300 free credits)
927
+
928
+ Cost: $0 forever (+ 20-40% token savings via RTK)!
929
+ ```
930
+
931
+ </details>
932
+
933
+ <details>
934
+ <summary><b>🔧 CLI Integration</b></summary>
935
+
936
+ ### Cursor IDE
937
+
938
+ ```
939
+ Settings → Models → Advanced:
940
+ OpenAI API Base URL: http://localhost:20128/v1
941
+ OpenAI API Key: [from 9router dashboard]
942
+ Model: cc/claude-opus-4-7
943
+ ```
944
+
945
+ Or use combo: `premium-coding`
946
+
947
+ ### Claude Code
948
+
949
+ Edit `~/.claude/config.json`:
950
+
951
+ ```json
952
+ {
953
+ "anthropic_api_base": "http://localhost:20128/v1",
954
+ "anthropic_api_key": "your-9router-api-key"
955
+ }
956
+ ```
957
+
958
+ ### Codex CLI
959
+
960
+ ```bash
961
+ export OPENAI_BASE_URL="http://localhost:20128"
962
+ export OPENAI_API_KEY="your-9router-api-key"
963
+
964
+ codex "your prompt"
965
+ ```
966
+
967
+ ### OpenClaw
968
+
969
+ **Option 1 — Dashboard (recommended):**
970
+
971
+ ```
972
+ Dashboard → CLI Tools → OpenClaw → Select Model → Apply
973
+ ```
974
+
975
+ **Option 2 — Manual:** Edit `~/.openclaw/openclaw.json`:
976
+
977
+ ```json
978
+ {
979
+ "agents": {
980
+ "defaults": {
981
+ "model": {
982
+ "primary": "9router/kr/claude-sonnet-4.5"
983
+ }
984
+ }
985
+ },
986
+ "models": {
987
+ "providers": {
988
+ "9router": {
989
+ "baseUrl": "http://127.0.0.1:20128/v1",
990
+ "apiKey": "sk_9router",
991
+ "api": "openai-completions",
992
+ "models": [
993
+ {
994
+ "id": "kr/claude-sonnet-4.5",
995
+ "name": "Claude Sonnet 4.5 (Kiro Free)"
996
+ }
997
+ ]
998
+ }
999
+ }
1000
+ }
1001
+ }
1002
+ ```
1003
+
1004
+ > **Note:** OpenClaw only works with local 9Router. Use `127.0.0.1` instead of `localhost` to avoid IPv6 resolution issues.
1005
+
1006
+ ### Cline / Continue / RooCode
1007
+
1008
+ ```
1009
+ Provider: OpenAI Compatible
1010
+ Base URL: http://localhost:20128/v1
1011
+ API Key: [from dashboard]
1012
+ Model: cc/claude-opus-4-7
1013
+ ```
1014
+
1015
+ </details>
1016
+
1017
+ <details>
1018
+ <summary><b>🚀 Deployment</b></summary>
1019
+
1020
+ ### VPS Deployment
1021
+
1022
+ ```bash
1023
+ # Clone and install
1024
+ git clone https://github.com/decolua/9router.git
1025
+ cd 9router
1026
+ npm install
1027
+ npm run build
1028
+
1029
+ # Configure
1030
+ export JWT_SECRET="your-secure-secret-change-this"
1031
+ export INITIAL_PASSWORD="your-password"
1032
+ export DATA_DIR="/var/lib/9router"
1033
+ export PORT="20128"
1034
+ export HOSTNAME="0.0.0.0"
1035
+ export NODE_ENV="production"
1036
+ export NEXT_PUBLIC_BASE_URL="http://localhost:20128"
1037
+ export NEXT_PUBLIC_CLOUD_URL="https://9router.com"
1038
+ export API_KEY_SECRET="endpoint-proxy-api-key-secret"
1039
+ export MACHINE_ID_SALT="endpoint-proxy-salt"
1040
+
1041
+ # Start
1042
+ npm run start
1043
+
1044
+ # Or use PM2
1045
+ npm install -g pm2
1046
+ pm2 start npm --name 9router -- start
1047
+ pm2 save
1048
+ pm2 startup
1049
+ ```
1050
+
1051
+ ### Docker
1052
+
1053
+ Published images (multi-platform `linux/amd64` + `linux/arm64`):
1054
+ - Docker Hub: [`decolua/9router`](https://hub.docker.com/r/decolua/9router)
1055
+ - GHCR: [`ghcr.io/decolua/9router`](https://github.com/decolua/9router/pkgs/container/9router)
1056
+
1057
+ **Quick start (use published image):**
1058
+
1059
+ ```bash
1060
+ docker run -d \
1061
+ --name 9router \
1062
+ -p 20128:20128 \
1063
+ -v "$HOME/.9router:/app/data" \
1064
+ -e DATA_DIR=/app/data \
1065
+ decolua/9router:latest
1066
+ ```
1067
+
1068
+ → Open http://localhost:20128
1069
+
1070
+ **Build from source (dev):**
1071
+
1072
+ ```bash
1073
+ git clone https://github.com/decolua/9router.git
1074
+ cd 9router/app
1075
+ docker build -t 9router .
1076
+ docker run -d --name 9router -p 20128:20128 \
1077
+ -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data 9router
1078
+ ```
1079
+
1080
+ **Container defaults:**
1081
+ - `PORT=20128`
1082
+ - `HOSTNAME=0.0.0.0`
1083
+
1084
+ **Useful commands:**
1085
+
1086
+ ```bash
1087
+ docker logs -f 9router
1088
+ docker restart 9router
1089
+ docker stop 9router && docker rm 9router
1090
+ docker pull decolua/9router:latest # update to latest
1091
+ ```
1092
+
1093
+ **Data persistence:** `$HOME/.9router/db/data.sqlite` on host ↔ `/app/data/db/data.sqlite` in container.
1094
+
1095
+ ### Environment Variables
1096
+
1097
+ | Variable | Default | Description |
1098
+ |----------|---------|-------------|
1099
+ | `JWT_SECRET` | Auto-generated (`~/.9router/jwt-secret`) | JWT signing secret for dashboard auth cookie (override to share across instances) |
1100
+ | `INITIAL_PASSWORD` | `123456` | First login password when no saved hash exists |
1101
+ | `DATA_DIR` | `~/.9router` | Main app data location (SQLite at `$DATA_DIR/db/data.sqlite`) |
1102
+ | `PORT` | framework default | Service port (`20128` in examples) |
1103
+ | `HOSTNAME` | framework default | Bind host (Docker defaults to `0.0.0.0`) |
1104
+ | `NODE_ENV` | runtime default | Set `production` for deploy |
1105
+ | `BASE_URL` | `http://localhost:20128` | Server-side internal base URL used by cloud sync jobs |
1106
+ | `CLOUD_URL` | `https://9router.com` | Server-side cloud sync endpoint base URL |
1107
+ | `NEXT_PUBLIC_BASE_URL` | `http://localhost:3000` | Backward-compatible/public base URL (prefer `BASE_URL` for server runtime) |
1108
+ | `NEXT_PUBLIC_CLOUD_URL` | `https://9router.com` | Backward-compatible/public cloud URL (prefer `CLOUD_URL` for server runtime) |
1109
+ | `API_KEY_SECRET` | `endpoint-proxy-api-key-secret` | HMAC secret for generated API keys |
1110
+ | `MACHINE_ID_SALT` | `endpoint-proxy-salt` | Salt for stable machine ID hashing |
1111
+ | `ENABLE_REQUEST_LOGS` | `false` | Enables request/response logs under `logs/` |
1112
+ | `AUTH_COOKIE_SECURE` | `false` | Force `Secure` auth cookie (set `true` behind HTTPS reverse proxy) |
1113
+ | `REQUIRE_API_KEY` | `false` | Enforce Bearer API key on `/v1/*` routes (recommended for internet-exposed deploys) |
1114
+ | `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY` | empty | Optional outbound proxy for upstream provider calls |
1115
+
1116
+ Notes:
1117
+ - Lowercase proxy variables are also supported: `http_proxy`, `https_proxy`, `all_proxy`, `no_proxy`.
1118
+ - `.env` is not baked into Docker image (`.dockerignore`); inject runtime config with `--env-file` or `-e`.
1119
+ - On Windows, `APPDATA` can be used for local storage path resolution.
1120
+ - `INSTANCE_NAME` appears in older docs/env templates, but is currently not used at runtime.
1121
+
1122
+ ### Runtime Files and Storage
1123
+
1124
+ - Main app state: `${DATA_DIR}/db/data.sqlite` (SQLite — providers, combos, aliases, keys, settings, usage history)
1125
+ - Auto backups: `${DATA_DIR}/db/backups/`
1126
+ - Optional request/translator logs: `<repo>/logs/...` when `ENABLE_REQUEST_LOGS=true`
1127
+ - Both `${DATA_DIR}` and `~/.9router` resolve to the same location in a Docker container — the symlink `/root/.9router -> /app/data` is created at build time.
1128
+
1129
+ </details>
1130
+
1131
+ ---
1132
+
1133
+ ## 📊 Available Models
1134
+
1135
+ <details>
1136
+ <summary><b>View all available models</b></summary>
1137
+
1138
+ **Claude Code (`cc/`)** - Pro/Max:
1139
+ - `cc/claude-opus-4-7`
1140
+ - `cc/claude-opus-4-6`
1141
+ - `cc/claude-sonnet-4-6`
1142
+ - `cc/claude-sonnet-4-5-20250929`
1143
+ - `cc/claude-haiku-4-5-20251001`
1144
+
1145
+ **Codex (`cx/`)** - Plus/Pro:
1146
+ - `cx/gpt-5.5`
1147
+ - `cx/gpt-5.4`
1148
+ - `cx/gpt-5.3-codex`
1149
+ - `cx/gpt-5.2-codex`
1150
+ - `cx/gpt-5.1-codex-max`
1151
+
1152
+ **GitHub Copilot (`gh/`)**:
1153
+ - `gh/gpt-5.4`
1154
+ - `gh/claude-opus-4.7`
1155
+ - `gh/claude-sonnet-4.6`
1156
+ - `gh/gemini-3.1-pro-preview`
1157
+ - `gh/grok-code-fast-1`
1158
+
1159
+ **Cursor (`cu/`)** - Subscription:
1160
+ - `cu/claude-4.6-opus-max`
1161
+ - `cu/claude-4.5-sonnet-thinking`
1162
+ - `cu/gpt-5.3-codex`
1163
+ - `cu/kimi-k2.5`
1164
+
1165
+ **GLM (`glm/`)** - $0.6/1M:
1166
+ - `glm/glm-5.1`
1167
+ - `glm/glm-5`
1168
+ - `glm/glm-4.7`
1169
+
1170
+ **MiniMax (`minimax/`)** - $0.2/1M:
1171
+ - `minimax/MiniMax-M2.7`
1172
+ - `minimax/MiniMax-M2.5`
1173
+
1174
+ **Kimi (`kimi/`)** - $9/mo flat:
1175
+ - `kimi/kimi-k2.5`
1176
+ - `kimi/kimi-k2.5-thinking`
1177
+
1178
+ **Kiro (`kr/`)** - FREE unlimited:
1179
+ - `kr/claude-sonnet-4.5`
1180
+ - `kr/claude-haiku-4.5`
1181
+ - `kr/glm-5`
1182
+ - `kr/MiniMax-M2.5`
1183
+ - `kr/qwen3-coder-next`
1184
+ - `kr/deepseek-3.2`
1185
+
1186
+ **OpenCode Free (`oc/`)** - FREE no-auth:
1187
+ - Auto-fetched from `opencode.ai/zen/v1/models`
1188
+
1189
+ **Vertex AI (`vertex/`)** - $300 free credits:
1190
+ - `vertex/gemini-3.1-pro-preview`
1191
+ - `vertex/gemini-3-flash-preview`
1192
+ - `vertex/gemini-2.5-flash`
1193
+ - `vertex-partner/glm-5-maas`
1194
+ - `vertex-partner/deepseek-v3.2-maas`
1195
+
1196
+ </details>
1197
+
1198
+ ---
1199
+
1200
+ ## 🐛 Troubleshooting
1201
+
1202
+ **"Language model did not provide messages"**
1203
+ - Provider quota exhausted → Check dashboard quota tracker
1204
+ - Solution: Use combo fallback or switch to cheaper tier
1205
+
1206
+ **Rate limiting**
1207
+ - Subscription quota out → Fallback to GLM/MiniMax
1208
+ - Add combo: `cc/claude-opus-4-7 → glm/glm-5.1 → kr/claude-sonnet-4.5`
1209
+
1210
+ **OAuth token expired**
1211
+ - Auto-refreshed by 9Router
1212
+ - If issues persist: Dashboard → Provider → Reconnect
1213
+
1214
+ **High costs**
1215
+ - Enable RTK in Dashboard → Endpoint settings (default ON, saves 20-40% tokens)
1216
+ - Check usage stats in Dashboard
1217
+ - Switch primary model to GLM/MiniMax
1218
+ - Use free tier (Kiro, OpenCode Free, Vertex) for non-critical tasks
1219
+
1220
+ **Dashboard opens on wrong port**
1221
+ - Set `PORT=20128` and `NEXT_PUBLIC_BASE_URL=http://localhost:20128`
1222
+
1223
+ **First login not working**
1224
+ - Check `INITIAL_PASSWORD` in `.env`
1225
+ - If unset, fallback password is `123456`
1226
+
1227
+ **No request logs under `logs/`**
1228
+ - Set `ENABLE_REQUEST_LOGS=true`
1229
+
1230
+ ---
1231
+
1232
+ ## 🛠️ Tech Stack
1233
+
1234
+ - **Runtime**: Node.js 20+
1235
+ - **Framework**: Next.js 16
1236
+ - **UI**: React 19 + Tailwind CSS 4
1237
+ - **Database**: SQLite (better-sqlite3 / node:sqlite / sql.js fallback)
1238
+ - **Streaming**: Server-Sent Events (SSE)
1239
+ - **Auth**: OAuth 2.0 (PKCE) + JWT + API Keys
1240
+
1241
+ ---
1242
+
1243
+ ## 📝 API Reference
1244
+
1245
+ ### Chat Completions
1246
+
1247
+ ```bash
1248
+ POST http://localhost:20128/v1/chat/completions
1249
+ Authorization: Bearer your-api-key
1250
+ Content-Type: application/json
1251
+
1252
+ {
1253
+ "model": "cc/claude-opus-4-6",
1254
+ "messages": [
1255
+ {"role": "user", "content": "Write a function to..."}
1256
+ ],
1257
+ "stream": true
1258
+ }
1259
+ ```
1260
+
1261
+ ### List Models
1262
+
1263
+ ```bash
1264
+ GET http://localhost:20128/v1/models
1265
+ Authorization: Bearer your-api-key
1266
+
1267
+ → Returns all models + combos in OpenAI format
1268
+ ```
1269
+
1270
+ ## 📧 Support
1271
+
1272
+ - **Website**: [9router.com](https://9router.com)
1273
+ - **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
1274
+ - **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
1275
+
1276
+ ---
1277
+
1278
+ ## 👥 Contributors
1279
+
1280
+ Thanks to all contributors who helped make 9Router better!
1281
+
1282
+ [![Contributors](https://contrib.rocks/image?repo=decolua/9router&max=150&columns=15&anon=1&v=20260309)](https://github.com/decolua/9router/graphs/contributors)
1283
+
1284
+ ---
1285
+
1286
+ ## 📊 Star Chart
1287
+
1288
+ [![Star Chart](https://starchart.cc/decolua/9router.svg?variant=adaptive)](https://starchart.cc/decolua/9router)
1289
+
1290
+
1291
+
1292
+ ## 🔀 Forks
1293
+
1294
+ **[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.
1295
+
1296
+ ---
1297
+
1298
+ ## 🙏 Acknowledgments
1299
+
1300
+ Built on the shoulders of giants:
1301
+
1302
+ - **[CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)** — original Go implementation that inspired this JavaScript port.
1303
+ - **[RTK](https://github.com/rtk-ai/rtk)** ![Stars](https://img.shields.io/github/stars/rtk-ai/rtk?style=flat&color=yellow) — Rust token-saver. 9Router ports its compression pipeline to JS → **−20-40% input tokens** on every request.
1304
+ - **[Caveman](https://github.com/JuliusBrussee/caveman)** ![Stars](https://img.shields.io/github/stars/JuliusBrussee/caveman?style=flat&color=yellow) by **[@JuliusBrussee](https://github.com/JuliusBrussee)** — viral *"why use many token when few token do trick"*. 9Router adapts its prompt → **−65% output tokens**.
1305
+
1306
+ Huge thanks to these authors — without their work, 9Router's token-saving features wouldn't exist. ⭐ them on GitHub!
1307
+
1308
+ ---
1309
+
1310
+ ## 📄 License
1311
+
1312
+ MIT License - see [LICENSE](LICENSE) for details.
1313
+
1314
+ ---
1315
+
1316
+ <div align="center">
1317
+ <sub>Built with ❤️ for developers who code 24/7</sub>
1318
+ </div>