@sifxprime/krouter 0.5.4 → 0.5.6

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 (359) hide show
  1. package/README.md +1278 -54
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +1 -1
  4. package/app/.next-cli-build/build-manifest.json +2 -2
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  34. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  35. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  36. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  42. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  43. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  44. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  45. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  46. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  47. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  48. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  49. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  74. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  76. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  92. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  95. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  147. package/app/.next-cli-build/server/app/callback.html +1 -1
  148. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  149. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  150. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  151. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  152. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  153. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  154. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  155. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  156. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  157. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  158. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  159. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  160. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  161. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  162. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  163. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  164. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  165. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  166. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  167. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  168. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  169. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  170. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  171. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  172. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  173. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  174. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  175. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  176. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  177. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  178. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  180. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  181. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  182. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  183. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  184. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  186. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  187. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  188. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  189. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  191. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  192. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  193. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  194. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  196. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  197. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  198. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  199. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  200. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  201. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  202. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  203. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  204. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  205. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  206. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  207. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  208. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  209. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  210. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  211. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  212. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  213. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  214. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  215. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  216. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  217. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  218. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  219. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  220. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  222. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  223. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  224. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  225. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  226. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  227. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  228. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  229. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  230. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  232. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  233. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  234. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  235. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  236. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  237. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  238. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  239. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  240. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  243. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  244. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  246. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  248. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  249. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  250. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  253. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  254. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  256. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  258. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  259. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  260. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  263. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  264. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  266. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  268. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  269. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  270. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  271. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  273. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  280. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  281. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  284. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  285. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  287. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  289. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  290. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  291. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  294. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  295. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  297. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  300. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  301. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  304. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  305. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  307. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  309. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  310. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  311. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  313. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  314. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  315. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  316. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/index.html +1 -1
  318. package/app/.next-cli-build/server/app/index.rsc +3 -3
  319. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  321. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  323. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  325. package/app/.next-cli-build/server/app/landing.html +1 -1
  326. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  327. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  328. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  330. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  334. package/app/.next-cli-build/server/app/login.html +1 -1
  335. package/app/.next-cli-build/server/app/login.rsc +4 -4
  336. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  337. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  338. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  339. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  341. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  343. package/app/.next-cli-build/server/app-paths-manifest.json +1 -1
  344. package/app/.next-cli-build/server/chunks/3529.js +1 -1
  345. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  346. package/app/.next-cli-build/server/chunks/6811.js +1 -1
  347. package/app/.next-cli-build/server/chunks/7540.js +1 -1
  348. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  349. package/app/.next-cli-build/server/pages/404.html +1 -1
  350. package/app/.next-cli-build/server/pages/500.html +1 -1
  351. package/app/.next-cli-build/static/chunks/{1321-784856d409cd996a.js → 1321-af234bd85e3c185f.js} +1 -1
  352. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-95cc6f42bdd718c7.js → page-62a53f4e6cbff359.js} +1 -1
  353. package/app/cli/.build-home/.9router/db/backups/{upgrade-0.5.0-to-0.5.1-0.5.1-20260617-185542 → upgrade-0.5.4-to-0.5.5-0.5.5-20260618-022155}/data.sqlite +0 -0
  354. package/app/cli/.build-home/.9router/db/backups/upgrade-0.5.5-to-0.5.6-0.5.6-20260618-023500/data.sqlite +0 -0
  355. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  356. package/app/package.json +1 -1
  357. package/package.json +5 -4
  358. /package/app/.next-cli-build/static/{39z6UvZG4MErej5rxON7I → GetUlhAf36B8GeUeChMFM}/_buildManifest.js +0 -0
  359. /package/app/.next-cli-build/static/{39z6UvZG4MErej5rxON7I → GetUlhAf36B8GeUeChMFM}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -1,22 +1,48 @@
1
- # 9Router - FREE AI Router & Token Saver
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/images/kodelyth-router.png" alt="kRouter — Kodelyth AI Infrastructure" width="320"/>
2
3
 
3
- **Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE & cheap AI models.**
4
+ # kRouter Kodelyth AI Infrastructure
4
5
 
5
- **Connect All AI Code Tools (Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, OpenClaw...) to 40+ AI Providers & 100+ Models.**
6
+ **A hardened fork of [9Router](https://github.com/decolua/9router). Same FREE AI router & token saver 11 audited security/stability fixes layered on top.**
6
7
 
7
- [![npm](https://img.shields.io/npm/v/9router.svg)](https://www.npmjs.com/package/9router)
8
- [![Downloads](https://img.shields.io/npm/dm/9router.svg)](https://www.npmjs.com/package/9router)
9
- [![Docker Pulls](https://img.shields.io/docker/pulls/decolua/9router.svg?logo=docker&label=Docker%20pulls)](https://hub.docker.com/r/decolua/9router)
10
- [![GHCR](https://img.shields.io/badge/GHCR-decolua%2F9router-blue?logo=github)](https://github.com/decolua/9router/pkgs/container/9router)
11
- [![License](https://img.shields.io/npm/l/9router.svg)](https://github.com/decolua/9router/blob/main/LICENSE)
8
+ **Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE & cheap AI models. Connect Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, Kiro, OpenClaw... to 40+ AI providers & 100+ models — through one local endpoint.**
12
9
 
13
- <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>
10
+ [![npm](https://img.shields.io/npm/v/@sifxprime/krouter.svg)](https://www.npmjs.com/package/@sifxprime/krouter)
11
+ [![GitHub](https://img.shields.io/badge/github-sifxprime%2Fkrouter-blue?logo=github)](https://github.com/sifxprime/krouter)
12
+ [![License](https://img.shields.io/npm/l/@sifxprime/krouter.svg)](https://github.com/sifxprime/krouter/blob/main/LICENSE)
13
+ [![Upstream](https://img.shields.io/badge/upstream-decolua%2F9router-orange)](https://github.com/decolua/9router)
14
14
 
15
- [🌐 Website](https://9router.com) • [📖 Full Docs](https://github.com/decolua/9router)
15
+ [🚀 Quick Start](#-quick-start) • [💡 Features](#-key-features) • [📖 Setup](#-setup-guide) • [🔧 About this fork](#-about-this-fork--sifxprimekrouter)
16
+
17
+ [🇻🇳 Tiếng Việt](https://github.com/sifxprime/krouter/blob/main/i18n/README.vi.md) • [🇨🇳 中文](https://github.com/sifxprime/krouter/blob/main/i18n/README.zh-CN.md) • [🇯🇵 日本語](https://github.com/sifxprime/krouter/blob/main/i18n/README.ja-JP.md) • [🇷🇺 Русский](https://github.com/sifxprime/krouter/blob/main/i18n/README.ru.md)
18
+ </div>
19
+
20
+
21
+ > **You're viewing this on npm.** Full docs, screenshots, and changelog: [github.com/sifxprime/krouter](https://github.com/sifxprime/krouter).
22
+
23
+ ---
24
+
25
+ ## 🔧 About this fork — `sifxprime/krouter`
26
+
27
+ This is a hardened fork of the upstream **[decolua/9router](https://github.com/decolua/9router)**, rebranded as **kRouter** by **Kodelyth AI Infrastructure** and maintained at **[sifxprime/krouter](https://github.com/sifxprime/krouter)**.
28
+
29
+ It tracks upstream but adds an audited security + stability layer focused on production reliability when kRouter is exposed via tunnel (Cloudflare, Tailscale) or used under concurrent multi-agent load. **Eleven audit findings closed across nine atomic commits**, each with reproducing unit tests and live end-to-end verification before commit.
30
+
31
+ | Area | Hardening in this fork |
32
+ |---|---|
33
+ | MITM stream layer | Upstream HTTP error → parseable Kiro `exception` frame instead of `"Truncated event message received"`. Read-loop guarded against socket hang-up. EventStream encoder bounds-checked (name ≤ 255, value ≤ 65 535, frame ≤ 16 MiB) to prevent silent frame corruption. |
34
+ | Auth & sessions | Token refresh no longer mutates caller credentials under concurrency. Post-refresh retry always adopts its own response (no stale-401 masking). Timing-safe CLI token compare. Per-IP brute-force lockout for API-key + CLI-token paths. |
35
+ | Account fallback | `backoffLevel` read-modify-write made atomic via SQLite transaction — concurrent failures no longer lose increments and stall exponential backoff. |
36
+ | Provider SSRF | `GET /api/providers/[id]/models` validates user-supplied `baseUrl`: blocks cloud metadata endpoints (169.254.169.254, ECS, GCP, Alibaba) + non-`http(s)` schemes. Loopback and private LAN ranges remain allowed for legitimate self-hosted LLMs. |
37
+ | Combo routing | Recursion depth guard (max 3) prevents infinite loops on misconfigured combo-of-combo cycles. Single `getSettings()` DB read per request (was 2–3). |
38
+
39
+ See [CHANGELOG.md](https://github.com/sifxprime/krouter/blob/main/CHANGELOG.md) entry `v0.4.80+sifxprime.1` for the full commit log with one-line summaries. Each finding's reproduction + verification approach is recorded in the commit body.
40
+
41
+ Upstream features, providers, docs, and roadmap remain authoritative — credit and stars belong to **[@decolua](https://github.com/decolua)** and the upstream contributors.
16
42
 
17
43
  ---
18
44
 
19
- ## 🤔 Why 9Router?
45
+ ## 🤔 Why kRouter?
20
46
 
21
47
  **Stop wasting money, tokens and hitting limits:**
22
48
 
@@ -24,102 +50,1300 @@
24
50
  - ❌ Rate limits stop you mid-coding
25
51
  - ❌ Tool outputs (git diff, grep, ls...) burn tokens fast
26
52
  - ❌ Expensive APIs ($20-50/month per provider)
53
+ - ❌ Manual switching between providers
27
54
 
28
- **9Router solves this:**
55
+ **kRouter solves this:**
29
56
 
30
- - ✅ **RTK Token Saver** - Auto-compress tool_result, save 20-40% tokens
57
+ - ✅ **RTK Token Saver** - Auto-compress tool_result content, save 20-40% tokens per request
31
58
  - ✅ **Maximize subscriptions** - Track quota, use every bit before reset
32
59
  - ✅ **Auto fallback** - Subscription → Cheap → Free, zero downtime
33
60
  - ✅ **Multi-account** - Round-robin between accounts per provider
34
- - ✅ **Universal** - Works with any OpenAI/Claude-compatible CLI
61
+ - ✅ **Universal** - Works with Claude Code, Codex, Cursor, Cline, any CLI tool
35
62
 
36
63
  ---
37
64
 
38
- ## Quick Start
65
+ ## 🔄 How It Works
39
66
 
40
- **Option 1 — npm (recommended for desktop):**
67
+ ```
68
+ ┌─────────────┐
69
+ │ Your CLI │ (Claude Code, Codex, OpenClaw, Cursor, Cline...)
70
+ │ Tool │
71
+ └──────┬──────┘
72
+ │ http://localhost:20128/v1
73
+
74
+ ┌─────────────────────────────────────────────┐
75
+ │ kRouter (Smart Router) │
76
+ │ • RTK Token Saver (cut tool_result tokens) │
77
+ │ • Format translation (OpenAI ↔ Claude) │
78
+ │ • Quota tracking │
79
+ │ • Auto token refresh │
80
+ └──────┬──────────────────────────────────────┘
81
+
82
+ ├─→ [Tier 1: SUBSCRIPTION] Claude Code, Codex, GitHub Copilot
83
+ │ ↓ quota exhausted
84
+ ├─→ [Tier 2: CHEAP] GLM ($0.6/1M), MiniMax ($0.2/1M)
85
+ │ ↓ budget limit
86
+ └─→ [Tier 3: FREE] Kiro, OpenCode Free, Vertex ($300 credits)
87
+
88
+ Result: Never stop coding, minimal cost + 20-40% token savings via RTK
89
+ ```
90
+
91
+ ---
92
+
93
+ ## ⚡ Quick Start (this fork)
94
+
95
+ > The npm package `9router` and the Docker image `decolua/9router` are still the **upstream** project. To get this fork's hardening pass + Kiro Google/GitHub OAuth, install from source as shown below.
96
+
97
+ ### TL;DR — run these four commands one at a time
98
+
99
+ > Press **Enter after each line**. Windows CMD/PowerShell will not split a single pasted block into separate commands and will treat `git clone …\n cd 9router` as one — you'll see `Repository not found` because Git tries to clone a URL with `cd` appended.
41
100
 
42
101
  ```bash
43
- npm install -g 9router
44
- 9router
102
+ git clone https://github.com/sifxprime/krouter.git
103
+ ```
45
104
 
46
- # Or run directly with npx
47
- npx 9router
105
+ ```bash
106
+ cd krouter
48
107
  ```
49
108
 
50
- **Option 2 — Docker (server/VPS):**
109
+ ```bash
110
+ npm install
111
+ ```
51
112
 
52
113
  ```bash
53
- docker run -d --name 9router -p 20128:20128 \
54
- -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data \
55
- decolua/9router:latest
114
+ npm run dev
56
115
  ```
57
116
 
58
- Published images: [Docker Hub](https://hub.docker.com/r/decolua/9router) • [GHCR](https://github.com/decolua/9router/pkgs/container/9router) (multi-platform amd64/arm64).
117
+ Dashboard opens at **http://localhost:20128/dashboard**.
59
118
 
60
- 🎉 Dashboard opens at `http://localhost:20128`
119
+ That's the whole install. The rest of this section breaks down what each step needs and the production-style run.
61
120
 
62
- **2. Connect a FREE provider (no signup needed):**
121
+ ### Prerequisites
63
122
 
64
- Dashboard Providers Connect **Kiro AI** (free Claude unlimited) or **OpenCode Free** (no auth) → Done!
123
+ | Tool | Minimum | Notes |
124
+ |---|---|---|
125
+ | **Node.js** | ≥ 20 (22 recommended) | `node -v` to check. macOS via Homebrew: `brew install node@22`. Linux: nvm or your distro's Node 22. Windows: nodejs.org installer. |
126
+ | **Git** | any recent | `git --version` |
127
+ | **A package manager** | npm (bundled with Node) | pnpm / yarn / bun also work — the project detects and uses whichever you ran install with. |
128
+ | **Sudo / admin** | only if you enable MITM | Pure router mode (chat completions only) needs **no** privileges. MITM intercept for Kiro / Antigravity / Copilot / Cursor binds `:443` and edits `/etc/hosts`, which does. |
65
129
 
66
- **3. Use in your CLI tool:**
130
+ ### Step-by-step
67
131
 
132
+ **1. Get the code**
133
+
134
+ ```bash
135
+ git clone https://github.com/sifxprime/krouter.git
136
+ cd krouter
68
137
  ```
69
- Claude Code/Codex/OpenClaw/Cursor/Cline Settings:
70
- Endpoint: http://localhost:20128/v1
71
- API Key: [copy from dashboard]
72
- Model: kr/claude-sonnet-4.5
138
+
139
+ **2. Install dependencies** (≈ 1–3 minutes)
140
+
141
+ ```bash
142
+ npm install
143
+ # or: pnpm install / yarn install / bun install
73
144
  ```
74
145
 
75
- That's it! Start coding with FREE AI models.
146
+ This pulls Next.js, React, the `better-sqlite3` native binding, and the rest. The SQLite binding compiles on install — on a fresh macOS you may be prompted for Xcode Command Line Tools (one-time `xcode-select --install`).
76
147
 
77
- ---
148
+ **3. Start it**
78
149
 
79
- ## 🚀 CLI Options
150
+ For day-to-day use:
80
151
 
81
152
  ```bash
82
- 9router # Start with default settings
83
- 9router --port 8080 # Custom port
84
- 9router --no-browser # Don't open browser
85
- 9router --skip-update # Skip auto-update check
86
- 9router --help # Show all options
153
+ npm run dev # Next.js dev server, hot reload, port 20128
87
154
  ```
88
155
 
89
- **Dashboard**: `http://localhost:20128/dashboard`
156
+ For production-style standalone (smaller memory, no HMR):
157
+
158
+ ```bash
159
+ npm run build:deploy # one-time build + copy static assets to standalone, ≈ 30s
160
+ npm run start # standalone server on PORT=20128
161
+ ```
162
+
163
+ > Use `npm run build:deploy`, **not** plain `npm run build` — the standalone bundle that `npm run start` runs needs the static assets copied alongside it. The `:deploy` variant does both steps.
164
+
165
+ Either way, open: **[http://localhost:20128/dashboard](http://localhost:20128/dashboard)**
166
+
167
+ On first run the app creates `~/.9router/` (SQLite DB, machine-id, MITM CA) — it's gitignored, per-user, and fully reset by deleting that folder.
168
+
169
+ ### What happens next (no reboot, no extra config)
170
+
171
+ 1. **Dashboard → Providers** → pick any provider tile.
172
+ - **Free, no signup needed**: MiMo Code Free, OpenCode Free → click [+] on the suggested model.
173
+ - **Free, login required**: Kiro AI (AWS Builder ID **or** Google **or** GitHub thanks to this fork's device-code OAuth), Gemini CLI, Qoder.
174
+ - **API key**: OpenRouter, NVIDIA NIM, Anthropic, OpenAI, etc.
175
+ 2. **Dashboard → API Keys** → create one local API key (e.g. `sk-9router-XXXX`).
176
+ 3. Point any AI tool at 9router:
177
+
178
+ ```text
179
+ Endpoint: http://localhost:20128/v1
180
+ API key: sk-9router-XXXX (from step 2)
181
+ Model: kr/claude-sonnet-4.5 (or whatever provider/model you connected)
182
+ ```
183
+
184
+ Works with Claude Code, Cursor, Antigravity, Copilot, Codex CLI, OpenCode, Cline, OpenClaw, any OpenAI-compatible client.
185
+
186
+ ### Updating to the latest fork commits
187
+
188
+ ```bash
189
+ cd krouter
190
+ git pull origin main
191
+ npm install # only if package.json changed
192
+ # restart dev/start
193
+ ```
194
+
195
+ ### Don't need the hardening pass? Use upstream
196
+
197
+ If you don't need this fork's audit fixes or Kiro Google/GitHub login, the upstream npm/Docker artifacts still work — they just don't carry this fork's changes:
198
+
199
+ ```bash
200
+ npm install -g 9router && 9router
201
+ # or
202
+ docker run -d -p 20128:20128 -v ~/.9router:/root/.9router decolua/9router:latest
203
+ ```
204
+
205
+ ### Default URLs
206
+
207
+ - Dashboard: `http://localhost:20128/dashboard`
208
+ - OpenAI-compatible API: `http://localhost:20128/v1`
209
+ - Anthropic-compatible API: `http://localhost:20128/v1/messages`
210
+ - Health probe: `http://localhost:20128/api/health`
211
+
212
+ ### Platform support — honest status
213
+
214
+ This fork's changes are pure cross-platform JavaScript and re-use upstream's per-OS cert/DNS install code. Here is what is actually verified vs what should work but I haven't personally driven on every OS:
215
+
216
+ | OS | Pure router mode (chat completions) | MITM mode (Kiro / Antigravity / Copilot IDE intercept) |
217
+ |---|---|---|
218
+ | **macOS** (Intel + Apple Silicon) | ✅ verified in development | ✅ Kiro driven live, end-to-end |
219
+ | **Windows** 10 / 11 | ✅ verified by a fork user | ✅ confirmed by a fork user: Antigravity streamed `gemini-pro-agent` end-to-end through MITM, 10.6 s, complete, no errors. Cert install via elevated PowerShell + `certutil -addstore -f Root` works as upstream ships it. |
220
+ | **Linux** (Debian / Ubuntu / Arch / Fedora / RHEL / openSUSE) | ✅ pure-JS, high confidence | ⚠️ untested as of now; upstream's distro-aware `update-ca-certificates` / `update-ca-trust` path is in place and the same JS runs everywhere |
221
+
222
+ **MITM mode is confirmed on macOS and Windows** — Antigravity, Copilot, and Kiro share the same hardened pipe layer (`base.js`) that I verified live. Upstream already supports the Linux distro families above via the OS-aware code in `src/mitm/cert/install.js`. If MITM fails on Linux, the most likely cause is the OS-level cert-install flow (upstream territory), not anything this fork touched.
223
+
224
+ **Windows note:** MITM requires an elevated process (binds `:443`, edits `C:\Windows\System32\drivers\etc\hosts`, installs the root CA). Launch your CMD or PowerShell as **Run as administrator**, then `cd` into the project and run `npm run dev`. The dashboard will hide the "Administrator required" banner once `net session` succeeds inside the dev server's Node process.
225
+
226
+ If you hit anything OS-specific, [open an issue](https://github.com/sifxprime/krouter/issues) — I'll try to repro and patch.
90
227
 
91
228
  ---
92
229
 
93
230
  ## 🛠️ Supported CLI Tools
94
231
 
95
- Claude-Code OpenClaw Codex OpenCode Cursor • Antigravity • Cline • Continue • Droid • Roo • Copilot • Kilo Code • Gemini CLI • Qwen Code • iFlow • Crush • Crusher • Aider
232
+ kRouter works seamlessly with all major AI coding tools:
233
+
234
+ <div align="center">
235
+ <table>
236
+ <tr>
237
+ <td align="center" width="120">
238
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/claude.png" width="60" alt="Claude Code"/><br/>
239
+ <b>Claude-Code</b>
240
+ </td>
241
+ <td align="center" width="120">
242
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/openclaw.png" width="60" alt="OpenClaw"/><br/>
243
+ <b>OpenClaw</b>
244
+ </td>
245
+ <td align="center" width="120">
246
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/codex.png" width="60" alt="Codex"/><br/>
247
+ <b>Codex</b>
248
+ </td>
249
+ <td align="center" width="120">
250
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/opencode.png" width="60" alt="OpenCode"/><br/>
251
+ <b>OpenCode</b>
252
+ </td>
253
+ <td align="center" width="120">
254
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/cursor.png" width="60" alt="Cursor"/><br/>
255
+ <b>Cursor</b>
256
+ </td>
257
+ <td align="center" width="120">
258
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/antigravity.png" width="60" alt="Antigravity"/><br/>
259
+ <b>Antigravity</b>
260
+ </td>
261
+ </tr>
262
+ <tr>
263
+ <td align="center" width="120">
264
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/cline.png" width="60" alt="Cline"/><br/>
265
+ <b>Cline</b>
266
+ </td>
267
+ <td align="center" width="120">
268
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/continue.png" width="60" alt="Continue"/><br/>
269
+ <b>Continue</b>
270
+ </td>
271
+ <td align="center" width="120">
272
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/droid.png" width="60" alt="Droid"/><br/>
273
+ <b>Droid</b>
274
+ </td>
275
+ <td align="center" width="120">
276
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/roo.png" width="60" alt="Roo"/><br/>
277
+ <b>Roo</b>
278
+ </td>
279
+ <td align="center" width="120">
280
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/copilot.png" width="60" alt="Copilot"/><br/>
281
+ <b>Copilot</b>
282
+ </td>
283
+ <td align="center" width="120">
284
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/kilocode.png" width="60" alt="Kilo Code"/><br/>
285
+ <b>Kilo Code</b>
286
+ </td>
287
+ </tr>
288
+ </table>
289
+ </div>
290
+
291
+ ---
292
+
293
+ ## 🌐 Supported Providers
294
+
295
+ ### 🔐 OAuth Providers
296
+
297
+ <div align="center">
298
+ <table>
299
+ <tr>
300
+ <td align="center" width="120">
301
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/claude.png" width="60" alt="Claude Code"/><br/>
302
+ <b>Claude-Code</b>
303
+ </td>
304
+ <td align="center" width="120">
305
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/antigravity.png" width="60" alt="Antigravity"/><br/>
306
+ <b>Antigravity</b>
307
+ </td>
308
+ <td align="center" width="120">
309
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/codex.png" width="60" alt="Codex"/><br/>
310
+ <b>Codex</b>
311
+ </td>
312
+ <td align="center" width="120">
313
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/github.png" width="60" alt="GitHub"/><br/>
314
+ <b>GitHub</b>
315
+ </td>
316
+ <td align="center" width="120">
317
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/cursor.png" width="60" alt="Cursor"/><br/>
318
+ <b>Cursor</b>
319
+ </td>
320
+ </tr>
321
+ </table>
322
+ </div>
323
+
324
+ ### 🆓 Free Providers
325
+
326
+ <div align="center">
327
+ <table>
328
+ <tr>
329
+ <td align="center" width="150">
330
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/kiro.png" width="70" alt="Kiro"/><br/>
331
+ <b>Kiro AI</b><br/>
332
+ <sub>Claude 4.5 + GLM-5 + MiniMax<br/>Unlimited FREE</sub>
333
+ </td>
334
+ <td align="center" width="150">
335
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/opencode.png" width="70" alt="OpenCode Free"/><br/>
336
+ <b>OpenCode Free</b><br/>
337
+ <sub>No auth • Auto-fetch models<br/>Unlimited FREE</sub>
338
+ </td>
339
+ <td align="center" width="150">
340
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/gemini.png" width="70" alt="Vertex AI"/><br/>
341
+ <b>Vertex AI</b><br/>
342
+ <sub>Gemini 3 Pro + GLM-5 + DeepSeek<br/>$300 credits free</sub>
343
+ </td>
344
+ </tr>
345
+ </table>
346
+ </div>
347
+
348
+ > **Note:** iFlow, Qwen and Gemini CLI free tiers were discontinued in 2026. Use Kiro / OpenCode Free / Vertex instead.
349
+
350
+ ### 🔑 API Key Providers (40+)
351
+
352
+ <div align="center">
353
+ <table>
354
+ <tr>
355
+ <td align="center" width="100">
356
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/openrouter.png" width="50" alt="OpenRouter"/><br/>
357
+ <sub>OpenRouter</sub>
358
+ </td>
359
+ <td align="center" width="100">
360
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/glm.png" width="50" alt="GLM"/><br/>
361
+ <sub>GLM</sub>
362
+ </td>
363
+ <td align="center" width="100">
364
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/kimi.png" width="50" alt="Kimi"/><br/>
365
+ <sub>Kimi</sub>
366
+ </td>
367
+ <td align="center" width="100">
368
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/minimax.png" width="50" alt="MiniMax"/><br/>
369
+ <sub>MiniMax</sub>
370
+ </td>
371
+ <td align="center" width="100">
372
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/openai.png" width="50" alt="OpenAI"/><br/>
373
+ <sub>OpenAI</sub>
374
+ </td>
375
+ <td align="center" width="100">
376
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/anthropic.png" width="50" alt="Anthropic"/><br/>
377
+ <sub>Anthropic</sub>
378
+ </td>
379
+ </tr>
380
+ <tr>
381
+ <td align="center" width="100">
382
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/gemini.png" width="50" alt="Gemini"/><br/>
383
+ <sub>Gemini</sub>
384
+ </td>
385
+ <td align="center" width="100">
386
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/deepseek.png" width="50" alt="DeepSeek"/><br/>
387
+ <sub>DeepSeek</sub>
388
+ </td>
389
+ <td align="center" width="100">
390
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/groq.png" width="50" alt="Groq"/><br/>
391
+ <sub>Groq</sub>
392
+ </td>
393
+ <td align="center" width="100">
394
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/xai.png" width="50" alt="xAI"/><br/>
395
+ <sub>xAI</sub>
396
+ </td>
397
+ <td align="center" width="100">
398
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/mistral.png" width="50" alt="Mistral"/><br/>
399
+ <sub>Mistral</sub>
400
+ </td>
401
+ <td align="center" width="100">
402
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/perplexity.png" width="50" alt="Perplexity"/><br/>
403
+ <sub>Perplexity</sub>
404
+ </td>
405
+ </tr>
406
+ <tr>
407
+ <td align="center" width="100">
408
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/together.png" width="50" alt="Together"/><br/>
409
+ <sub>Together AI</sub>
410
+ </td>
411
+ <td align="center" width="100">
412
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/fireworks.png" width="50" alt="Fireworks"/><br/>
413
+ <sub>Fireworks</sub>
414
+ </td>
415
+ <td align="center" width="100">
416
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/cerebras.png" width="50" alt="Cerebras"/><br/>
417
+ <sub>Cerebras</sub>
418
+ </td>
419
+ <td align="center" width="100">
420
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/cohere.png" width="50" alt="Cohere"/><br/>
421
+ <sub>Cohere</sub>
422
+ </td>
423
+ <td align="center" width="100">
424
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/nvidia.png" width="50" alt="NVIDIA"/><br/>
425
+ <sub>NVIDIA</sub>
426
+ </td>
427
+ <td align="center" width="100">
428
+ <img src="https://raw.githubusercontent.com/sifxprime/krouter/main/public/providers/siliconflow.png" width="50" alt="SiliconFlow"/><br/>
429
+ <sub>SiliconFlow</sub>
430
+ </td>
431
+ </tr>
432
+ </table>
433
+ <p><i>...and 20+ more providers including Nebius, Chutes, Hyperbolic, and custom OpenAI/Anthropic compatible endpoints</i></p>
434
+ </div>
435
+
436
+ ---
437
+
438
+ ## 💡 Key Features
439
+
440
+ | Feature | What It Does | Why It Matters |
441
+ |---------|--------------|----------------|
442
+ | 🚀 **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 |
443
+ | 🪨 **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** |
444
+ | 🎯 **Smart 3-Tier Fallback** | Auto-route: Subscription → Cheap → Free | Never stop coding, zero downtime |
445
+ | 📊 **Real-Time Quota Tracking** | Live token count + reset countdown | Maximize subscription value |
446
+ | 🔄 **Format Translation** | OpenAI ↔ Claude ↔ Gemini ↔ Cursor ↔ Kiro ↔ Vertex | Works with any CLI tool |
447
+ | 👥 **Multi-Account Support** | Multiple accounts per provider | Load balancing + redundancy |
448
+ | 🔄 **Auto Token Refresh** | OAuth tokens refresh automatically | No manual re-login needed |
449
+ | 🎨 **Custom Combos** | Create unlimited model combinations | Tailor fallback to your needs |
450
+ | 📝 **Request Logging** | Debug mode with full request/response logs | Troubleshoot issues easily |
451
+ | 💾 **Cloud Sync** | Sync config across devices | Same setup everywhere |
452
+ | 📊 **Usage Analytics** | Track tokens, cost, trends over time | Optimize spending |
453
+ | 🌐 **Deploy Anywhere** | Localhost, VPS, Docker, Cloudflare Workers | Flexible deployment options |
454
+
455
+ <details>
456
+ <summary><b>📖 Feature Details</b></summary>
457
+
458
+ ### 🚀 RTK Token Saver
459
+
460
+ 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:
461
+
462
+ - **Filters:** `git-diff`, `git-status`, `grep`, `find`, `ls`, `tree`, `dedup-log`, `smart-truncate`, `read-numbered`, `search-list`
463
+ - **Auto-detect:** No config needed — RTK peeks the first 1KB of each `tool_result` and picks the right filter.
464
+ - **Safe by design:** If a filter fails, throws, or makes output bigger, RTK silently keeps the original text. Errors never break your request.
465
+ - **Universal:** Works across all formats (OpenAI, Claude, Gemini, Cursor, Kiro, OpenAI Responses) because it runs **before** any format translation.
466
+ - **Default ON:** Toggle anytime in Dashboard → Endpoint settings.
467
+
468
+ ```
469
+ Without RTK: 47K tokens sent to LLM
470
+ With RTK: 28K tokens sent to LLM (40% saved · same context · same answer)
471
+ ```
472
+
473
+ ### 🎯 Smart 3-Tier Fallback
474
+
475
+ Create combos with automatic fallback:
476
+
477
+ ```
478
+ Combo: "my-coding-stack"
479
+ 1. cc/claude-opus-4-6 (your subscription)
480
+ 2. glm/glm-4.7 (cheap backup, $0.6/1M)
481
+ 3. if/kimi-k2-thinking (free fallback)
482
+
483
+ → Auto switches when quota runs out or errors occur
484
+ ```
485
+
486
+ ### 📊 Real-Time Quota Tracking
487
+
488
+ - Token consumption per provider
489
+ - Reset countdown (5-hour, daily, weekly)
490
+ - Cost estimation for paid tiers
491
+ - Monthly spending reports
492
+
493
+ ### 🔄 Format Translation
494
+
495
+ Seamless translation between formats:
496
+ - **OpenAI** ↔ **Claude** ↔ **Gemini** ↔ **Cursor** ↔ **Kiro** ↔ **Vertex** ↔ **Antigravity** ↔ **Ollama** ↔ **OpenAI Responses**
497
+ - Your CLI tool sends OpenAI format → kRouter translates → Provider receives native format
498
+ - Works with any tool that supports custom OpenAI endpoints
96
499
 
97
- Any tool supporting OpenAI/Claude-compatible API works.
500
+ ### 👥 Multi-Account Support
501
+
502
+ - Add multiple accounts per provider
503
+ - Auto round-robin or priority-based routing
504
+ - Fallback to next account when one hits quota
505
+
506
+ ### 🔄 Auto Token Refresh
507
+
508
+ - OAuth tokens automatically refresh before expiration
509
+ - No manual re-authentication needed
510
+ - Seamless experience across all providers
511
+
512
+ ### 🎨 Custom Combos
513
+
514
+ - Create unlimited model combinations
515
+ - Mix subscription, cheap, and free tiers
516
+ - Name your combos for easy access
517
+ - Share combos across devices with Cloud Sync
518
+
519
+ ### 📝 Request Logging
520
+
521
+ - Enable debug mode for full request/response logs
522
+ - Track API calls, headers, and payloads
523
+ - Troubleshoot integration issues
524
+ - Export logs for analysis
525
+
526
+ ### 💾 Cloud Sync
527
+
528
+ - Sync providers, combos, and settings across devices
529
+ - Automatic background sync
530
+ - Secure encrypted storage
531
+ - Access your setup from anywhere
532
+
533
+ #### Cloud Runtime Notes
534
+
535
+ - Prefer server-side cloud variables in production:
536
+ - `BASE_URL` (internal callback URL used by sync scheduler)
537
+ - `CLOUD_URL` (cloud sync endpoint base)
538
+ - `NEXT_PUBLIC_BASE_URL` and `NEXT_PUBLIC_CLOUD_URL` are still supported for compatibility/UI, but server runtime now prioritizes `BASE_URL`/`CLOUD_URL`.
539
+ - Cloud sync requests now use timeout + fail-fast behavior to avoid UI hanging when cloud DNS/network is unavailable.
540
+
541
+ ### 📊 Usage Analytics
542
+
543
+ - Track token usage per provider and model
544
+ - Cost estimation and spending trends
545
+ - Monthly reports and insights
546
+ - Optimize your AI spending
547
+
548
+ > **💡 IMPORTANT - Understanding Dashboard Costs:**
549
+ >
550
+ > The "cost" displayed in Usage Analytics is **for tracking and comparison purposes only**.
551
+ > kRouter itself **never charges** you anything. You only pay providers directly (if using paid services).
552
+ >
553
+ > **Example:** If your dashboard shows "$290 total cost" while using iFlow models, this represents
554
+ > what you would have paid using paid APIs directly. Your actual cost = **$0** (iFlow is free unlimited).
555
+ >
556
+ > Think of it as a "savings tracker" showing how much you're saving by using free models or
557
+ > routing through kRouter!
558
+
559
+ ### 🌐 Deploy Anywhere
560
+
561
+ - 💻 **Localhost** - Default, works offline
562
+ - ☁️ **VPS/Cloud** - Share across devices
563
+ - 🐳 **Docker** - One-command deployment
564
+ - 🚀 **Cloudflare Workers** - Global edge network
565
+
566
+ </details>
98
567
 
99
568
  ---
100
569
 
101
- ## 💾 Data Location
570
+ ## 💰 Pricing at a Glance
571
+
572
+ | Tier | Provider | Cost | Quota Reset | Best For |
573
+ |------|----------|------|-------------|----------|
574
+ | **🚀 TOKEN SAVER** | **RTK (built-in)** | **FREE** | Always on | **Save 20-40% tokens on EVERY request** |
575
+ | **💳 SUBSCRIPTION** | Claude Code (Pro/Max) | $20-200/mo | 5h + weekly | Already subscribed |
576
+ | | Codex (Plus/Pro) | $20-200/mo | 5h + weekly | OpenAI users |
577
+ | | GitHub Copilot | $10-19/mo | Monthly | GitHub users |
578
+ | | Cursor IDE | $20/mo | Monthly | Cursor users |
579
+ | **💰 CHEAP** | GLM-5.1 / GLM-4.7 | $0.6/1M | Daily 10AM | Budget backup |
580
+ | | MiniMax M2.7 | $0.2/1M | 5-hour rolling | Cheapest option |
581
+ | | Kimi K2.5 | $9/mo flat | 10M tokens/mo | Predictable cost |
582
+ | **🆓 FREE** | Kiro AI | $0 | Unlimited | Claude 4.5 + GLM-5 + MiniMax free |
583
+ | | OpenCode Free | $0 | Unlimited | No auth, auto-fetch models |
584
+ | | Vertex AI | $300 credits | New GCP accounts | Gemini 3 Pro + DeepSeek + GLM-5 |
102
585
 
103
- - **macOS/Linux**: `~/.9router/db/data.sqlite`
104
- - **Windows**: `%APPDATA%/9router/db/data.sqlite`
105
- - **Docker**: `/app/data/db/data.sqlite` (mount `$HOME/.9router` to persist)
586
+ **💡 Pro Tip:** RTK + Kiro AI + OpenCode Free combo = **$0 cost + 20-40% token savings**!
106
587
 
107
588
  ---
108
589
 
109
- ## 📚 Documentation
590
+ ### 📊 Understanding kRouter Costs & Billing
591
+
592
+ **kRouter Billing Reality:**
593
+
594
+ ✅ **kRouter software = FREE forever** (open source, never charges)
595
+ ✅ **Dashboard "costs" = Display/tracking only** (not actual bills)
596
+ ✅ **You pay providers directly** (subscriptions or API fees)
597
+ ✅ **FREE providers stay FREE** (iFlow, Kiro, Qwen = $0 unlimited)
598
+ ❌ **kRouter never sends invoices** or charges your card
599
+
600
+ **How Cost Display Works:**
601
+
602
+ 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.
603
+
604
+ **Example Scenario:**
605
+ ```
606
+ Dashboard Display:
607
+ • Total Requests: 1,662
608
+ • Total Tokens: 47M
609
+ • Display Cost: $290
110
610
 
111
- Full docs, advanced setup, video tutorials & development guide:
611
+ Reality Check:
612
+ • Provider: iFlow (FREE unlimited)
613
+ • Actual Payment: $0.00
614
+ • What $290 Means: Amount you SAVED by using free models!
615
+ ```
112
616
 
113
- - **GitHub**: https://github.com/decolua/9router
114
- - **Full README**: https://github.com/decolua/9router/blob/main/app/README.md
115
- - **Website**: https://9router.com
617
+ **Payment Rules:**
618
+ - **Subscription providers** (Claude Code, Codex): Pay them directly via their websites
619
+ - **Cheap providers** (GLM, MiniMax): Pay them directly, kRouter just routes
620
+ - **FREE providers** (iFlow, Kiro, Qwen): Genuinely free forever, no hidden charges
621
+ - **kRouter**: Never charges anything, ever
622
+
623
+ ---
624
+
625
+ ## 🎯 Use Cases
626
+
627
+ ### Case 1: "I have Claude Pro subscription"
628
+
629
+ **Problem:** Quota expires unused, rate limits during heavy coding
630
+
631
+ **Solution:**
632
+ ```
633
+ Combo: "maximize-claude"
634
+ 1. cc/claude-opus-4-7 (use subscription fully)
635
+ 2. glm/glm-5.1 (cheap backup when quota out)
636
+ 3. kr/claude-sonnet-4.5 (free emergency fallback)
637
+
638
+ Monthly cost: $20 (subscription) + ~$5 (backup) = $25 total
639
+ vs. $20 + hitting limits = frustration
640
+ ```
641
+
642
+ ### Case 2: "I want zero cost"
643
+
644
+ **Problem:** Can't afford subscriptions, need reliable AI coding
645
+
646
+ **Solution:**
647
+ ```
648
+ Combo: "free-forever"
649
+ 1. kr/claude-sonnet-4.5 (Claude 4.5 free unlimited)
650
+ 2. kr/glm-5 (GLM-5 free via Kiro)
651
+ 3. oc/<auto> (OpenCode Free, no auth)
652
+
653
+ Monthly cost: $0
654
+ Quality: Production-ready models + RTK saves 20-40% tokens
655
+ ```
656
+
657
+ ### Case 3: "I need 24/7 coding, no interruptions"
658
+
659
+ **Problem:** Deadlines, can't afford downtime
660
+
661
+ **Solution:**
662
+ ```
663
+ Combo: "always-on"
664
+ 1. cc/claude-opus-4-7 (best quality)
665
+ 2. cx/gpt-5.5 (second subscription)
666
+ 3. glm/glm-5.1 (cheap, resets daily)
667
+ 4. minimax/MiniMax-M2.7 (cheapest, 5h reset)
668
+ 5. kr/claude-sonnet-4.5 (free unlimited)
669
+
670
+ Result: 5 layers of fallback = zero downtime
671
+ Monthly cost: $20-200 (subscriptions) + $10-20 (backup)
672
+ ```
673
+
674
+ ### Case 4: "I want FREE AI in OpenClaw"
675
+
676
+ **Problem:** Need AI assistant in messaging apps (WhatsApp, Telegram, Slack...), completely free
677
+
678
+ **Solution:**
679
+ ```
680
+ Combo: "openclaw-free"
681
+ 1. kr/claude-sonnet-4.5 (Claude 4.5 free)
682
+ 2. kr/glm-5 (GLM-5 free)
683
+ 3. kr/MiniMax-M2.5 (MiniMax free)
684
+
685
+ Monthly cost: $0
686
+ Access via: WhatsApp, Telegram, Slack, Discord, iMessage, Signal...
687
+ ```
688
+
689
+ ---
690
+
691
+ ## ❓ Frequently Asked Questions
692
+
693
+ <details>
694
+ <summary><b>📊 Why does my dashboard show high costs?</b></summary>
695
+
696
+ 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 kRouter.
697
+
698
+ **Example:**
699
+ - **Dashboard shows:** "$290 total cost"
700
+ - **Reality:** You're using iFlow (FREE unlimited)
701
+ - **Your actual cost:** **$0.00**
702
+ - **What $290 means:** Amount you **saved** by using free models instead of paid APIs!
703
+
704
+ The cost display is a "savings tracker" to help you understand your usage patterns and optimization opportunities.
705
+
706
+ </details>
707
+
708
+ <details>
709
+ <summary><b>💳 Will I be charged by kRouter?</b></summary>
710
+
711
+ **No.** kRouter is free, open-source software that runs on your own computer. It never charges you anything.
712
+
713
+ **You only pay:**
714
+ - ✅ **Subscription providers** (Claude Code $20/mo, Codex $20-200/mo) → Pay them directly on their websites
715
+ - ✅ **Cheap providers** (GLM, MiniMax) → Pay them directly, kRouter just routes your requests
716
+ - ❌ **kRouter itself** → **Never charges anything, ever**
717
+
718
+ kRouter 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.
719
+
720
+ </details>
721
+
722
+ <details>
723
+ <summary><b>🆓 Are FREE providers really unlimited?</b></summary>
724
+
725
+ **Yes!** The current FREE providers (Kiro, OpenCode Free, Vertex) are genuinely free with **no hidden charges**.
726
+
727
+ These are free services offered by those respective companies:
728
+ - **Kiro AI**: Free unlimited Claude 4.5 + GLM-5 + MiniMax via AWS Builder ID / Google / GitHub OAuth
729
+ - **OpenCode Free**: No-auth passthrough proxy, models auto-fetched from `opencode.ai/zen/v1/models`
730
+ - **Vertex AI**: $300 free credits for new Google Cloud accounts (90 days)
731
+
732
+ kRouter just routes your requests to them - there's no "catch" or future billing. They're truly free services, and kRouter makes them easy to use with fallback support.
733
+
734
+ **Discontinued free tiers (no longer recommended):**
735
+ - ❌ **iFlow**: Was free unlimited, now changed to paid (2026)
736
+ - ❌ **Qwen Code**: Free OAuth tier discontinued by Alibaba on 2026-04-15
737
+ - ❌ **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
738
+
739
+ </details>
740
+
741
+ <details>
742
+ <summary><b>💰 How do I minimize my actual AI costs?</b></summary>
743
+
744
+ **Free-First Strategy:**
745
+
746
+ 1. **Start with 100% free combo:**
747
+ ```
748
+ 1. gc/gemini-3-flash (180K/month free from Google)
749
+ 2. if/kimi-k2-thinking (unlimited free from iFlow)
750
+ 3. qw/qwen3-coder-plus (unlimited free from Qwen)
751
+ ```
752
+ **Cost: $0/month**
753
+
754
+ 2. **Add cheap backup** only if you need it:
755
+ ```
756
+ 4. glm/glm-4.7 ($0.6/1M tokens)
757
+ ```
758
+ **Additional cost: Only pay for what you actually use**
759
+
760
+ 3. **Use subscription providers last:**
761
+ - Only if you already have them
762
+ - kRouter helps maximize their value through quota tracking
763
+
764
+ **Result:** Most users can operate at $0/month using only free tiers!
765
+
766
+ </details>
767
+
768
+ <details>
769
+ <summary><b>📈 What if my usage suddenly spikes?</b></summary>
770
+
771
+ kRouter's smart fallback prevents surprise charges:
772
+
773
+ **Scenario:** You're on a coding sprint and blow through your quotas
774
+
775
+ **Without kRouter:**
776
+ - ❌ Hit rate limit → Work stops → Frustration
777
+ - ❌ Or: Accidentally rack up huge API bills
778
+
779
+ **With kRouter:**
780
+ - ✅ Subscription hits limit → Auto-fallback to cheap tier
781
+ - ✅ Cheap tier gets expensive → Auto-fallback to free tier
782
+ - ✅ Never stop coding → Predictable costs
783
+
784
+ **You're in control:** Set spending limits per provider in dashboard, and kRouter respects them.
785
+
786
+ </details>
787
+
788
+ ---
789
+
790
+ ## 📖 Setup Guide
791
+
792
+ <details>
793
+ <summary><b>🔐 Subscription Providers (Maximize Value)</b></summary>
794
+
795
+ ### Claude Code (Pro/Max)
796
+
797
+ ```bash
798
+ Dashboard → Providers → Connect Claude Code
799
+ → OAuth login → Auto token refresh
800
+ → 5-hour + weekly quota tracking
801
+
802
+ Models:
803
+ cc/claude-opus-4-7
804
+ cc/claude-opus-4-6
805
+ cc/claude-sonnet-4-6
806
+ cc/claude-haiku-4-5-20251001
807
+ ```
808
+
809
+ **Pro Tip:** Use Opus for complex tasks, Sonnet for speed. kRouter tracks quota per model!
810
+
811
+ ### OpenAI Codex (Plus/Pro)
812
+
813
+ ```bash
814
+ Dashboard → Providers → Connect Codex
815
+ → OAuth login (port 1455)
816
+ → 5-hour + weekly reset
817
+
818
+ Models:
819
+ cx/gpt-5.5
820
+ cx/gpt-5.4
821
+ cx/gpt-5.3-codex
822
+ cx/gpt-5.2-codex
823
+ ```
824
+
825
+ ### GitHub Copilot
826
+
827
+ ```bash
828
+ Dashboard → Providers → Connect GitHub
829
+ → OAuth via GitHub
830
+ → Monthly reset (1st of month)
831
+
832
+ Models:
833
+ gh/gpt-5.4
834
+ gh/claude-opus-4.7
835
+ gh/claude-sonnet-4.6
836
+ gh/gemini-3.1-pro-preview
837
+ gh/grok-code-fast-1
838
+ ```
839
+
840
+ ### Cursor IDE
841
+
842
+ ```bash
843
+ Dashboard → Providers → Connect Cursor
844
+ → OAuth login
845
+ → Monthly subscription
846
+
847
+ Models:
848
+ cu/claude-4.6-opus-max
849
+ cu/claude-4.5-sonnet-thinking
850
+ cu/gpt-5.3-codex
851
+ ```
852
+
853
+ </details>
854
+
855
+ <details>
856
+ <summary><b>💰 Cheap Providers (Backup)</b></summary>
857
+
858
+ ### GLM-5.1 / GLM-4.7 (Daily reset, $0.6/1M)
859
+
860
+ 1. Sign up: [Zhipu AI](https://open.bigmodel.cn/)
861
+ 2. Get API key from Coding Plan
862
+ 3. Dashboard → Add API Key:
863
+ - Provider: `glm`
864
+ - API Key: `your-key`
865
+
866
+ **Use:** `glm/glm-5.1`, `glm/glm-5`, `glm/glm-4.7`
867
+
868
+ **Pro Tip:** Coding Plan offers 3× quota at 1/7 cost! Reset daily 10:00 AM.
869
+
870
+ ### MiniMax M2.7 (5h reset, $0.20/1M)
871
+
872
+ 1. Sign up: [MiniMax](https://www.minimax.io/)
873
+ 2. Get API key
874
+ 3. Dashboard → Add API Key
875
+
876
+ **Use:** `minimax/MiniMax-M2.7`, `minimax/MiniMax-M2.5`
877
+
878
+ **Pro Tip:** Cheapest option for long context (1M tokens)!
879
+
880
+ ### Kimi K2.5 ($9/month flat)
881
+
882
+ 1. Subscribe: [Moonshot AI](https://platform.moonshot.ai/)
883
+ 2. Get API key
884
+ 3. Dashboard → Add API Key
885
+
886
+ **Use:** `kimi/kimi-k2.5`, `kimi/kimi-k2.5-thinking`
887
+
888
+ **Pro Tip:** Fixed $9/month for 10M tokens = $0.90/1M effective cost!
889
+
890
+ </details>
891
+
892
+ <details>
893
+ <summary><b>🆓 FREE Providers (Recommended)</b></summary>
894
+
895
+ ### Kiro AI (Claude 4.5 + GLM-5 + MiniMax FREE)
896
+
897
+ ```bash
898
+ Dashboard → Connect Kiro
899
+ → AWS Builder ID, AWS IAM Identity Center, Google, or GitHub
900
+ → Unlimited usage
901
+
902
+ Models:
903
+ kr/claude-sonnet-4.5
904
+ kr/claude-haiku-4.5
905
+ kr/glm-5
906
+ kr/MiniMax-M2.5
907
+ kr/qwen3-coder-next
908
+ kr/deepseek-3.2
909
+ ```
910
+
911
+ **Pro Tip:** Best free option for Claude. No API key, no payment, fully unlimited.
912
+
913
+ ### OpenCode Free (No auth, auto-fetch models)
914
+
915
+ ```bash
916
+ Dashboard → Connect OpenCode Free
917
+ → No login required (passthrough proxy)
918
+ → Models auto-fetched from opencode.ai/zen/v1/models
919
+ ```
920
+
921
+ **Pro Tip:** Fastest setup. Just connect and start coding.
922
+
923
+ ### Vertex AI ($300 free credits for new GCP accounts)
924
+
925
+ ```bash
926
+ Dashboard → Connect Vertex AI
927
+ → Upload Google Cloud Service Account JSON
928
+ → Enable Vertex AI API in your GCP project
929
+
930
+ Models:
931
+ vertex/gemini-3.1-pro-preview
932
+ vertex/gemini-3-flash-preview
933
+ vertex/gemini-2.5-flash
934
+
935
+ Vertex Partner (Anthropic / DeepSeek / GLM / Qwen via Vertex):
936
+ vertex-partner/glm-5-maas
937
+ vertex-partner/deepseek-v3.2-maas
938
+ vertex-partner/qwen3-next-80b-a3b-thinking-maas
939
+ ```
940
+
941
+ **Pro Tip:** New Google Cloud accounts get $300 credits free for 90 days. Plenty for daily coding.
942
+
943
+ </details>
944
+
945
+ <details>
946
+ <summary><b>🎨 Create Combos</b></summary>
947
+
948
+ ### Example 1: Maximize Subscription → Cheap Backup
949
+
950
+ ```
951
+ Dashboard → Combos → Create New
952
+
953
+ Name: premium-coding
954
+ Models:
955
+ 1. cc/claude-opus-4-7 (Subscription primary)
956
+ 2. glm/glm-5.1 (Cheap backup, $0.6/1M)
957
+ 3. minimax/MiniMax-M2.7 (Cheapest fallback, $0.20/1M)
958
+
959
+ Use in CLI: premium-coding
960
+
961
+ Monthly cost example (100M tokens):
962
+ 80M via Claude (subscription): $0 extra
963
+ 15M via GLM: $9
964
+ 5M via MiniMax: $1
965
+ Total: $10 + your subscription
966
+ ```
967
+
968
+ ### Example 2: Free-Only (Zero Cost)
969
+
970
+ ```
971
+ Name: free-combo
972
+ Models:
973
+ 1. kr/claude-sonnet-4.5 (Claude 4.5 free unlimited)
974
+ 2. kr/glm-5 (GLM-5 free via Kiro)
975
+ 3. vertex/gemini-3.1-pro-preview ($300 free credits)
976
+
977
+ Cost: $0 forever (+ 20-40% token savings via RTK)!
978
+ ```
979
+
980
+ </details>
981
+
982
+ <details>
983
+ <summary><b>🔧 CLI Integration</b></summary>
984
+
985
+ ### Cursor IDE
986
+
987
+ ```
988
+ Settings → Models → Advanced:
989
+ OpenAI API Base URL: http://localhost:20128/v1
990
+ OpenAI API Key: [from 9router dashboard]
991
+ Model: cc/claude-opus-4-7
992
+ ```
993
+
994
+ Or use combo: `premium-coding`
995
+
996
+ ### Claude Code
997
+
998
+ Edit `~/.claude/config.json`:
999
+
1000
+ ```json
1001
+ {
1002
+ "anthropic_api_base": "http://localhost:20128/v1",
1003
+ "anthropic_api_key": "your-9router-api-key"
1004
+ }
1005
+ ```
1006
+
1007
+ ### Codex CLI
1008
+
1009
+ ```bash
1010
+ export OPENAI_BASE_URL="http://localhost:20128"
1011
+ export OPENAI_API_KEY="your-9router-api-key"
1012
+
1013
+ codex "your prompt"
1014
+ ```
1015
+
1016
+ ### OpenClaw
1017
+
1018
+ **Option 1 — Dashboard (recommended):**
1019
+
1020
+ ```
1021
+ Dashboard → CLI Tools → OpenClaw → Select Model → Apply
1022
+ ```
1023
+
1024
+ **Option 2 — Manual:** Edit `~/.openclaw/openclaw.json`:
1025
+
1026
+ ```json
1027
+ {
1028
+ "agents": {
1029
+ "defaults": {
1030
+ "model": {
1031
+ "primary": "9router/kr/claude-sonnet-4.5"
1032
+ }
1033
+ }
1034
+ },
1035
+ "models": {
1036
+ "providers": {
1037
+ "9router": {
1038
+ "baseUrl": "http://127.0.0.1:20128/v1",
1039
+ "apiKey": "sk_9router",
1040
+ "api": "openai-completions",
1041
+ "models": [
1042
+ {
1043
+ "id": "kr/claude-sonnet-4.5",
1044
+ "name": "Claude Sonnet 4.5 (Kiro Free)"
1045
+ }
1046
+ ]
1047
+ }
1048
+ }
1049
+ }
1050
+ }
1051
+ ```
1052
+
1053
+ > **Note:** OpenClaw only works with local kRouter. Use `127.0.0.1` instead of `localhost` to avoid IPv6 resolution issues.
1054
+
1055
+ ### Cline / Continue / RooCode
1056
+
1057
+ ```
1058
+ Provider: OpenAI Compatible
1059
+ Base URL: http://localhost:20128/v1
1060
+ API Key: [from dashboard]
1061
+ Model: cc/claude-opus-4-7
1062
+ ```
1063
+
1064
+ </details>
1065
+
1066
+ <details>
1067
+ <summary><b>🚀 Deployment</b></summary>
1068
+
1069
+ ### VPS Deployment
1070
+
1071
+ ```bash
1072
+ # Clone and install
1073
+ git clone https://github.com/decolua/9router.git
1074
+ cd krouter
1075
+ npm install
1076
+ npm run build
1077
+
1078
+ # Configure
1079
+ export JWT_SECRET="your-secure-secret-change-this"
1080
+ export INITIAL_PASSWORD="your-password"
1081
+ export DATA_DIR="/var/lib/9router"
1082
+ export PORT="20128"
1083
+ export HOSTNAME="0.0.0.0"
1084
+ export NODE_ENV="production"
1085
+ export NEXT_PUBLIC_BASE_URL="http://localhost:20128"
1086
+ export NEXT_PUBLIC_CLOUD_URL="https://9router.com"
1087
+ export API_KEY_SECRET="endpoint-proxy-api-key-secret"
1088
+ export MACHINE_ID_SALT="endpoint-proxy-salt"
1089
+
1090
+ # Start
1091
+ npm run start
1092
+
1093
+ # Or use PM2
1094
+ npm install -g pm2
1095
+ pm2 start npm --name 9router -- start
1096
+ pm2 save
1097
+ pm2 startup
1098
+ ```
1099
+
1100
+ ### Docker
1101
+
1102
+ Published images (multi-platform `linux/amd64` + `linux/arm64`):
1103
+ - Docker Hub: [`decolua/9router`](https://hub.docker.com/r/decolua/9router)
1104
+ - GHCR: [`ghcr.io/decolua/9router`](https://github.com/decolua/9router/pkgs/container/9router)
1105
+
1106
+ **Quick start (use published image):**
1107
+
1108
+ ```bash
1109
+ docker run -d \
1110
+ --name 9router \
1111
+ -p 20128:20128 \
1112
+ -v "$HOME/.9router:/app/data" \
1113
+ -e DATA_DIR=/app/data \
1114
+ decolua/9router:latest
1115
+ ```
1116
+
1117
+ → Open http://localhost:20128
1118
+
1119
+ **Build from source (dev):**
1120
+
1121
+ ```bash
1122
+ git clone https://github.com/decolua/9router.git
1123
+ cd 9router/app
1124
+ docker build -t 9router .
1125
+ docker run -d --name 9router -p 20128:20128 \
1126
+ -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data 9router
1127
+ ```
1128
+
1129
+ **Container defaults:**
1130
+ - `PORT=20128`
1131
+ - `HOSTNAME=0.0.0.0`
1132
+
1133
+ **Useful commands:**
1134
+
1135
+ ```bash
1136
+ docker logs -f 9router
1137
+ docker restart 9router
1138
+ docker stop 9router && docker rm 9router
1139
+ docker pull decolua/9router:latest # update to latest
1140
+ ```
1141
+
1142
+ **Data persistence:** `$HOME/.9router/db/data.sqlite` on host ↔ `/app/data/db/data.sqlite` in container.
1143
+
1144
+ ### Environment Variables
1145
+
1146
+ | Variable | Default | Description |
1147
+ |----------|---------|-------------|
1148
+ | `JWT_SECRET` | Auto-generated (`~/.9router/jwt-secret`) | JWT signing secret for dashboard auth cookie (override to share across instances) |
1149
+ | `INITIAL_PASSWORD` | `123456` | First login password when no saved hash exists |
1150
+ | `DATA_DIR` | `~/.9router` | Main app data location (SQLite at `$DATA_DIR/db/data.sqlite`) |
1151
+ | `PORT` | framework default | Service port (`20128` in examples) |
1152
+ | `HOSTNAME` | framework default | Bind host (Docker defaults to `0.0.0.0`) |
1153
+ | `NODE_ENV` | runtime default | Set `production` for deploy |
1154
+ | `BASE_URL` | `http://localhost:20128` | Server-side internal base URL used by cloud sync jobs |
1155
+ | `CLOUD_URL` | `https://9router.com` | Server-side cloud sync endpoint base URL |
1156
+ | `NEXT_PUBLIC_BASE_URL` | `http://localhost:3000` | Backward-compatible/public base URL (prefer `BASE_URL` for server runtime) |
1157
+ | `NEXT_PUBLIC_CLOUD_URL` | `https://9router.com` | Backward-compatible/public cloud URL (prefer `CLOUD_URL` for server runtime) |
1158
+ | `API_KEY_SECRET` | `endpoint-proxy-api-key-secret` | HMAC secret for generated API keys |
1159
+ | `MACHINE_ID_SALT` | `endpoint-proxy-salt` | Salt for stable machine ID hashing |
1160
+ | `ENABLE_REQUEST_LOGS` | `false` | Enables request/response logs under `logs/` |
1161
+ | `AUTH_COOKIE_SECURE` | `false` | Force `Secure` auth cookie (set `true` behind HTTPS reverse proxy) |
1162
+ | `REQUIRE_API_KEY` | `false` | Enforce Bearer API key on `/v1/*` routes (recommended for internet-exposed deploys) |
1163
+ | `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY` | empty | Optional outbound proxy for upstream provider calls |
1164
+
1165
+ Notes:
1166
+ - Lowercase proxy variables are also supported: `http_proxy`, `https_proxy`, `all_proxy`, `no_proxy`.
1167
+ - `.env` is not baked into Docker image (`.dockerignore`); inject runtime config with `--env-file` or `-e`.
1168
+ - On Windows, `APPDATA` can be used for local storage path resolution.
1169
+ - `INSTANCE_NAME` appears in older docs/env templates, but is currently not used at runtime.
1170
+
1171
+ ### Runtime Files and Storage
1172
+
1173
+ - Main app state: `${DATA_DIR}/db/data.sqlite` (SQLite — providers, combos, aliases, keys, settings, usage history)
1174
+ - Auto backups: `${DATA_DIR}/db/backups/`
1175
+ - Optional request/translator logs: `<repo>/logs/...` when `ENABLE_REQUEST_LOGS=true`
1176
+ - 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.
1177
+
1178
+ </details>
1179
+
1180
+ ---
1181
+
1182
+ ## 📊 Available Models
1183
+
1184
+ <details>
1185
+ <summary><b>View all available models</b></summary>
1186
+
1187
+ **Claude Code (`cc/`)** - Pro/Max:
1188
+ - `cc/claude-opus-4-7`
1189
+ - `cc/claude-opus-4-6`
1190
+ - `cc/claude-sonnet-4-6`
1191
+ - `cc/claude-sonnet-4-5-20250929`
1192
+ - `cc/claude-haiku-4-5-20251001`
1193
+
1194
+ **Codex (`cx/`)** - Plus/Pro:
1195
+ - `cx/gpt-5.5`
1196
+ - `cx/gpt-5.4`
1197
+ - `cx/gpt-5.3-codex`
1198
+ - `cx/gpt-5.2-codex`
1199
+ - `cx/gpt-5.1-codex-max`
1200
+
1201
+ **GitHub Copilot (`gh/`)**:
1202
+ - `gh/gpt-5.4`
1203
+ - `gh/claude-opus-4.7`
1204
+ - `gh/claude-sonnet-4.6`
1205
+ - `gh/gemini-3.1-pro-preview`
1206
+ - `gh/grok-code-fast-1`
1207
+
1208
+ **Cursor (`cu/`)** - Subscription:
1209
+ - `cu/claude-4.6-opus-max`
1210
+ - `cu/claude-4.5-sonnet-thinking`
1211
+ - `cu/gpt-5.3-codex`
1212
+ - `cu/kimi-k2.5`
1213
+
1214
+ **GLM (`glm/`)** - $0.6/1M:
1215
+ - `glm/glm-5.1`
1216
+ - `glm/glm-5`
1217
+ - `glm/glm-4.7`
1218
+
1219
+ **MiniMax (`minimax/`)** - $0.2/1M:
1220
+ - `minimax/MiniMax-M2.7`
1221
+ - `minimax/MiniMax-M2.5`
1222
+
1223
+ **Kimi (`kimi/`)** - $9/mo flat:
1224
+ - `kimi/kimi-k2.5`
1225
+ - `kimi/kimi-k2.5-thinking`
1226
+
1227
+ **Kiro (`kr/`)** - FREE unlimited:
1228
+ - `kr/claude-sonnet-4.5`
1229
+ - `kr/claude-haiku-4.5`
1230
+ - `kr/glm-5`
1231
+ - `kr/MiniMax-M2.5`
1232
+ - `kr/qwen3-coder-next`
1233
+ - `kr/deepseek-3.2`
1234
+
1235
+ **OpenCode Free (`oc/`)** - FREE no-auth:
1236
+ - Auto-fetched from `opencode.ai/zen/v1/models`
1237
+
1238
+ **Vertex AI (`vertex/`)** - $300 free credits:
1239
+ - `vertex/gemini-3.1-pro-preview`
1240
+ - `vertex/gemini-3-flash-preview`
1241
+ - `vertex/gemini-2.5-flash`
1242
+ - `vertex-partner/glm-5-maas`
1243
+ - `vertex-partner/deepseek-v3.2-maas`
1244
+
1245
+ </details>
1246
+
1247
+ ---
1248
+
1249
+ ## 🐛 Troubleshooting
1250
+
1251
+ **"Language model did not provide messages"**
1252
+ - Provider quota exhausted → Check dashboard quota tracker
1253
+ - Solution: Use combo fallback or switch to cheaper tier
1254
+
1255
+ **Rate limiting**
1256
+ - Subscription quota out → Fallback to GLM/MiniMax
1257
+ - Add combo: `cc/claude-opus-4-7 → glm/glm-5.1 → kr/claude-sonnet-4.5`
1258
+
1259
+ **OAuth token expired**
1260
+ - Auto-refreshed by kRouter
1261
+ - If issues persist: Dashboard → Provider → Reconnect
1262
+
1263
+ **High costs**
1264
+ - Enable RTK in Dashboard → Endpoint settings (default ON, saves 20-40% tokens)
1265
+ - Check usage stats in Dashboard
1266
+ - Switch primary model to GLM/MiniMax
1267
+ - Use free tier (Kiro, OpenCode Free, Vertex) for non-critical tasks
1268
+
1269
+ **Dashboard opens on wrong port**
1270
+ - Set `PORT=20128` and `NEXT_PUBLIC_BASE_URL=http://localhost:20128`
1271
+
1272
+ **First login not working**
1273
+ - Check `INITIAL_PASSWORD` in `.env`
1274
+ - If unset, fallback password is `123456`
1275
+
1276
+ **No request logs under `logs/`**
1277
+ - Set `ENABLE_REQUEST_LOGS=true`
1278
+
1279
+ ---
1280
+
1281
+ ## 🛠️ Tech Stack
1282
+
1283
+ - **Runtime**: Node.js 20+
1284
+ - **Framework**: Next.js 16
1285
+ - **UI**: React 19 + Tailwind CSS 4
1286
+ - **Database**: SQLite (better-sqlite3 / node:sqlite / sql.js fallback)
1287
+ - **Streaming**: Server-Sent Events (SSE)
1288
+ - **Auth**: OAuth 2.0 (PKCE) + JWT + API Keys
1289
+
1290
+ ---
1291
+
1292
+ ## 📝 API Reference
1293
+
1294
+ ### Chat Completions
1295
+
1296
+ ```bash
1297
+ POST http://localhost:20128/v1/chat/completions
1298
+ Authorization: Bearer your-api-key
1299
+ Content-Type: application/json
1300
+
1301
+ {
1302
+ "model": "cc/claude-opus-4-6",
1303
+ "messages": [
1304
+ {"role": "user", "content": "Write a function to..."}
1305
+ ],
1306
+ "stream": true
1307
+ }
1308
+ ```
1309
+
1310
+ ### List Models
1311
+
1312
+ ```bash
1313
+ GET http://localhost:20128/v1/models
1314
+ Authorization: Bearer your-api-key
1315
+
1316
+ → Returns all models + combos in OpenAI format
1317
+ ```
1318
+
1319
+ ## 📧 Support
1320
+
1321
+ - **GitHub**: [github.com/sifxprime/krouter](https://github.com/sifxprime/krouter)
1322
+ - **Issues**: [github.com/sifxprime/krouter/issues](https://github.com/sifxprime/krouter/issues)
1323
+ - **npm**: [`@sifxprime/krouter`](https://www.npmjs.com/package/@sifxprime/krouter)
116
1324
 
117
1325
  ---
118
1326
 
119
1327
  ## 🙏 Acknowledgments
120
1328
 
121
- - **[CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)** - Original Go implementation
1329
+ Built on the shoulders of giants:
1330
+
1331
+ - **[decolua/9router](https://github.com/decolua/9router)** — the upstream project this fork tracks. All core architecture, providers, dashboard, and ongoing feature work are authored upstream. kRouter only adds the security + stability hardening described in the [About this fork](#-about-this-fork--sifxprimekrouter) section.
1332
+ - **[CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)** — original Go implementation that inspired the upstream JavaScript port.
1333
+ - **[CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)** — original Go implementation that inspired this JavaScript port.
1334
+ - **[RTK](https://github.com/rtk-ai/rtk)** ![Stars](https://img.shields.io/github/stars/rtk-ai/rtk?style=flat&color=yellow) — Rust token-saver. kRouter ports its compression pipeline to JS → **−20-40% input tokens** on every request.
1335
+ - **[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"*. kRouter adapts its prompt → **−65% output tokens**.
1336
+
1337
+ Huge thanks to these authors — without their work, kRouter's token-saving features wouldn't exist. ⭐ them on GitHub!
1338
+
1339
+ ---
122
1340
 
123
1341
  ## 📄 License
124
1342
 
125
1343
  MIT License - see [LICENSE](LICENSE) for details.
1344
+
1345
+ ---
1346
+
1347
+ <div align="center">
1348
+ <sub>Built with ❤️ for developers who code 24/7</sub>
1349
+ </div>