diff --git a/.github/workflows/gitbook-pages.yml b/.github/workflows/gitbook-pages.yml
new file mode 100644
index 0000000..27472a8
--- /dev/null
+++ b/.github/workflows/gitbook-pages.yml
@@ -0,0 +1,52 @@
+name: Deploy GitBook to 9router.github.io
+
+on:
+ push:
+ branches: [main, master]
+ paths:
+ - "gitbook/**"
+ - ".github/workflows/gitbook-pages.yml"
+ workflow_dispatch:
+
+concurrency:
+ group: gitbook-pages
+ cancel-in-progress: true
+
+jobs:
+ build-deploy:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: gitbook
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+ cache-dependency-path: gitbook/package-lock.json
+
+ - name: Install deps
+ run: npm ci || npm install
+
+ - name: Build static export
+ run: npm run build
+ env:
+ NODE_ENV: production
+ NEXT_PUBLIC_BASE_PATH: ""
+
+ - name: Add .nojekyll
+ run: touch out/.nojekyll
+
+ - name: Deploy to 9router.github.io
+ uses: peaceiris/actions-gh-pages@v4
+ with:
+ deploy_key: ${{ secrets.GH_PAGES_DEPLOY_KEY }}
+ external_repository: 9router/9router.github.io
+ publish_branch: main
+ publish_dir: gitbook/out
+ force_orphan: true
+ user_name: github-actions[bot]
+ user_email: github-actions[bot]@users.noreply.github.com
+ commit_message: "deploy: ${{ github.sha }}"
diff --git a/.gitignore b/.gitignore
index b1a63e6..07e7f7d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,3 +70,4 @@ ecosystem.config.*
scripts/agSniffer/*
gitbooks/*
+gitbook/README.md
diff --git a/gitbook/.gitignore b/gitbook/.gitignore
new file mode 100644
index 0000000..d972524
--- /dev/null
+++ b/gitbook/.gitignore
@@ -0,0 +1,44 @@
+# Dependencies
+node_modules/
+.pnp
+.pnp.js
+
+# Testing
+coverage/
+
+# Next.js
+.next/
+out/
+build/
+dist/
+
+# Production
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Environment
+.env
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# IDE
+.vscode/
+.idea/
+*.swp
+*.swo
+*~
+
+# OS
+.DS_Store
+Thumbs.db
+
+# Misc
+*.tsbuildinfo
+
+# Wrangler
+.wrangler/
+.dev.vars
diff --git a/gitbook/app/[lang]/[...slug]/page.js b/gitbook/app/[lang]/[...slug]/page.js
new file mode 100644
index 0000000..792856d
--- /dev/null
+++ b/gitbook/app/[lang]/[...slug]/page.js
@@ -0,0 +1,36 @@
+import DocsLayout from "@/components/DocsLayout";
+import DocsContent from "@/components/DocsContent";
+import { extractHeadings } from "@/utils/markdown";
+import { loadContent, getAllSlugs } from "@/lib/content";
+import { LANG_CODES, isValidLang, DEFAULT_LANG } from "@/constants/languages";
+import { notFound } from "next/navigation";
+
+export const dynamicParams = false;
+
+export async function generateStaticParams() {
+ // Build params for every (lang × slug) combination based on default language slugs.
+ const slugs = getAllSlugs(DEFAULT_LANG);
+ const params = [];
+ for (const lang of LANG_CODES) {
+ for (const slug of slugs) {
+ params.push({ lang, slug });
+ }
+ }
+ return params;
+}
+
+export default async function DocPage({ params }) {
+ const { lang, slug } = await params;
+ if (!isValidLang(lang)) notFound();
+
+ const content = loadContent(lang, slug);
+ if (!content) notFound();
+
+ const headings = extractHeadings(content);
+
+ return (
+
+
+
+ );
+}
diff --git a/gitbook/app/[lang]/page.js b/gitbook/app/[lang]/page.js
new file mode 100644
index 0000000..4da007c
--- /dev/null
+++ b/gitbook/app/[lang]/page.js
@@ -0,0 +1,26 @@
+import DocsLayout from "@/components/DocsLayout";
+import DocsContent from "@/components/DocsContent";
+import { extractHeadings } from "@/utils/markdown";
+import { loadContent } from "@/lib/content";
+import { LANG_CODES, isValidLang } from "@/constants/languages";
+import { notFound } from "next/navigation";
+
+export const dynamicParams = false;
+
+export async function generateStaticParams() {
+ return LANG_CODES.map(lang => ({ lang }));
+}
+
+export default async function LangHomePage({ params }) {
+ const { lang } = await params;
+ if (!isValidLang(lang)) notFound();
+
+ const content = loadContent(lang, "index") || "# 9Router Documentation\n\nContent coming soon...";
+ const headings = extractHeadings(content);
+
+ return (
+
+
+
+ );
+}
diff --git a/gitbook/app/globals.css b/gitbook/app/globals.css
new file mode 100644
index 0000000..8ac76c1
--- /dev/null
+++ b/gitbook/app/globals.css
@@ -0,0 +1,190 @@
+@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
+@import "tailwindcss";
+
+/* Base styles */
+* {
+ box-sizing: border-box;
+}
+
+body {
+ font-family: 'Inter', system-ui, -apple-system, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ margin: 0;
+ padding: 0;
+}
+
+/* Scrollbar */
+::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+}
+
+::-webkit-scrollbar-track {
+ background: transparent;
+}
+
+::-webkit-scrollbar-thumb {
+ background: #CBD5E1;
+ border-radius: 4px;
+}
+
+::-webkit-scrollbar-thumb:hover {
+ background: #E68A6E;
+}
+
+/* Code highlighting */
+pre {
+ background: #F1F5F9 !important;
+ border-radius: 8px;
+ padding: 1rem;
+ overflow-x: auto;
+}
+
+code {
+ font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
+ font-size: 0.875rem;
+ line-height: 1.5;
+}
+
+/* Inline code */
+:not(pre) > code {
+ background: #F1F5F9;
+ color: #E68A6E;
+ padding: 0.125rem 0.375rem;
+ border-radius: 4px;
+ font-size: 0.875em;
+}
+
+/* Markdown content styles */
+.markdown-content h1 {
+ font-size: 2.5rem;
+ font-weight: 800;
+ color: #E68A6E;
+ /* margin-top: 2rem; */
+ margin-bottom: 1rem;
+ line-height: 1.2;
+ display: flex;
+ align-items: center;
+}
+
+.markdown-content h1 svg {
+ width: 2.5rem;
+ height: 2.5rem;
+ flex-shrink: 0;
+}
+
+.markdown-content h2 {
+ font-size: 2rem;
+ font-weight: 700;
+ color: #000000;
+ margin-top: 2rem;
+ margin-bottom: 1rem;
+ line-height: 1.3;
+ border-bottom: 1px solid #E5E7EB;
+ padding-bottom: 0.5rem;
+}
+
+.markdown-content h3 {
+ font-size: 1.5rem;
+ font-weight: 600;
+ color: #000000;
+ margin-top: 1.5rem;
+ margin-bottom: 0.75rem;
+ line-height: 1.4;
+}
+
+.markdown-content p {
+ font-size: 1.125rem;
+ line-height: 1.75;
+ margin-bottom: 1rem;
+ color: #6B7280;
+}
+
+.markdown-content ul,
+.markdown-content ol {
+ margin-left: 1.5rem;
+ margin-bottom: 1rem;
+}
+
+.markdown-content li {
+ font-size: 1.125rem;
+ line-height: 1.75;
+ margin-bottom: 0.5rem;
+ color: #6B7280;
+}
+
+.markdown-content a {
+ color: #E68A6E;
+ text-decoration: underline;
+ transition: opacity 0.2s;
+}
+
+.markdown-content a:hover {
+ opacity: 0.8;
+}
+
+.markdown-content blockquote {
+ border-left: 4px solid #E68A6E;
+ padding-left: 1rem;
+ margin: 1rem 0;
+ font-style: italic;
+ color: #6B7280;
+}
+
+.markdown-content strong {
+ font-weight: 600;
+ color: #000000;
+}
+
+/* Smooth scroll */
+html {
+ scroll-behavior: smooth;
+ scroll-padding-top: 5rem; /* Offset for sticky header (64px + padding) */
+}
+
+/* Heading anchor offset for sticky header */
+.markdown-content h1,
+.markdown-content h2,
+.markdown-content h3 {
+ scroll-margin-top: 5rem;
+}
+
+/* Mobile menu overlay */
+.mobile-menu-overlay {
+ position: fixed;
+ inset: 0;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: 40;
+ animation: fadeIn 0.2s ease-out;
+}
+
+@keyframes fadeIn {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+.mobile-menu-drawer {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ width: 280px;
+ background: white;
+ z-index: 50;
+ animation: slideInLeft 0.3s ease-out;
+ overflow-y: auto;
+}
+
+@keyframes slideInLeft {
+ from {
+ transform: translateX(-100%);
+ }
+ to {
+ transform: translateX(0);
+ }
+}
diff --git a/gitbook/app/layout.js b/gitbook/app/layout.js
new file mode 100644
index 0000000..aa49925
--- /dev/null
+++ b/gitbook/app/layout.js
@@ -0,0 +1,21 @@
+import { DOCS_CONFIG } from "@/constants/docsConfig";
+import "./globals.css";
+
+export const metadata = {
+ title: DOCS_CONFIG.title,
+ description: DOCS_CONFIG.description,
+};
+
+export default function RootLayout({ children }) {
+ return (
+
+
+ setMobileMenuOpen(false)}
+ />
+
+
+
+
+ 9{DOCS_CONFIG.logo} Docs
+
+
+
+
setMobileMenuOpen(false)} lang={lang} />
+
+ >
+ )}
+ >
+ );
+}
diff --git a/gitbook/components/DocsLayout.js b/gitbook/components/DocsLayout.js
new file mode 100644
index 0000000..17c6d94
--- /dev/null
+++ b/gitbook/components/DocsLayout.js
@@ -0,0 +1,25 @@
+"use client";
+
+import DocsHeader from "./DocsHeader";
+import DocsSidebar from "./DocsSidebar";
+import DocsToc from "./DocsToc";
+import { DEFAULT_LANG } from "@/constants/languages";
+
+export default function DocsLayout({ children, headings = [], lang = DEFAULT_LANG }) {
+ return (
+
+
+
+ {/* Desktop sidebar */}
+
+
+
+
+
+ {children}
+
+
+
+
+ );
+}
diff --git a/gitbook/components/DocsSidebar.js b/gitbook/components/DocsSidebar.js
new file mode 100644
index 0000000..dffd9bc
--- /dev/null
+++ b/gitbook/components/DocsSidebar.js
@@ -0,0 +1,122 @@
+"use client";
+
+import { useState } from "react";
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+import { DOCS_CONFIG } from "@/constants/docsConfig";
+import { DEFAULT_LANG } from "@/constants/languages";
+import { ChevronDown, ChevronRight, BookOpen, Rocket, Terminal, Monitor, FolderOpen, HelpCircle, MessageCircle, Layers, Plug, Cloud, Zap, Wallet, Gift, GitBranch, BarChart3, Code2, Sparkles, Server, Globe } from "lucide-react";
+
+const SECTION_ICONS = {
+ "Getting Started": Rocket,
+ "Providers": Layers,
+ "Features": Zap,
+ "Integration": Plug,
+ "Deployment": Cloud,
+ "Help": HelpCircle
+};
+
+const ITEM_ICONS = {
+ "Introduction": BookOpen,
+ "Quick Start": Rocket,
+ "Installation": Terminal,
+ "Subscription (Maximize)": Sparkles,
+ "Cheap (Backup)": Wallet,
+ "Free (Fallback)": Gift,
+ "Smart Routing": GitBranch,
+ "Combos & Fallback": Layers,
+ "Quota Tracking": BarChart3,
+ "Claude Code": Code2,
+ "OpenAI Codex": Code2,
+ "Cursor": Code2,
+ "Cline": Code2,
+ "Roo": Code2,
+ "Continue": Code2,
+ "Other Tools": Plug,
+ "Localhost": Monitor,
+ "Cloud (VPS/Docker)": Server,
+ "Troubleshooting": HelpCircle,
+ "FAQ": MessageCircle
+};
+
+export default function DocsSidebar({ isMobile = false, onClose, lang = DEFAULT_LANG }) {
+ const pathname = usePathname();
+ const [openSections, setOpenSections] = useState(
+ DOCS_CONFIG.navigation.map((_, i) => i)
+ );
+
+ const toggleSection = (index) => {
+ setOpenSections(prev =>
+ prev.includes(index)
+ ? prev.filter(i => i !== index)
+ : [...prev, index]
+ );
+ };
+
+ // Build URL for a navigation slug under current language
+ const buildHref = (slug) => (slug ? `/${lang}/${slug}` : `/${lang}`);
+
+ const isActive = (slug) => pathname === buildHref(slug);
+
+ const handleLinkClick = () => {
+ if (isMobile && onClose) {
+ onClose();
+ }
+ };
+
+ return (
+
+ );
+}
diff --git a/gitbook/components/DocsToc.js b/gitbook/components/DocsToc.js
new file mode 100644
index 0000000..1d1eade
--- /dev/null
+++ b/gitbook/components/DocsToc.js
@@ -0,0 +1,59 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { List } from "lucide-react";
+
+export default function DocsToc({ headings }) {
+ const [activeId, setActiveId] = useState("");
+
+ useEffect(() => {
+ const observer = new IntersectionObserver(
+ (entries) => {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting) {
+ setActiveId(entry.target.id);
+ }
+ });
+ },
+ { rootMargin: "-80px 0px -80% 0px" }
+ );
+
+ headings.forEach(({ id }) => {
+ const element = document.getElementById(id);
+ if (element) observer.observe(element);
+ });
+
+ return () => observer.disconnect();
+ }, [headings]);
+
+ if (!headings || headings.length === 0) return null;
+
+ return (
+
+ );
+}
diff --git a/gitbook/components/LanguageSwitcher.js b/gitbook/components/LanguageSwitcher.js
new file mode 100644
index 0000000..ca8afb2
--- /dev/null
+++ b/gitbook/components/LanguageSwitcher.js
@@ -0,0 +1,96 @@
+"use client";
+
+import { useState, useEffect } from "react";
+import { createPortal } from "react-dom";
+import { useRouter, usePathname } from "next/navigation";
+import { Globe, X } from "lucide-react";
+import { LANGUAGES, getLanguage, DEFAULT_LANG } from "@/constants/languages";
+
+function extractLangFromPath(pathname) {
+ const match = pathname.match(/^\/([^/]+)(?:\/(.*))?$/);
+ if (!match) return { lang: DEFAULT_LANG, rest: "" };
+ return { lang: match[1], rest: match[2] || "" };
+}
+
+export default function LanguageSwitcher({ currentLang }) {
+ const [open, setOpen] = useState(false);
+ const [mounted, setMounted] = useState(false);
+ const router = useRouter();
+ const pathname = usePathname();
+ const current = getLanguage(currentLang);
+
+ useEffect(() => {
+ setMounted(true);
+ }, []);
+
+ // Lock body scroll when modal is open
+ useEffect(() => {
+ if (open) {
+ document.body.style.overflow = "hidden";
+ return () => { document.body.style.overflow = ""; };
+ }
+ }, [open]);
+
+ const switchTo = (code) => {
+ const { rest } = extractLangFromPath(pathname);
+ const target = rest ? `/${code}/${rest}` : `/${code}`;
+ setOpen(false);
+ router.push(target);
+ };
+
+ const modal = open && (
+
setOpen(false)}>
+
e.stopPropagation()}
+ >
+
+
Select Language
+
+
+
+ {LANGUAGES.map((lang) => (
+
+ ))}
+
+
+
+ );
+
+ return (
+ <>
+
+
+ {mounted && open && createPortal(modal, document.body)}
+ >
+ );
+}
diff --git a/gitbook/constants/docsConfig.js b/gitbook/constants/docsConfig.js
new file mode 100644
index 0000000..9746818
--- /dev/null
+++ b/gitbook/constants/docsConfig.js
@@ -0,0 +1,60 @@
+export const DOCS_CONFIG = {
+ title: "9Router Documentation",
+ description: "Smart AI model router - Maximize subscriptions, minimize costs",
+ logo: "9Router",
+ appUrl: "https://9router.com",
+ githubUrl: "https://github.com/decolua/9router",
+
+ navigation: [
+ {
+ title: "Getting Started",
+ items: [
+ { title: "Introduction", slug: "" },
+ { title: "Quick Start", slug: "getting-started/quick-start" },
+ { title: "Installation", slug: "getting-started/installation" }
+ ]
+ },
+ {
+ title: "Providers",
+ items: [
+ { title: "Subscription (Maximize)", slug: "providers/subscription" },
+ { title: "Cheap (Backup)", slug: "providers/cheap" },
+ { title: "Free (Fallback)", slug: "providers/free" }
+ ]
+ },
+ {
+ title: "Features",
+ items: [
+ { title: "Smart Routing", slug: "features/smart-routing" },
+ { title: "Combos & Fallback", slug: "features/combos" },
+ { title: "Quota Tracking", slug: "features/quota-tracking" }
+ ]
+ },
+ {
+ title: "Integration",
+ items: [
+ { title: "Claude Code", slug: "integration/claude-code" },
+ { title: "OpenAI Codex", slug: "integration/codex" },
+ { title: "Cursor", slug: "integration/cursor" },
+ { title: "Cline", slug: "integration/cline" },
+ { title: "Roo", slug: "integration/roo" },
+ { title: "Continue", slug: "integration/continue" },
+ { title: "Other Tools", slug: "integration/other-tools" }
+ ]
+ },
+ {
+ title: "Deployment",
+ items: [
+ { title: "Localhost", slug: "deployment/localhost" },
+ { title: "Cloud (VPS/Docker)", slug: "deployment/cloud" }
+ ]
+ },
+ {
+ title: "Help",
+ items: [
+ { title: "Troubleshooting", slug: "troubleshooting" },
+ { title: "FAQ", slug: "faq" }
+ ]
+ }
+ ]
+};
diff --git a/gitbook/constants/languages.js b/gitbook/constants/languages.js
new file mode 100644
index 0000000..9f64174
--- /dev/null
+++ b/gitbook/constants/languages.js
@@ -0,0 +1,19 @@
+export const DEFAULT_LANG = "en";
+
+export const LANGUAGES = [
+ { code: "en", name: "English", native: "English", flag: "🇺🇸" },
+ { code: "vi", name: "Vietnamese", native: "Tiếng Việt", flag: "🇻🇳" },
+ { code: "zh-CN", name: "Chinese (Simplified)", native: "简体中文", flag: "🇨🇳" },
+ { code: "es", name: "Spanish", native: "Español", flag: "🇪🇸" },
+ { code: "ja", name: "Japanese", native: "日本語", flag: "🇯🇵" }
+];
+
+export const LANG_CODES = LANGUAGES.map(l => l.code);
+
+export function isValidLang(code) {
+ return LANG_CODES.includes(code);
+}
+
+export function getLanguage(code) {
+ return LANGUAGES.find(l => l.code === code) || LANGUAGES[0];
+}
diff --git a/gitbook/content/en/deployment/cloud.md b/gitbook/content/en/deployment/cloud.md
new file mode 100644
index 0000000..80e4b28
--- /dev/null
+++ b/gitbook/content/en/deployment/cloud.md
@@ -0,0 +1,473 @@
+# ☁️ Cloud Deployment
+
+Deploy 9Router on VPS or Docker for remote access and production use.
+
+---
+
+## 🖥️ VPS Deployment
+
+### Prerequisites
+
+- Ubuntu 20.04+ or similar Linux distribution
+- Node.js 20+
+- Git
+- Root or sudo access
+
+### Step 1: Clone Repository
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+```
+
+### Step 2: Install Dependencies
+
+```bash
+npm install
+```
+
+### Step 3: Build Application
+
+```bash
+npm run build
+```
+
+### Step 4: Configure Environment Variables
+
+Create a `.env` file or export variables:
+
+```bash
+export JWT_SECRET="your-secure-secret-change-this-to-random-string"
+export INITIAL_PASSWORD="your-secure-password"
+export DATA_DIR="/var/lib/9router"
+export NODE_ENV="production"
+```
+
+**Environment Variables:**
+
+| Variable | Default | Description |
+|----------|---------|-------------|
+| `JWT_SECRET` | Auto-generated | **MUST change in production!** Used for JWT token signing |
+| `INITIAL_PASSWORD` | `123456` | Dashboard login password |
+| `DATA_DIR` | `~/.9router` | Database and data storage path |
+| `NODE_ENV` | `development` | Set to `production` for deployment |
+| `ENABLE_REQUEST_LOGS` | `false` | Enable debug request/response logs |
+
+### Step 5: Create Data Directory
+
+```bash
+sudo mkdir -p /var/lib/9router
+sudo chown $USER:$USER /var/lib/9router
+```
+
+### Step 6: Start Application
+
+```bash
+npm run start
+```
+
+### Step 7: Setup PM2 for Production
+
+PM2 keeps your application running and restarts it on crashes:
+
+```bash
+# Install PM2 globally
+npm install -g pm2
+
+# Start 9Router with PM2
+pm2 start npm --name 9router -- start
+
+# Save PM2 configuration
+pm2 save
+
+# Setup PM2 to start on system boot
+pm2 startup
+# Follow the instructions printed by the command above
+```
+
+**PM2 Management Commands:**
+
+```bash
+# View logs
+pm2 logs 9router
+
+# Restart application
+pm2 restart 9router
+
+# Stop application
+pm2 stop 9router
+
+# View status
+pm2 status
+
+# Monitor resources
+pm2 monit
+```
+
+---
+
+## 🐳 Docker Deployment
+
+### Option 1: Using Dockerfile
+
+Create a `Dockerfile` in the `app` directory:
+
+```dockerfile
+FROM node:20-alpine
+
+WORKDIR /app
+
+# Copy package files
+COPY package*.json ./
+
+# Install dependencies
+RUN npm ci --only=production
+
+# Copy application files
+COPY . .
+
+# Build application
+RUN npm run build
+
+# Expose ports
+EXPOSE 3000 20128
+
+# Set environment variables
+ENV NODE_ENV=production
+ENV DATA_DIR=/app/data
+
+# Create data directory
+RUN mkdir -p /app/data
+
+# Start application
+CMD ["npm", "run", "start"]
+```
+
+**Build and Run:**
+
+```bash
+# Build image
+docker build -t 9router .
+
+# Run container
+docker run -d \
+ --name 9router \
+ -p 3000:3000 \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret-change-this" \
+ -e INITIAL_PASSWORD="your-secure-password" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Option 2: Docker Compose
+
+Create `docker-compose.yml`:
+
+```yaml
+version: '3.8'
+
+services:
+ 9router:
+ build: .
+ container_name: 9router
+ ports:
+ - "3000:3000"
+ - "20128:20128"
+ environment:
+ - NODE_ENV=production
+ - JWT_SECRET=your-secure-secret-change-this
+ - INITIAL_PASSWORD=your-secure-password
+ - DATA_DIR=/app/data
+ volumes:
+ - 9router-data:/app/data
+ restart: unless-stopped
+
+volumes:
+ 9router-data:
+```
+
+**Run with Docker Compose:**
+
+```bash
+# Start services
+docker-compose up -d
+
+# View logs
+docker-compose logs -f
+
+# Stop services
+docker-compose down
+
+# Rebuild and restart
+docker-compose up -d --build
+```
+
+---
+
+## 🌐 Reverse Proxy with Nginx
+
+### Why Use Nginx?
+
+- SSL/TLS termination
+- Domain name mapping
+- Load balancing
+- Better security
+
+### Step 1: Install Nginx
+
+```bash
+sudo apt update
+sudo apt install nginx
+```
+
+### Step 2: Configure Nginx
+
+Create `/etc/nginx/sites-available/9router`:
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ # Redirect HTTP to HTTPS
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl http2;
+ server_name your-domain.com;
+
+ # SSL certificates (use certbot to generate)
+ ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
+
+ # SSL configuration
+ ssl_protocols TLSv1.2 TLSv1.3;
+ ssl_ciphers HIGH:!aNULL:!MD5;
+ ssl_prefer_server_ciphers on;
+
+ # Proxy to 9Router
+ location / {
+ proxy_pass http://localhost:3000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+
+ # API endpoint
+ location /v1 {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+### Step 3: Enable Site
+
+```bash
+# Create symbolic link
+sudo ln -s /etc/nginx/sites-available/9router /etc/nginx/sites-enabled/
+
+# Test configuration
+sudo nginx -t
+
+# Reload Nginx
+sudo systemctl reload nginx
+```
+
+### Step 4: Setup SSL with Let's Encrypt
+
+```bash
+# Install certbot
+sudo apt install certbot python3-certbot-nginx
+
+# Obtain SSL certificate
+sudo certbot --nginx -d your-domain.com
+
+# Auto-renewal is configured automatically
+# Test renewal
+sudo certbot renew --dry-run
+```
+
+---
+
+## 🔒 Security Considerations
+
+### 1. Change Default Credentials
+
+**CRITICAL:** Change `JWT_SECRET` and `INITIAL_PASSWORD` before deployment:
+
+```bash
+# Generate secure JWT secret
+openssl rand -base64 32
+
+# Use this value for JWT_SECRET
+export JWT_SECRET="generated-secret-here"
+```
+
+### 2. Firewall Configuration
+
+```bash
+# Allow SSH
+sudo ufw allow 22/tcp
+
+# Allow HTTP/HTTPS (if using Nginx)
+sudo ufw allow 80/tcp
+sudo ufw allow 443/tcp
+
+# If NOT using reverse proxy, allow 9Router ports
+sudo ufw allow 3000/tcp
+sudo ufw allow 20128/tcp
+
+# Enable firewall
+sudo ufw enable
+```
+
+### 3. Restrict Dashboard Access
+
+If you only need API access, restrict dashboard port:
+
+```bash
+# Only allow localhost access to dashboard
+sudo ufw deny 3000/tcp
+```
+
+Access dashboard via SSH tunnel:
+
+```bash
+ssh -L 3000:localhost:3000 user@your-server.com
+# Then open http://localhost:3000 in your browser
+```
+
+### 4. Regular Updates
+
+```bash
+# Update system packages
+sudo apt update && sudo apt upgrade -y
+
+# Update 9Router
+cd /path/to/9router/app
+git pull
+npm install
+npm run build
+pm2 restart 9router
+```
+
+### 5. Backup Strategy
+
+```bash
+# Backup data directory
+tar -czf 9router-backup-$(date +%Y%m%d).tar.gz /var/lib/9router
+
+# Automated daily backup (add to crontab)
+0 2 * * * tar -czf /backups/9router-$(date +\%Y\%m\%d).tar.gz /var/lib/9router
+```
+
+---
+
+## 📊 Monitoring
+
+### Check Application Status
+
+```bash
+# PM2 status
+pm2 status
+
+# View logs
+pm2 logs 9router --lines 100
+
+# Monitor resources
+pm2 monit
+```
+
+### Nginx Logs
+
+```bash
+# Access logs
+sudo tail -f /var/log/nginx/access.log
+
+# Error logs
+sudo tail -f /var/log/nginx/error.log
+```
+
+### System Resources
+
+```bash
+# CPU and memory usage
+htop
+
+# Disk usage
+df -h
+
+# Network connections
+netstat -tulpn | grep -E '3000|20128'
+```
+
+---
+
+## 🚨 Troubleshooting
+
+### Application Won't Start
+
+```bash
+# Check logs
+pm2 logs 9router
+
+# Check if ports are in use
+sudo lsof -i :3000
+sudo lsof -i :20128
+
+# Check environment variables
+pm2 env 9router
+```
+
+### Nginx 502 Bad Gateway
+
+```bash
+# Check if 9Router is running
+pm2 status
+
+# Check Nginx error logs
+sudo tail -f /var/log/nginx/error.log
+
+# Test Nginx configuration
+sudo nginx -t
+```
+
+### SSE Streaming Not Working
+
+Ensure `proxy_buffering off` is set in Nginx configuration for SSE support.
+
+### Permission Denied Errors
+
+```bash
+# Fix data directory permissions
+sudo chown -R $USER:$USER /var/lib/9router
+chmod 755 /var/lib/9router
+```
+
+---
+
+## 🔗 Next Steps
+
+- [Connect Providers](/providers/subscription.md)
+- [Setup Combos](/features/combos.md)
+- [Integrate with Tools](/integration/cursor.md)
diff --git a/gitbook/content/en/deployment/localhost.md b/gitbook/content/en/deployment/localhost.md
new file mode 100644
index 0000000..cf2db78
--- /dev/null
+++ b/gitbook/content/en/deployment/localhost.md
@@ -0,0 +1,164 @@
+# 🏠 Localhost Deployment
+
+Run 9Router on your local machine for development and personal use.
+
+---
+
+## 📦 Installation
+
+Install 9Router globally via npm:
+
+```bash
+npm install -g 9router
+```
+
+**Requirements:**
+- Node.js 20 or higher
+- npm 9 or higher
+
+---
+
+## 🚀 Starting the Server
+
+Start 9Router with a single command:
+
+```bash
+9router
+```
+
+The dashboard will automatically open in your browser at `http://localhost:3000`
+
+**Default Configuration:**
+- **Dashboard**: `http://localhost:3000`
+- **API Endpoint**: `http://localhost:20128/v1`
+- **Data Directory**: `~/.9router`
+
+---
+
+## 🔧 Configuration
+
+### Custom Data Directory
+
+Set a custom data directory using environment variable:
+
+```bash
+DATA_DIR=/path/to/data 9router
+```
+
+### Custom Port
+
+The API port (20128) and dashboard port (3000) are configured in the application. To change them, you'll need to modify the source code or use environment variables if supported.
+
+---
+
+## 🛑 Stopping the Server
+
+Press `Ctrl+C` in the terminal where 9Router is running.
+
+```bash
+# In the terminal running 9router
+^C # Press Ctrl+C
+```
+
+The server will gracefully shut down and save all data.
+
+---
+
+## 🔄 Restarting the Server
+
+Simply run the start command again:
+
+```bash
+9router
+```
+
+All your configurations, API keys, and combos are preserved in the data directory.
+
+---
+
+## 📊 Updating 9Router
+
+Update to the latest version:
+
+```bash
+npm update -g 9router
+```
+
+Check your current version:
+
+```bash
+npm list -g 9router
+```
+
+---
+
+## 🔍 Troubleshooting
+
+### Port Already in Use
+
+If port 20128 or 3000 is already in use:
+
+```bash
+# Find process using the port (macOS/Linux)
+lsof -i :20128
+lsof -i :3000
+
+# Kill the process
+kill -9
+```
+
+### Permission Errors
+
+If you encounter permission errors during installation:
+
+```bash
+# Use sudo (not recommended)
+sudo npm install -g 9router
+
+# Or fix npm permissions (recommended)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+```
+
+### Data Directory Issues
+
+If the data directory is not accessible:
+
+```bash
+# Check permissions
+ls -la ~/.9router
+
+# Fix permissions
+chmod 755 ~/.9router
+```
+
+---
+
+## 📁 Data Directory Structure
+
+```
+~/.9router/
+├── db.json # Main database (providers, combos, settings)
+├── logs/ # Application logs
+└── cache/ # Temporary cache files
+```
+
+**Backup Your Data:**
+
+```bash
+# Backup
+cp -r ~/.9router ~/.9router.backup
+
+# Restore
+cp -r ~/.9router.backup ~/.9router
+```
+
+---
+
+## 🔗 Next Steps
+
+- [Connect Providers](/providers/subscription.md)
+- [Create Combos](/features/combos.md)
+- [Integrate with CLI Tools](/integration/cursor.md)
diff --git a/gitbook/content/en/faq.md b/gitbook/content/en/faq.md
new file mode 100644
index 0000000..cc8f5a1
--- /dev/null
+++ b/gitbook/content/en/faq.md
@@ -0,0 +1,387 @@
+# Frequently Asked Questions
+
+Common questions about 9Router.
+
+---
+
+## What is 9Router?
+
+**9Router is an AI model router that maximizes your subscription value and minimizes costs.**
+
+It intelligently routes requests across multiple AI providers using a 3-tier fallback system:
+1. **Subscription tier** - Maximize Claude Code, Codex, Gemini quotas you already pay for
+2. **Cheap tier** - Ultra-cheap alternatives ($0.20-$0.60 per 1M tokens)
+3. **Free tier** - Emergency backup with unlimited free models
+
+**Key benefits:**
+- Never waste subscription quota
+- Automatic fallback when quota exhausted
+- Real-time quota tracking
+- 90% cost savings vs direct API usage
+
+---
+
+## How does pricing work?
+
+**9Router uses a 3-tier pricing strategy:**
+
+### Tier 1: Subscription (Maximize First)
+- **Claude Code** (Pro/Max): $20-100/month - 5-hour + weekly quota
+- **OpenAI Codex** (Plus/Pro): $20-200/month - 5-hour + weekly quota
+- **Gemini CLI**: FREE - 180K completions/month + 1K/day
+- **GitHub Copilot**: $10-19/month - Monthly reset
+- **Antigravity**: FREE - Similar to Gemini
+
+**Goal:** Use every bit of quota before it resets!
+
+### Tier 2: Cheap (Backup)
+- **GLM-4.7**: $0.60/$2.20 per 1M tokens - Daily reset 10AM
+- **MiniMax M2.1**: $0.20/$1.00 per 1M tokens - 5-hour rolling
+- **Kimi K2**: $9/month flat (10M tokens)
+
+**Goal:** 90% cheaper than ChatGPT API ($20/1M)!
+
+### Tier 3: Free (Emergency)
+- **iFlow**: 8 models FREE (Kimi K2, Qwen3, GLM, MiniMax...)
+- **Qwen**: 3 models FREE (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro**: 2 models FREE (Claude Sonnet 4.5, Haiku 4.5)
+
+**Goal:** Zero cost fallback when everything else is quota-limited!
+
+---
+
+## Is 9Router free?
+
+**Yes, 9Router itself is 100% free and open source.**
+
+**Free tier providers available:**
+- **Gemini CLI** - 180K completions/month (FREE Google account)
+- **iFlow** - 8 models unlimited (FREE OAuth)
+- **Qwen** - 3 models unlimited (FREE OAuth)
+- **Kiro** - Claude Sonnet/Haiku (FREE AWS Builder ID)
+
+**You can code for FREE forever using only free tier providers!**
+
+**Optional paid providers:**
+- Subscription services you may already have (Claude Code, Codex, Copilot)
+- Ultra-cheap alternatives ($0.20-$0.60 per 1M tokens)
+
+---
+
+## Which providers are supported?
+
+### Subscription Providers
+- **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex, GPT 5.1 Codex Max
+- **Gemini CLI** (FREE) - Gemini 3 Flash/Pro, 2.5 Pro/Flash
+- **GitHub Copilot** - GPT-5, Claude 4.5, Gemini 3
+- **Antigravity** (Google) - Gemini 3 Pro, Claude Sonnet 4.5
+
+### Cheap Providers
+- **GLM** (Zhipu AI) - GLM 4.7, GLM 4.6V Vision
+- **MiniMax** - MiniMax M2.1
+- **Kimi** (Moonshot AI) - Kimi Latest
+- **OpenRouter** - Passthrough to any OpenRouter model
+
+### Free Providers
+- **iFlow** - 8 models (Kimi K2, Qwen3, GLM, MiniMax, DeepSeek...)
+- **Qwen** - 3 models (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro** - 2 models (Claude Sonnet 4.5, Haiku 4.5)
+
+**Total: 15+ providers, 50+ models**
+
+See [providers documentation](providers/subscription.md) for details.
+
+---
+
+## Can I use multiple providers?
+
+**Yes! This is 9Router's core feature.**
+
+**Combos allow you to chain multiple providers with automatic fallback:**
+
+```
+Example combo: "premium-coding"
+1. cc/claude-opus-4-5 (Subscription primary)
+2. glm/glm-4.7 (Cheap backup)
+3. if/kimi-k2 (Free emergency)
+
+→ Auto-switches when quota exhausted
+→ Never stops coding
+→ Minimal extra cost
+```
+
+**How to create combos:**
+```
+Dashboard → Combos → Create New
+→ Add models in priority order
+→ Use combo name in CLI: "premium-coding"
+```
+
+**Benefits:**
+- Zero downtime when quota runs out
+- Automatic cost optimization
+- Single model name for all tools
+
+See [combos documentation](features/combos.md) for examples.
+
+---
+
+## How does quota tracking work?
+
+**9Router tracks quota in real-time for all providers:**
+
+**Features:**
+- **Token consumption** - Input/output tokens per request
+- **Reset countdown** - Time until quota refreshes
+- **Usage stats** - Daily/weekly/monthly reports
+- **Cost estimation** - Projected spending (paid tiers)
+- **Quota alerts** - Notifications when quota low
+
+**Quota types:**
+- **5-hour rolling** - Claude Code, Codex, MiniMax
+- **Daily reset** - Gemini CLI (1K/day), GLM (10AM)
+- **Weekly reset** - Claude Code, Codex (additional quota)
+- **Monthly reset** - Gemini CLI (180K), GitHub Copilot (1st)
+
+**View quota:**
+```
+Dashboard → Providers → Quota Tracking
+→ Real-time usage + reset countdown
+```
+
+See [quota tracking documentation](features/quota-tracking.md) for details.
+
+---
+
+## Does 9Router work with Cursor?
+
+**Yes, but Cursor requires a cloud endpoint.**
+
+**Problem:** Cursor IDE doesn't support localhost endpoints.
+
+**Solution:** Use 9Router cloud deployment:
+
+```
+Cursor Settings → Models → Advanced:
+ OpenAI API Base URL: https://9router.com/v1
+ OpenAI API Key: [from dashboard]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+**Alternative:** Self-host on VPS with public domain:
+```bash
+# Deploy to VPS
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+npm start
+
+# Configure Nginx reverse proxy
+# Point Cursor to: https://your-domain.com/v1
+```
+
+**Other CLI tools work with localhost:**
+- Cline ✅
+- Claude Desktop ✅
+- Codex CLI ✅
+- Continue ✅
+- RooCode ✅
+
+See [Cursor integration guide](integration/cursor.md) for details.
+
+---
+
+## Can I self-host 9Router?
+
+**Yes! 9Router supports multiple deployment options:**
+
+### Localhost (Default)
+```bash
+npm install -g 9router
+9router
+→ Dashboard: http://localhost:3000
+→ API: http://localhost:20128/v1
+```
+
+### VPS/Cloud
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+npm start
+```
+
+### Docker
+```bash
+docker build -t 9router .
+docker run -d \
+ -p 3000:3000 \
+ -e JWT_SECRET="your-secret" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Cloudflare Workers
+```bash
+cd 9router/app
+npm run deploy:cloudflare
+```
+
+**Environment variables:**
+- `JWT_SECRET` - **MUST change in production!**
+- `DATA_DIR` - Database storage path (default: `~/.9router`)
+- `INITIAL_PASSWORD` - Dashboard login (default: `123456`)
+- `NODE_ENV` - Set to `production` for deploy
+
+See [deployment guide](getting-started/installation.md#deployment) for details.
+
+---
+
+## Is my data secure?
+
+**Yes, 9Router prioritizes security and privacy:**
+
+**Local storage:**
+- All data stored locally in `~/.9router` (or custom `DATA_DIR`)
+- No data sent to 9Router servers
+- OAuth tokens encrypted with JWT
+
+**No telemetry:**
+- No usage tracking
+- No analytics
+- No phone-home
+
+**Open source:**
+- Full source code available on GitHub
+- Audit security yourself
+- Community-reviewed
+
+**Best practices:**
+- Change `JWT_SECRET` in production
+- Use strong `INITIAL_PASSWORD`
+- Enable HTTPS for cloud deployments
+- Rotate API keys regularly
+
+**What 9Router stores:**
+- Provider OAuth tokens (encrypted)
+- API keys (encrypted)
+- Usage statistics (local only)
+- Combo configurations
+
+**What 9Router does NOT store:**
+- Your prompts or responses
+- Code you generate
+- Personal information
+
+---
+
+## How do I update 9Router?
+
+**Update methods depend on installation type:**
+
+### Global NPM Install
+```bash
+npm update -g 9router
+```
+
+### Local Install
+```bash
+cd 9router/app
+git pull origin main
+npm install
+npm run build
+npm start
+```
+
+### Docker
+```bash
+docker pull 9router:latest
+docker stop 9router
+docker rm 9router
+docker run -d \
+ -p 3000:3000 \
+ -v 9router-data:/app/data \
+ 9router:latest
+```
+
+**Check version:**
+```bash
+9router --version
+```
+
+**Breaking changes:**
+- Check [CHANGELOG.md](https://github.com/decolua/9router/blob/main/CHANGELOG.md)
+- Backup `~/.9router` before major updates
+- Review migration guides for major versions
+
+---
+
+## How can I contribute?
+
+**We welcome contributions!**
+
+### Ways to contribute:
+
+1. **Report bugs:**
+ - [GitHub Issues](https://github.com/decolua/9router/issues)
+ - Include error logs, steps to reproduce
+
+2. **Request features:**
+ - [GitHub Discussions](https://github.com/decolua/9router/discussions)
+ - Describe use case and benefits
+
+3. **Submit code:**
+ ```bash
+ # Fork repo
+ git clone https://github.com/YOUR_USERNAME/9router.git
+ cd 9router
+
+ # Create branch
+ git checkout -b feature/your-feature
+
+ # Make changes
+ npm install
+ npm run dev
+
+ # Test
+ npm test
+
+ # Commit and push
+ git add .
+ git commit -m "Add your feature"
+ git push origin feature/your-feature
+
+ # Create Pull Request on GitHub
+ ```
+
+4. **Improve docs:**
+ - Fix typos, add examples
+ - Translate to other languages
+ - Write tutorials
+
+5. **Add providers:**
+ - Implement new provider adapters
+ - See `app/lib/providers/` for examples
+
+**Contribution guidelines:**
+- Follow existing code style
+- Add tests for new features
+- Update documentation
+- Keep commits atomic and descriptive
+
+See [CONTRIBUTING.md](https://github.com/decolua/9router/blob/main/CONTRIBUTING.md) for details.
+
+---
+
+## Need More Help?
+
+- **Documentation:** [9router.com/docs](https://9router.com/docs)
+- **GitHub:** [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **Troubleshooting:** [troubleshooting.md](troubleshooting.md)
diff --git a/gitbook/content/en/features/combos.md b/gitbook/content/en/features/combos.md
new file mode 100644
index 0000000..2b94eff
--- /dev/null
+++ b/gitbook/content/en/features/combos.md
@@ -0,0 +1,537 @@
+# Combos - Custom Fallback Chains
+
+Create custom model combinations with automatic fallback. Combos let you define your own routing strategy based on cost, quality, and availability.
+
+---
+
+## What Are Combos?
+
+Combos are **custom fallback chains** that you create in the dashboard. Instead of using a single model, you define a sequence of models that 9Router tries in order.
+
+**Example:**
+```
+Combo name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101 (try first)
+ 2. glm/glm-4.7 (if #1 quota exhausted)
+ 3. minimax/MiniMax-M2.1 (if #2 quota exhausted)
+```
+
+**Usage in CLI:**
+```
+Model: premium-coding
+```
+
+9Router automatically tries each model in sequence until one succeeds.
+
+---
+
+## Why Use Combos?
+
+### 1. Maximize Subscription Value
+```
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ Use subscription first, cheap backup, free emergency
+→ Get full value from subscriptions you already pay for
+```
+
+### 2. Minimize Costs
+```
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+
+→ Start with cheapest paid option ($0.60/1M)
+→ Fallback to even cheaper ($0.20/1M)
+→ Emergency free tier
+→ Total cost: ~$5-10/month vs $2000 on ChatGPT API
+```
+
+### 3. Ensure 24/7 Availability
+```
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ Always include free tier at the end
+→ Never run out of quota
+→ Code anytime, anywhere
+```
+
+### 4. Optimize for Quality
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → gc/gemini-3-pro
+
+→ Best models first
+→ Fallback to other premium models
+→ Maintain high quality across fallback chain
+```
+
+---
+
+## How to Create Combos
+
+### Step 1: Open Dashboard
+
+```
+http://localhost:20128
+→ Login with your password
+```
+
+### Step 2: Navigate to Combos
+
+```
+Dashboard → Combos → Create New Combo
+```
+
+### Step 3: Configure Combo
+
+**Combo Name:**
+```
+premium-coding
+```
+
+**Description (optional):**
+```
+Subscription first, cheap backup, free emergency
+```
+
+**Select Models:**
+```
+1. cc/claude-opus-4-5-20251101
+2. glm/glm-4.7
+3. minimax/MiniMax-M2.1
+```
+
+**Drag to reorder** - Priority from top to bottom.
+
+### Step 4: Save
+
+```
+Click "Save Combo"
+→ Combo appears in model list
+```
+
+### Step 5: Use in CLI
+
+```
+Cursor/Cline/Any tool:
+ Model: premium-coding
+```
+
+---
+
+## Example Combos
+
+### Example 1: Premium Coding (Subscription → Cheap → Free)
+
+**Goal**: Maximize subscription value, minimize extra costs.
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. glm/glm-4.7
+ 3. minimax/MiniMax-M2.1
+```
+
+**Usage:**
+```
+Cursor IDE:
+ Model: premium-coding
+```
+
+**Behavior:**
+```
+Morning (fresh quota):
+ Request → cc/claude-opus-4-5 ✅
+
+Afternoon (Claude quota out):
+ Request → glm/glm-4.7 ✅ (auto switched)
+
+Evening (GLM quota out):
+ Request → minimax/MiniMax-M2.1 ✅ (auto switched)
+```
+
+**Monthly cost (100M tokens):**
+```
+80M via Claude Code: $0 (subscription)
+15M via GLM: $9
+5M via MiniMax: $1
+Total: $10 + your subscription
+```
+
+**Savings**: ~99% vs ChatGPT API ($2000).
+
+---
+
+### Example 2: Budget Combo (Cheap → Free)
+
+**Goal**: Minimize costs, use free tier as backup.
+
+```
+Dashboard → Combos → Create New
+
+Name: budget-combo
+Models:
+ 1. glm/glm-4.7
+ 2. minimax/MiniMax-M2.1
+ 3. if/kimi-k2-thinking
+```
+
+**Usage:**
+```
+Cline:
+ Provider: OpenAI Compatible
+ Base URL: http://localhost:20128/v1
+ Model: budget-combo
+```
+
+**Behavior:**
+```
+Request → glm/glm-4.7
+ ✅ Daily quota available → Use GLM ($0.60/1M)
+ ❌ Quota exhausted → Try MiniMax ($0.20/1M)
+ ❌ MiniMax quota out → Use iFlow (FREE)
+```
+
+**Monthly cost (100M tokens):**
+```
+70M via GLM: $42
+20M via MiniMax: $4
+10M via iFlow: $0
+Total: $46 vs $2000 on ChatGPT API
+```
+
+**Savings**: 97%.
+
+---
+
+### Example 3: Free Combo (Zero Cost)
+
+**Goal**: 100% free, no costs ever.
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking
+ 2. qw/qwen3-coder-plus
+ 3. kr/claude-sonnet-4.5
+```
+
+**Usage:**
+```
+Claude Desktop:
+ Model: free-combo
+```
+
+**Behavior:**
+```
+Request → if/kimi-k2-thinking
+ ✅ Available → Use iFlow
+ ❌ Error → Try Qwen
+ ❌ Error → Try Kiro
+```
+
+**Monthly cost:**
+```
+100M tokens via free providers: $0
+Total: $0 forever
+```
+
+**Use case**: Personal projects, learning, experimentation.
+
+---
+
+### Example 4: Quality First (Premium Models Only)
+
+**Goal**: Best quality, no cheap fallback.
+
+```
+Dashboard → Combos → Create New
+
+Name: quality-first
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. cx/gpt-5.2-codex
+ 3. gc/gemini-3-pro-preview
+```
+
+**Usage:**
+```
+Codex CLI:
+ export OPENAI_BASE_URL="http://localhost:20128"
+ Model: quality-first
+```
+
+**Behavior:**
+```
+Request → cc/claude-opus-4-5
+ ❌ Quota out → cx/gpt-5.2-codex
+ ❌ Quota out → gc/gemini-3-pro-preview
+ ❌ All out → Return error (no cheap fallback)
+```
+
+**Use case**: Critical production code, complex refactoring.
+
+---
+
+### Example 5: Multi-Subscription (Maximize All)
+
+**Goal**: Use all subscriptions before paying extra.
+
+```
+Dashboard → Combos → Create New
+
+Name: multi-sub
+Models:
+ 1. gc/gemini-3-flash-preview (FREE 180K/month)
+ 2. cc/claude-opus-4-5-20251101 (Pro subscription)
+ 3. cx/gpt-5.2-codex (Plus subscription)
+ 4. gh/gpt-5 (Copilot subscription)
+ 5. glm/glm-4.7 (Cheap backup)
+ 6. if/kimi-k2-thinking (Free emergency)
+```
+
+**Monthly cost (200M tokens):**
+```
+50M via Gemini CLI: $0 (free tier)
+80M via Claude Code: $0 (subscription)
+40M via Codex: $0 (subscription)
+20M via Copilot: $0 (subscription)
+8M via GLM: $4.80
+2M via iFlow: $0
+Total: $4.80 + existing subscriptions
+```
+
+**Result**: Use 190M tokens from subscriptions, only $4.80 extra.
+
+---
+
+### Example 6: Quota Reset Optimization
+
+**Goal**: Distribute usage based on reset times.
+
+```
+Dashboard → Combos → Create New
+
+Name: reset-optimized
+Models:
+ 1. cc/claude-opus-4-5 (5h reset, use morning)
+ 2. gc/gemini-3-flash (1K/day, use afternoon)
+ 3. glm/glm-4.7 (daily 10AM reset, use evening)
+ 4. minimax/MiniMax-M2.1 (5h rolling, use night)
+ 5. if/kimi-k2-thinking (unlimited, emergency)
+```
+
+**Daily routine:**
+```
+08:00 - 13:00: Claude Code (fresh 5h quota)
+13:00 - 18:00: Gemini CLI (1K/day quota)
+18:00 - 22:00: GLM (resets 10AM next day)
+22:00 - 08:00: MiniMax (5h rolling) or iFlow
+```
+
+**Result**: Code 24/7 with minimal costs.
+
+---
+
+## Use Combos in CLI Tools
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from dashboard]
+ Model: premium-coding
+```
+
+### Claude Desktop
+
+Edit `~/.claude/config.json`:
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key",
+ "model": "budget-combo"
+}
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex --model quality-first "your prompt"
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [from dashboard]
+Model: free-combo
+```
+
+### API Request
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "premium-coding",
+ "messages": [
+ {"role": "user", "content": "Write a function to..."}
+ ],
+ "stream": true
+ }'
+```
+
+---
+
+## Best Practices
+
+### 1. Always Include Free Tier
+
+```
+✅ Good:
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+❌ Bad:
+cc/claude-opus → glm/glm-4.7
+(no free fallback, can run out of quota)
+```
+
+**Why**: Ensures 24/7 availability, never blocked by quota.
+
+### 2. Order by Cost (Cheap to Expensive)
+
+```
+✅ Good:
+glm/glm-4.7 → minimax/MiniMax-M2.1 → cc/claude-opus
+
+❌ Bad:
+cc/claude-opus → glm/glm-4.7
+(wastes subscription quota on simple tasks)
+```
+
+**Exception**: If you want to maximize subscription value, put subscription first.
+
+### 3. Match Quality Requirements
+
+```
+For production code:
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7
+
+For quick tasks:
+glm/glm-4.7 → if/kimi-k2-thinking
+
+For experimentation:
+if/kimi-k2-thinking → qw/qwen3-coder-plus
+```
+
+### 4. Consider Quota Reset Times
+
+```
+Morning combo (fresh quotas):
+cc/claude-opus → cx/gpt-5.2-codex
+
+Evening combo (quotas likely exhausted):
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+### 5. Create Multiple Combos for Different Use Cases
+
+```
+premium-coding: For complex tasks
+budget-combo: For simple tasks
+free-combo: For experimentation
+quality-first: For production code
+```
+
+**Switch between combos** based on task requirements.
+
+### 6. Monitor Combo Performance
+
+```
+Dashboard → Analytics → Combo Usage:
+ premium-coding:
+ 80% via cc/claude-opus (good, using subscription)
+ 15% via glm/glm-4.7 (acceptable backup)
+ 5% via minimax (rare fallback)
+```
+
+**Optimize**: If too much fallback usage, increase primary quota or reorder models.
+
+---
+
+## Advanced Configuration
+
+### Set Budget Limits per Combo
+
+```
+Dashboard → Combos → Edit → Budget:
+ Daily limit: $5
+ Monthly limit: $50
+```
+
+When limit reached, 9Router skips paid models and uses free tier only.
+
+### Enable/Disable Models in Combo
+
+```
+Dashboard → Combos → Edit → Models:
+ ✅ cc/claude-opus-4-5 (enabled)
+ ❌ glm/glm-4.7 (temporarily disabled)
+ ✅ if/kimi-k2-thinking (enabled)
+```
+
+**Use case**: Temporarily disable expensive models without deleting combo.
+
+### Clone Existing Combo
+
+```
+Dashboard → Combos → Clone "premium-coding"
+→ Creates copy with "-copy" suffix
+→ Modify and save as new combo
+```
+
+**Use case**: Create variations for different scenarios.
+
+---
+
+## Troubleshooting
+
+**Issue: Combo not appearing in model list**
+
+**Solution:**
+1. Refresh dashboard
+2. Check combo is saved (green checkmark)
+3. Restart CLI tool to refresh model list
+
+**Issue: Combo always uses last model (free tier)**
+
+**Solution:**
+1. Check quota for primary models (Dashboard → Quota)
+2. Verify API keys are valid (Dashboard → Providers)
+3. Check budget limits not exceeded
+
+**Issue: Combo costs more than expected**
+
+**Solution:**
+1. Dashboard → Analytics → Review combo usage
+2. Check if primary models are quota-exhausted
+3. Reorder models (put cheaper first)
+4. Set budget limits
+
+---
+
+## Related
+
+- [Smart Routing](./smart-routing.md) - How auto fallback works
+- [Quota Tracking](./quota-tracking.md) - Monitor usage and costs
diff --git a/gitbook/content/en/features/quota-tracking.md b/gitbook/content/en/features/quota-tracking.md
new file mode 100644
index 0000000..9246807
--- /dev/null
+++ b/gitbook/content/en/features/quota-tracking.md
@@ -0,0 +1,687 @@
+# Quota Tracking & Usage Monitoring
+
+Track real-time token consumption, monitor quota limits, estimate costs, and get alerts before running out. Never waste subscription quota or exceed budget limits.
+
+---
+
+## Overview
+
+9Router provides comprehensive quota tracking for all providers:
+
+- **Real-time token consumption** - See tokens used per request
+- **Quota limits & remaining** - Track usage vs limits
+- **Reset countdown** - Know when quota refreshes
+- **Cost estimation** - Calculate spending for paid tiers
+- **Monthly reports** - Analyze usage patterns
+- **Alerts & notifications** - Get warned before limits
+
+---
+
+## Dashboard Overview
+
+### Quota Summary
+
+```
+Dashboard → Home → Quota Overview
+
+┌─────────────────────────────────────────────┐
+│ Claude Code (cc/) │
+│ ████████████░░░░░░░░ 2.5h / 5h (50%) │
+│ Resets in: 2h 30m │
+│ Cost: $0 (subscription) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ Gemini CLI (gc/) │
+│ ████████░░░░░░░░░░░░ 450 / 1000 (45%) │
+│ Daily reset in: 18h 30m │
+│ Monthly: 45K / 180K (25%) │
+│ Cost: $0 (free tier) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ GLM-4.7 (glm/) │
+│ ██████████████░░░░░░ 7M / 10M tokens (70%) │
+│ Resets: Daily 10:00 AM (in 5h 35m) │
+│ Cost today: $4.20 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ MiniMax M2.1 (minimax/) │
+│ ████████████████░░░░ 4M / 5M tokens (80%) │
+│ Rolling 5h window │
+│ Cost (5h): $0.80 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ iFlow (if/) │
+│ ████████████████████ Unlimited │
+│ Cost: $0 (free forever) │
+└─────────────────────────────────────────────┘
+```
+
+---
+
+## Real-Time Token Consumption
+
+### Per-Request Tracking
+
+Every request shows detailed token usage:
+
+```
+Dashboard → Activity → Recent Requests
+
+Request #1234
+Model: cc/claude-opus-4-5-20251101
+Timestamp: 2026-02-04 04:15:32
+
+Tokens:
+ Input: 1,250 tokens
+ Output: 850 tokens
+ Total: 2,100 tokens
+
+Cost: $0 (subscription quota)
+Duration: 3.2s
+Status: ✅ Success
+```
+
+### Live Usage Monitor
+
+```
+Dashboard → Live Monitor
+
+Current request:
+ Model: glm/glm-4.7
+ Tokens streamed: 450 / ~800 estimated
+ Cost so far: $0.0009
+ Duration: 1.8s
+```
+
+### Token Breakdown by Model
+
+```
+Dashboard → Analytics → Token Usage
+
+Today (Feb 4, 2026):
+ cc/claude-opus-4-5: 15M tokens ($0, subscription)
+ glm/glm-4.7: 8M tokens ($4.80)
+ if/kimi-k2-thinking: 3M tokens ($0, free)
+
+Total: 26M tokens
+Cost: $4.80
+```
+
+---
+
+## Quota Limits & Reset Times
+
+### Subscription Providers
+
+**Claude Code (Pro/Max)**
+```
+Quota type: Time-based (5-hour rolling)
+Limit: 5 hours of usage
+Reset: Rolling 5-hour window + Weekly refresh
+Tracking: Usage time per model
+
+Dashboard shows:
+ Opus: 2.5h / 5h used
+ Sonnet: 1.2h / 5h used
+ Haiku: 0.8h / 5h used
+
+Weekly reset: Every Monday 00:00 UTC
+```
+
+**OpenAI Codex (Plus/Pro)**
+```
+Quota type: Time-based (5-hour rolling)
+Limit: 5 hours (Plus) / 10 hours (Pro)
+Reset: Rolling 5-hour window + Weekly refresh
+
+Dashboard shows:
+ GPT-5.2 Codex: 3.5h / 5h used
+ Resets in: 1h 30m
+```
+
+**Gemini CLI (FREE)**
+```
+Quota type: Request count + Monthly tokens
+Daily limit: 1,000 requests
+Monthly limit: 180,000 completions
+Reset: Daily 00:00 UTC + Monthly 1st
+
+Dashboard shows:
+ Today: 450 / 1,000 requests (45%)
+ This month: 45K / 180K completions (25%)
+ Daily reset in: 18h 30m
+ Monthly reset in: 26 days
+```
+
+**GitHub Copilot**
+```
+Quota type: Monthly usage
+Limit: Varies by plan
+Reset: 1st of each month
+
+Dashboard shows:
+ Usage: 60% of monthly quota
+ Resets: March 1, 2026 (in 25 days)
+```
+
+### Cheap Providers
+
+**GLM-4.7**
+```
+Quota type: Daily token limit
+Limit: 10M tokens/day (Coding Plan)
+Reset: Daily 10:00 AM Beijing Time (UTC+8)
+
+Dashboard shows:
+ Used: 7M / 10M tokens (70%)
+ Remaining: 3M tokens
+ Resets in: 5h 35m
+ Cost today: $4.20
+```
+
+**MiniMax M2.1**
+```
+Quota type: Rolling 5-hour window
+Limit: 5M tokens per 5 hours
+Reset: Continuous rolling window
+
+Dashboard shows:
+ Used (5h): 4M / 5M tokens (80%)
+ Oldest usage expires in: 45m
+ Cost (5h): $0.80
+```
+
+**Kimi K2**
+```
+Quota type: Monthly subscription
+Limit: 10M tokens/month ($9 flat)
+Reset: Monthly on subscription date
+
+Dashboard shows:
+ Used: 6M / 10M tokens (60%)
+ Resets: Feb 15, 2026 (in 11 days)
+ Cost: $9/month (prepaid)
+```
+
+### Free Providers
+
+**iFlow / Qwen / Kiro**
+```
+Quota type: Unlimited (rate-limited)
+Limit: No hard limit
+Reset: N/A
+
+Dashboard shows:
+ Used today: 5M tokens
+ Cost: $0 (free forever)
+ Status: ✅ Available
+```
+
+---
+
+## Cost Estimation
+
+### Real-Time Cost Tracking
+
+```
+Dashboard → Costs → Today
+
+Subscription providers: $0
+ Claude Code: 15M tokens ($0, included)
+ Gemini CLI: 3M tokens ($0, free tier)
+
+Paid providers: $4.80
+ GLM-4.7: 8M tokens ($4.80)
+ Input: 6M × $0.60/1M = $3.60
+ Output: 2M × $2.20/1M = $4.40
+ Total: $4.80
+
+Free providers: $0
+ iFlow: 3M tokens ($0)
+
+Total today: $4.80
+```
+
+### Monthly Spending Report
+
+```
+Dashboard → Costs → This Month (February 2026)
+
+Week 1 (Feb 1-7):
+ Subscription: $0 (80M tokens)
+ Paid: $15.20 (25M tokens)
+ Free: $0 (10M tokens)
+ Total: $15.20
+
+Week 2 (Feb 8-14):
+ Subscription: $0 (75M tokens)
+ Paid: $12.80 (20M tokens)
+ Free: $0 (8M tokens)
+ Total: $12.80
+
+Month to date: $28.00
+Projected (30 days): ~$120
+
+Breakdown by provider:
+ GLM-4.7: $22.00 (78%)
+ MiniMax M2.1: $6.00 (22%)
+
+Average cost per 1M tokens: $0.62
+Savings vs ChatGPT API: 97% ($4,000 → $120)
+```
+
+### Cost Projection
+
+```
+Dashboard → Costs → Projections
+
+Based on last 7 days usage:
+ Daily average: 50M tokens
+ Daily cost: $4.50
+
+Monthly projection:
+ Tokens: 1,500M (1.5B)
+ Cost: $135
+
+Breakdown:
+ Subscription: 900M tokens ($0)
+ GLM-4.7: 450M tokens ($90)
+ MiniMax: 120M tokens ($24)
+ Free: 30M tokens ($0)
+
+Budget status:
+ Daily limit: $5 → 90% used today
+ Monthly limit: $150 → 90% projected
+ ⚠️ Warning: May exceed monthly budget
+```
+
+---
+
+## Usage Dashboard
+
+### Overview Stats
+
+```
+Dashboard → Analytics → Overview
+
+Today (Feb 4, 2026):
+ Requests: 1,234
+ Tokens: 26M
+ Cost: $4.80
+ Avg response time: 2.1s
+
+This week:
+ Requests: 8,456
+ Tokens: 180M
+ Cost: $28.00
+ Success rate: 99.2%
+
+This month:
+ Requests: 15,234
+ Tokens: 320M
+ Cost: $52.00
+ Top model: cc/claude-opus-4-5 (45%)
+```
+
+### Usage by Model
+
+```
+Dashboard → Analytics → Models
+
+Top models (this month):
+1. cc/claude-opus-4-5: 145M tokens (45%)
+2. glm/glm-4.7: 95M tokens (30%)
+3. if/kimi-k2-thinking: 50M tokens (16%)
+4. minimax/MiniMax-M2.1: 20M tokens (6%)
+5. gc/gemini-3-flash: 10M tokens (3%)
+
+Cost breakdown:
+ cc/claude-opus: $0 (subscription)
+ glm/glm-4.7: $45.00
+ if/kimi-k2-thinking: $0 (free)
+ minimax/MiniMax-M2.1: $7.00
+ gc/gemini-3-flash: $0 (free)
+```
+
+### Usage by Time
+
+```
+Dashboard → Analytics → Timeline
+
+Hourly usage (today):
+00:00 - 01:00: 0.5M tokens
+01:00 - 02:00: 0.2M tokens
+...
+08:00 - 09:00: 3.2M tokens (peak)
+09:00 - 10:00: 2.8M tokens
+...
+23:00 - 00:00: 0.8M tokens
+
+Peak hours: 08:00 - 12:00 (morning coding)
+Low hours: 00:00 - 06:00 (night)
+```
+
+### Usage by Combo
+
+```
+Dashboard → Analytics → Combos
+
+premium-coding:
+ Requests: 456
+ Tokens: 12M
+ Cost: $2.40
+
+ Breakdown:
+ cc/claude-opus: 8M tokens (67%, $0)
+ glm/glm-4.7: 3M tokens (25%, $1.80)
+ minimax/MiniMax-M2.1: 1M tokens (8%, $0.20)
+
+budget-combo:
+ Requests: 234
+ Tokens: 6M
+ Cost: $1.20
+
+ Breakdown:
+ glm/glm-4.7: 4M tokens (67%, $2.40)
+ if/kimi-k2-thinking: 2M tokens (33%, $0)
+```
+
+---
+
+## Alerts & Notifications
+
+### Quota Alerts
+
+```
+Dashboard → Settings → Alerts
+
+Quota warnings:
+ ✅ Alert at 80% quota used
+ ✅ Alert at 90% quota used
+ ✅ Alert when quota exhausted
+ ✅ Notify when quota resets
+
+Delivery:
+ ✅ Dashboard notification
+ ✅ Email (optional)
+ ✅ Webhook (optional)
+```
+
+**Example notifications:**
+```
+⚠️ Claude Code quota 80% used
+ 2.5h remaining (resets in 1h 30m)
+
+⚠️ GLM-4.7 quota 90% used
+ 1M tokens remaining (resets in 5h)
+
+✅ Gemini CLI quota reset
+ 1,000 requests available (daily limit)
+```
+
+### Budget Alerts
+
+```
+Dashboard → Settings → Budget Alerts
+
+Daily budget: $5
+ ✅ Alert at 80% ($4)
+ ✅ Alert at 100% ($5)
+ ✅ Auto-switch to free tier when exceeded
+
+Monthly budget: $150
+ ✅ Alert at 50% ($75)
+ ✅ Alert at 80% ($120)
+ ✅ Alert at 100% ($150)
+```
+
+**Example notifications:**
+```
+⚠️ Daily budget 80% used
+ $4.00 / $5.00 spent today
+
+⚠️ Monthly budget 50% reached
+ $75 / $150 spent this month
+ Projected: $135 (within budget)
+
+🚨 Daily budget exceeded
+ $5.20 / $5.00 spent today
+ Auto-switched to free tier
+```
+
+### Cost Anomaly Detection
+
+```
+Dashboard → Settings → Anomaly Detection
+
+✅ Detect unusual spending patterns
+✅ Alert on cost spikes (>2× daily average)
+✅ Warn on quota exhaustion patterns
+
+Example alert:
+⚠️ Cost spike detected
+ Today: $12.50 (2.5× daily average)
+ Reason: High GLM-4.7 usage (20M tokens)
+ Suggestion: Check if primary models quota-exhausted
+```
+
+---
+
+## Best Practices
+
+### 1. Monitor Quota Daily
+
+```
+Daily routine:
+1. Check dashboard quota overview (30 seconds)
+2. Review reset times
+3. Plan usage around quota availability
+```
+
+**Example:**
+```
+Morning check:
+ ✅ Claude Code: 5h available (fresh reset)
+ ✅ Gemini CLI: 1K requests available
+ ⚠️ GLM-4.7: 2M tokens left (resets 10AM)
+
+Action: Use Claude Code for morning work
+```
+
+### 2. Set Budget Limits
+
+```
+Dashboard → Settings → Budget:
+ Daily: $5 (prevents overspending)
+ Monthly: $150 (aligns with budget)
+```
+
+**Result**: Auto-switch to free tier when limit reached.
+
+### 3. Optimize Combo Usage
+
+```
+Dashboard → Analytics → Combos:
+ Review which models are used most
+ Adjust combo order to minimize costs
+```
+
+**Example:**
+```
+Current: cc/claude-opus → glm/glm-4.7
+ 80% via Claude (good)
+ 20% via GLM ($12/month)
+
+Optimized: gc/gemini-3-flash → cc/claude-opus → glm/glm-4.7
+ 50% via Gemini (free)
+ 40% via Claude (subscription)
+ 10% via GLM ($6/month)
+
+Savings: $6/month
+```
+
+### 4. Track Reset Times
+
+```
+Dashboard → Quota → Reset Schedule:
+ Claude Code: 5h rolling + Weekly Monday
+ Gemini CLI: Daily 00:00 UTC + Monthly 1st
+ GLM-4.7: Daily 10:00 AM Beijing Time
+ MiniMax: Rolling 5h window
+```
+
+**Strategy**: Use providers when quota is fresh.
+
+### 5. Review Monthly Reports
+
+```
+Dashboard → Analytics → Monthly Report:
+ Total tokens: 1.5B
+ Total cost: $120
+ Savings: 97% vs ChatGPT API
+
+Insights:
+ - 60% usage via subscriptions ($0)
+ - 30% via GLM ($90)
+ - 10% via free tier ($0)
+
+Optimization:
+ - Increase Gemini CLI usage (free)
+ - Reduce GLM usage (expensive)
+```
+
+---
+
+## API Access
+
+### Get Quota Status
+
+```bash
+GET http://localhost:20128/api/quota
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "providers": [
+ {
+ "id": "cc",
+ "name": "Claude Code",
+ "quota": {
+ "used": 2.5,
+ "limit": 5,
+ "unit": "hours",
+ "percentage": 50
+ },
+ "reset": {
+ "type": "rolling",
+ "window": "5h",
+ "nextReset": "2026-02-04T06:45:00Z"
+ },
+ "cost": {
+ "today": 0,
+ "month": 0,
+ "currency": "USD"
+ }
+ },
+ {
+ "id": "glm",
+ "name": "GLM-4.7",
+ "quota": {
+ "used": 7000000,
+ "limit": 10000000,
+ "unit": "tokens",
+ "percentage": 70
+ },
+ "reset": {
+ "type": "daily",
+ "time": "10:00 AM UTC+8",
+ "nextReset": "2026-02-04T10:00:00+08:00"
+ },
+ "cost": {
+ "today": 4.20,
+ "month": 52.00,
+ "currency": "USD"
+ }
+ }
+ ]
+}
+```
+
+### Get Usage Stats
+
+```bash
+GET http://localhost:20128/api/usage?period=today
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "period": "today",
+ "date": "2026-02-04",
+ "summary": {
+ "requests": 1234,
+ "tokens": 26000000,
+ "cost": 4.80
+ },
+ "byModel": [
+ {
+ "model": "cc/claude-opus-4-5",
+ "requests": 456,
+ "tokens": 15000000,
+ "cost": 0
+ },
+ {
+ "model": "glm/glm-4.7",
+ "requests": 234,
+ "tokens": 8000000,
+ "cost": 4.80
+ }
+ ]
+}
+```
+
+---
+
+## Troubleshooting
+
+**Issue: Quota shows 0% but requests failing**
+
+**Solution:**
+1. Check provider connection (Dashboard → Providers)
+2. Verify API keys are valid
+3. Check if provider is down (status page)
+4. Try reconnecting OAuth providers
+
+**Issue: Cost estimation incorrect**
+
+**Solution:**
+1. Dashboard → Settings → Pricing
+2. Verify pricing per provider matches current rates
+3. Update pricing if provider changed rates
+4. Contact support if discrepancy persists
+
+**Issue: Reset time not updating**
+
+**Solution:**
+1. Refresh dashboard (F5)
+2. Check system time is correct
+3. Verify timezone settings
+4. Restart 9Router if issue persists
+
+**Issue: Alerts not received**
+
+**Solution:**
+1. Dashboard → Settings → Alerts
+2. Verify email address is correct
+3. Check spam folder
+4. Test notification (Send Test button)
+
+---
+
+## Related
+
+- [Smart Routing](./smart-routing.md) - Auto fallback based on quota
+- [Combos](./combos.md) - Create custom fallback chains
diff --git a/gitbook/content/en/features/smart-routing.md b/gitbook/content/en/features/smart-routing.md
new file mode 100644
index 0000000..a6aa0c5
--- /dev/null
+++ b/gitbook/content/en/features/smart-routing.md
@@ -0,0 +1,407 @@
+# Smart Routing & Auto Fallback
+
+9Router automatically routes your requests through the best available provider using a 3-tier fallback system. Never stop coding due to quota limits or rate limiting.
+
+---
+
+## How It Works
+
+9Router uses intelligent routing to maximize your existing subscriptions, minimize costs, and ensure 24/7 availability:
+
+```
+Request → 9Router → Check Tier 1 (Subscription)
+ ↓ quota exhausted
+ Check Tier 2 (Cheap)
+ ↓ budget limit
+ Check Tier 3 (Free)
+ ↓
+ Response
+```
+
+### 3-Tier Fallback System
+
+**Tier 1: SUBSCRIPTION (Primary)**
+- Claude Code (Pro/Max)
+- OpenAI Codex (Plus/Pro)
+- Gemini CLI (FREE 180K/month)
+- GitHub Copilot
+- Antigravity (Google)
+
+**Goal**: Maximize value from subscriptions you already pay for.
+
+**Tier 2: CHEAP (Backup)**
+- GLM-4.7 ($0.60/1M input)
+- MiniMax M2.1 ($0.20/1M input)
+- Kimi K2 ($9/month flat)
+
+**Goal**: Ultra-cheap backup when subscription quota runs out (~90% cheaper than ChatGPT API).
+
+**Tier 3: FREE (Emergency)**
+- iFlow (8 models)
+- Qwen (3 models)
+- Kiro (Claude FREE)
+
+**Goal**: Zero-cost fallback for unlimited coding.
+
+---
+
+## Automatic Switching
+
+9Router monitors quota in real-time and switches providers automatically:
+
+### Scenario 1: Subscription Quota Exhausted
+
+```
+User request → cc/claude-opus-4-5
+ ↓ quota exhausted (5-hour limit reached)
+ Auto switch → glm/glm-4.7
+ ↓ daily quota exhausted
+ Auto switch → minimax/MiniMax-M2.1
+ ↓ 5-hour quota exhausted
+ Auto switch → if/kimi-k2-thinking (FREE)
+ ↓
+ Response delivered ✅
+```
+
+**Result**: Zero downtime, seamless experience.
+
+### Scenario 2: Rate Limiting
+
+```
+User request → cx/gpt-5.2-codex
+ ↓ rate limited (too many requests)
+ Auto switch → glm/glm-4.7
+ ↓
+ Response delivered ✅
+```
+
+### Scenario 3: Provider Unavailable
+
+```
+User request → cc/claude-opus-4-5
+ ↓ provider error (503)
+ Auto switch → next available model
+ ↓
+ Response delivered ✅
+```
+
+---
+
+## Model Selection Logic
+
+9Router selects the best model based on:
+
+1. **Quota availability** - Check if provider has remaining quota
+2. **Cost tier** - Prefer subscription → cheap → free
+3. **Reset timing** - Consider when quota resets
+4. **Provider health** - Skip providers with errors
+
+### Priority Order Example
+
+For a request to `cc/claude-opus-4-5`:
+
+```
+1. Check Claude Code quota
+ ✅ Available → Use cc/claude-opus-4-5
+ ❌ Exhausted → Continue to step 2
+
+2. Check fallback tier (if configured)
+ ✅ GLM quota available → Use glm/glm-4.7
+ ❌ Exhausted → Continue to step 3
+
+3. Check free tier
+ ✅ iFlow available → Use if/kimi-k2-thinking
+ ❌ All exhausted → Return quota error
+```
+
+---
+
+## Configuration Options
+
+### Dashboard Settings
+
+**1. Enable/Disable Auto Fallback**
+
+```
+Dashboard → Settings → Smart Routing
+→ Toggle "Auto Fallback" ON/OFF
+```
+
+- **ON** (default): Automatic tier switching
+- **OFF**: Strict mode, return error if primary model unavailable
+
+**2. Set Budget Limits**
+
+```
+Dashboard → Settings → Budget Control
+→ Daily limit: $5
+→ Monthly limit: $50
+```
+
+When budget reached, 9Router automatically switches to free tier.
+
+**3. Configure Fallback Order**
+
+```
+Dashboard → Settings → Fallback Priority
+→ Drag to reorder providers within each tier
+```
+
+Example custom order:
+```
+Tier 1: Gemini CLI → Claude Code → Codex
+Tier 2: MiniMax → GLM → Kimi
+Tier 3: iFlow → Kiro → Qwen
+```
+
+**4. Quota Reset Notifications**
+
+```
+Dashboard → Settings → Notifications
+→ Email when quota resets
+→ Alert when 80% quota used
+```
+
+---
+
+## Examples
+
+### Example 1: Basic Auto Fallback
+
+**Setup:**
+```
+Model: cc/claude-opus-4-5-20251101
+Fallback: Auto (default 3-tier)
+```
+
+**Behavior:**
+```
+Morning (fresh quota):
+ Request → cc/claude-opus-4-5 ✅
+
+Afternoon (quota exhausted):
+ Request → glm/glm-4.7 ✅ (auto switched)
+
+Evening (GLM quota out):
+ Request → minimax/MiniMax-M2.1 ✅ (auto switched)
+
+Late night (all paid quota out):
+ Request → if/kimi-k2-thinking ✅ (free tier)
+```
+
+**Cost**: ~$5-10/month extra (mostly covered by subscription).
+
+### Example 2: Budget-Conscious Routing
+
+**Setup:**
+```
+Dashboard → Settings:
+ Daily budget: $2
+ Monthly budget: $20
+ Fallback: Enabled
+```
+
+**Behavior:**
+```
+Day 1-15 (within budget):
+ Requests → glm/glm-4.7 (cheap tier)
+ Cost: $1.50/day
+
+Day 16 (budget reached):
+ Requests → if/kimi-k2-thinking (free tier)
+ Cost: $0
+
+Next month (budget resets):
+ Requests → glm/glm-4.7 again
+```
+
+**Result**: Never exceed $20/month, always available.
+
+### Example 3: Subscription-Only Mode
+
+**Setup:**
+```
+Dashboard → Settings:
+ Auto Fallback: OFF
+ Strict mode: ON
+```
+
+**Behavior:**
+```
+Request → cc/claude-opus-4-5
+ ✅ Quota available → Success
+ ❌ Quota exhausted → Return error (no fallback)
+```
+
+**Use case**: When you only want to use paid subscriptions, no extra costs.
+
+### Example 4: Free-Only Mode
+
+**Setup:**
+```
+Model: if/kimi-k2-thinking
+Fallback: qw/qwen3-coder-plus → kr/claude-sonnet-4.5
+```
+
+**Behavior:**
+```
+All requests → Free tier only
+Cost: $0 forever
+```
+
+**Use case**: Personal projects, learning, experimentation.
+
+---
+
+## Best Practices
+
+### 1. Maximize Subscription Value
+
+```
+Strategy:
+- Set subscription models as Tier 1
+- Monitor quota usage in dashboard
+- Use cheap tier only when subscription exhausted
+```
+
+**Example combo:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 2. Optimize for Cost
+
+```
+Strategy:
+- Use Gemini CLI free tier first (180K/month)
+- Fallback to GLM/MiniMax (ultra-cheap)
+- Emergency: iFlow (free)
+```
+
+**Example combo:**
+```
+gc/gemini-3-flash-preview → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 3. Optimize for Quality
+
+```
+Strategy:
+- Use best models (Claude Opus, GPT-5.2)
+- Fallback to good cheap models (GLM-4.7)
+- Last resort: Free tier
+```
+
+**Example combo:**
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → glm/glm-4.7
+```
+
+### 4. 24/7 Availability
+
+```
+Strategy:
+- Always include free tier in fallback
+- Monitor quota reset times
+- Distribute usage across providers
+```
+
+**Example combo:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+**Result**: Never run out of quota, code anytime.
+
+---
+
+## Quota Reset Strategy
+
+Plan your usage around quota reset times:
+
+| Provider | Quota Reset | Strategy |
+|----------|-------------|----------|
+| **Claude Code** | 5-hour + weekly | Use in morning, fresh quota |
+| **Codex** | 5-hour + weekly | Use after Claude quota out |
+| **Gemini CLI** | Daily (1K) + Monthly (180K) | Use throughout day |
+| **GLM-4.7** | Daily 10:00 AM | Use evening, resets next morning |
+| **MiniMax M2.1** | 5-hour rolling | Use anytime, tracks rolling window |
+| **iFlow/Qwen/Kiro** | No limit | Emergency backup |
+
+**Daily routine example:**
+```
+08:00 - 13:00: Claude Code (fresh 5h quota)
+13:00 - 18:00: Gemini CLI (1K/day quota)
+18:00 - 22:00: GLM-4.7 (cheap, resets 10AM)
+22:00 - 08:00: MiniMax or iFlow (5h rolling or free)
+```
+
+---
+
+## Monitoring & Alerts
+
+### Dashboard Quota Tracker
+
+```
+Dashboard → Quota Overview:
+ Claude Code: 2.5h / 5h remaining (50%)
+ Gemini CLI: 450 / 1000 requests today
+ GLM-4.7: 5M / 10M tokens (resets in 8h)
+ MiniMax: 3M / 5M tokens (rolling 5h)
+```
+
+### Real-Time Notifications
+
+```
+Dashboard → Notifications:
+ ⚠️ Claude Code quota 80% used (1h remaining)
+ ✅ GLM-4.7 quota reset (10M tokens available)
+ 💰 Daily budget 50% used ($2.50 / $5)
+```
+
+### Usage Analytics
+
+```
+Dashboard → Analytics:
+ Today: 50M tokens
+ - 30M via Claude Code (subscription)
+ - 15M via GLM-4.7 ($9)
+ - 5M via iFlow (free)
+
+ Cost: $9 (vs $1000 on ChatGPT API)
+ Savings: 99%
+```
+
+---
+
+## Troubleshooting
+
+**Issue: "All providers quota exhausted"**
+
+**Solution:**
+1. Check dashboard quota tracker
+2. Wait for quota reset (see countdown)
+3. Add free tier to fallback chain
+4. Or increase budget limit
+
+**Issue: "Too many fallback switches"**
+
+**Solution:**
+1. Check if primary provider is down
+2. Increase quota limits (upgrade subscription)
+3. Use cheaper primary model (GLM instead of Claude)
+
+**Issue: "Unexpected costs"**
+
+**Solution:**
+1. Dashboard → Analytics → Review usage
+2. Set daily/monthly budget limits
+3. Switch to free tier for non-critical tasks
+4. Use combos with free fallback
+
+---
+
+## Related
+
+- [Combos](./combos.md) - Create custom fallback chains
+- [Quota Tracking](./quota-tracking.md) - Monitor usage and costs
diff --git a/gitbook/content/en/getting-started/installation.md b/gitbook/content/en/getting-started/installation.md
new file mode 100644
index 0000000..7e7393f
--- /dev/null
+++ b/gitbook/content/en/getting-started/installation.md
@@ -0,0 +1,478 @@
+# Installation
+
+Detailed installation guide for 9Router with troubleshooting tips.
+
+---
+
+## Requirements
+
+### System Requirements
+
+- **Node.js**: Version 20.0.0 or higher
+- **npm**: Version 10.0.0 or higher (comes with Node.js)
+- **OS**: macOS, Linux, Windows (WSL recommended)
+- **Disk Space**: ~200MB for installation
+
+### Check Your Version
+
+```bash
+node --version
+# Should show v20.x.x or higher
+
+npm --version
+# Should show 10.x.x or higher
+```
+
+**Don't have Node.js?** Install from [nodejs.org](https://nodejs.org/)
+
+---
+
+## Installation Methods
+
+### Method 1: Global Installation (Recommended)
+
+Install 9Router globally to use from anywhere:
+
+```bash
+npm install -g 9router
+```
+
+**Start 9Router:**
+
+```bash
+9router
+```
+
+**Benefits:**
+- ✅ Run from any directory
+- ✅ Simple command: `9router`
+- ✅ Auto-updates with `npm update -g 9router`
+
+### Method 2: Local Installation
+
+Install in a specific project:
+
+```bash
+mkdir my-9router
+cd my-9router
+npm install 9router
+```
+
+**Start 9Router:**
+
+```bash
+npx 9router
+```
+
+**Benefits:**
+- ✅ Isolated per project
+- ✅ Version control per project
+- ✅ No global namespace pollution
+
+### Method 3: From Source (Development)
+
+Clone and build from GitHub:
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install
+npm run build
+npm start
+```
+
+**Benefits:**
+- ✅ Latest development features
+- ✅ Contribute to development
+- ✅ Custom modifications
+
+---
+
+## First Run
+
+### Start the Server
+
+```bash
+9router
+```
+
+**What happens:**
+1. Server starts on `http://localhost:20128`
+2. Dashboard opens automatically in browser
+3. Data directory created at `~/.9router`
+4. API key generated automatically
+
+### Dashboard Login
+
+**Default credentials:**
+- Password: `123456`
+
+**⚠️ Change password immediately:**
+1. Login to dashboard
+2. Settings → Change Password
+3. Use strong password
+
+### Get Your API Key
+
+```
+Dashboard → Settings → API Keys
+→ Copy your API key
+→ Use in CLI tools
+```
+
+**Example API key format:**
+```
+9r_1234567890abcdef1234567890abcdef
+```
+
+---
+
+## Verify Installation
+
+### Check Server Status
+
+```bash
+curl http://localhost:20128/health
+```
+
+**Expected response:**
+```json
+{
+ "status": "ok",
+ "version": "1.0.0"
+}
+```
+
+### List Available Models
+
+```bash
+curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+```
+
+**Expected response:**
+```json
+{
+ "object": "list",
+ "data": [
+ {
+ "id": "cc/claude-opus-4-5-20251101",
+ "object": "model",
+ "created": 1234567890,
+ "owned_by": "claude-code"
+ }
+ ]
+}
+```
+
+### Test Chat Completion
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "cc/claude-opus-4-5-20251101",
+ "messages": [
+ {"role": "user", "content": "Hello!"}
+ ]
+ }'
+```
+
+---
+
+## Configuration
+
+### Environment Variables
+
+Create `.env` file or set environment variables:
+
+```bash
+# Security (REQUIRED in production)
+export JWT_SECRET="your-secure-secret-change-this"
+export INITIAL_PASSWORD="your-password"
+
+# Storage
+export DATA_DIR="~/.9router"
+
+# Server
+export PORT="20128"
+export NODE_ENV="production"
+
+# Logging
+export ENABLE_REQUEST_LOGS="false"
+```
+
+### Data Directory
+
+**Default location:** `~/.9router`
+
+**Contents:**
+```
+~/.9router/
+ ├── db.json # Database (providers, combos, usage)
+ ├── api-keys.json # API keys
+ └── logs/ # Request logs (if enabled)
+```
+
+**Change location:**
+
+```bash
+export DATA_DIR="/custom/path"
+9router
+```
+
+### Port Configuration
+
+**Default port:** `20128`
+
+**Change port:**
+
+```bash
+export PORT="3000"
+9router
+```
+
+**Or use command line:**
+
+```bash
+9router --port 3000
+```
+
+---
+
+## Troubleshooting
+
+### Port Already in Use
+
+**Error:**
+```
+Error: listen EADDRINUSE: address already in use :::20128
+```
+
+**Solution 1: Kill existing process**
+
+```bash
+# Find process using port 20128
+lsof -i :20128
+
+# Kill process
+kill -9
+```
+
+**Solution 2: Use different port**
+
+```bash
+9router --port 3000
+```
+
+### Permission Denied
+
+**Error:**
+```
+Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/9router'
+```
+
+**Solution: Use sudo (not recommended) or fix npm permissions**
+
+```bash
+# Fix npm permissions (recommended)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+
+# Then install again
+npm install -g 9router
+```
+
+### Node.js Version Too Old
+
+**Error:**
+```
+Error: The engine "node" is incompatible with this module
+```
+
+**Solution: Update Node.js**
+
+```bash
+# Using nvm (recommended)
+nvm install 20
+nvm use 20
+
+# Or download from nodejs.org
+```
+
+### Dashboard Not Opening
+
+**Issue:** Dashboard doesn't open automatically
+
+**Solution 1: Open manually**
+
+```
+http://localhost:20128
+```
+
+**Solution 2: Check firewall**
+
+```bash
+# macOS: Allow Node.js in System Preferences → Security
+# Linux: Check iptables
+# Windows: Check Windows Firewall
+```
+
+### Cannot Connect to Providers
+
+**Issue:** OAuth login fails or API key invalid
+
+**Solution 1: Check internet connection**
+
+```bash
+ping google.com
+```
+
+**Solution 2: Check provider status**
+
+- Claude Code: [status.anthropic.com](https://status.anthropic.com)
+- OpenAI: [status.openai.com](https://status.openai.com)
+- Gemini: [status.cloud.google.com](https://status.cloud.google.com)
+
+**Solution 3: Regenerate API key**
+
+```
+Dashboard → Provider → Disconnect → Reconnect
+```
+
+### High Memory Usage
+
+**Issue:** 9Router using too much RAM
+
+**Solution: Restart server**
+
+```bash
+# Stop
+pkill -f 9router
+
+# Start
+9router
+```
+
+**Or use PM2 for auto-restart:**
+
+```bash
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+```
+
+---
+
+## Deployment Options
+
+### Local Development
+
+```bash
+npm install -g 9router
+9router
+```
+
+**Use case:** Personal coding, testing
+
+### VPS/Cloud Server
+
+```bash
+# Install
+npm install -g 9router
+
+# Configure
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+# Start with PM2
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+pm2 startup
+```
+
+**Use case:** Team access, remote coding
+
+### Docker
+
+```bash
+docker pull 9router/9router:latest
+
+docker run -d \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret" \
+ -e INITIAL_PASSWORD="your-password" \
+ -v 9router-data:/root/.9router \
+ --name 9router \
+ 9router/9router:latest
+```
+
+**Use case:** Containerized deployment, Kubernetes
+
+### Reverse Proxy (Nginx)
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ location / {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+
+ # SSE support for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+**Use case:** HTTPS, custom domain, load balancing
+
+---
+
+## Uninstallation
+
+### Remove Global Installation
+
+```bash
+npm uninstall -g 9router
+```
+
+### Remove Data Directory
+
+```bash
+rm -rf ~/.9router
+```
+
+### Remove Configuration
+
+```bash
+# Remove environment variables from shell config
+nano ~/.bashrc # or ~/.zshrc
+# Delete 9router-related exports
+```
+
+---
+
+## Next Steps
+
+- [Getting Started Guide](../getting-started.md) - Connect providers and start coding
+- [Features](../features/) - Explore quota tracking, combos, deployment
+- [Troubleshooting](../troubleshooting.md) - Fix common issues
+
+---
+
+## Need Help?
+
+- **Website**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/en/getting-started/quick-start.md b/gitbook/content/en/getting-started/quick-start.md
new file mode 100644
index 0000000..b62c65d
--- /dev/null
+++ b/gitbook/content/en/getting-started/quick-start.md
@@ -0,0 +1,247 @@
+# Getting Started
+
+Get 9Router running in 5 minutes and start routing AI requests intelligently.
+
+---
+
+## Quick Start
+
+### 1. Install
+
+```bash
+npm install -g 9router
+```
+
+**Requirements:** Node.js 20+ ([Installation details](getting-started/installation.md))
+
+### 2. Start
+
+```bash
+9router
+```
+
+🎉 **Dashboard opens automatically** at `http://localhost:20128`
+
+- Default password: `123456` (change in dashboard)
+- API key generated automatically
+- Ready to connect providers
+
+### 3. Connect Providers
+
+You have 3 ways to connect providers:
+
+#### Option A: OAuth (Subscription Providers)
+
+**Best for:** Claude Code, Codex, Gemini CLI, GitHub Copilot
+
+```
+Dashboard → Providers → Connect [Provider]
+→ OAuth login → Auto token refresh
+→ Quota tracking enabled
+```
+
+**Example: Claude Code**
+1. Click "Connect Claude Code"
+2. Login with your Claude account
+3. Authorize 9Router
+4. ✅ Done! Use model: `cc/claude-opus-4-5-20251101`
+
+#### Option B: API Key (Cheap Providers)
+
+**Best for:** GLM, MiniMax, Kimi, OpenRouter
+
+```
+Dashboard → Providers → Add API Key
+→ Select provider
+→ Paste API key
+→ Save
+```
+
+**Example: GLM-4.7**
+1. Sign up at [Zhipu AI](https://open.bigmodel.cn/)
+2. Get API key from Coding Plan
+3. Dashboard → Add API Key → Provider: `glm` → Paste key
+4. ✅ Done! Use model: `glm/glm-4.7`
+
+#### Option C: Free Providers (No Cost)
+
+**Best for:** iFlow, Qwen, Kiro
+
+```
+Dashboard → Providers → Connect [Free Provider]
+→ Device code or OAuth
+→ Unlimited usage
+```
+
+**Example: iFlow**
+1. Click "Connect iFlow"
+2. Login with iFlow account
+3. Authorize
+4. ✅ Done! Use 8 models: `if/kimi-k2-thinking`, `if/qwen3-coder-plus`, etc.
+
+---
+
+## 4. Use in CLI Tools
+
+Point your coding tool to 9Router:
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Claude Desktop
+
+Edit `~/.claude/config.json`:
+
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key"
+}
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [from dashboard]
+Model: cc/claude-opus-4-5-20251101
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex "your prompt"
+```
+
+---
+
+## 5. Create Smart Combos (Optional)
+
+Combos enable automatic fallback between models:
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101 (Subscription primary)
+ 2. glm/glm-4.7 (Cheap backup, $0.6/1M)
+ 3. if/kimi-k2-thinking (Free fallback)
+
+Use in CLI: premium-coding
+```
+
+**How it works:**
+1. Tries Claude Opus first (your subscription)
+2. If quota exhausted → GLM-4.7 (ultra-cheap)
+3. If budget limit → iFlow (free)
+4. Zero downtime, automatic switching!
+
+---
+
+## Available Models
+
+### Subscription Models (Maximize First)
+
+**Claude Code (`cc/`)** - Pro/Max subscription:
+- `cc/claude-opus-4-5-20251101` - Claude 4.5 Opus
+- `cc/claude-sonnet-4-5-20250929` - Claude 4.5 Sonnet
+- `cc/claude-haiku-4-5-20251001` - Claude 4.5 Haiku
+
+**Codex (`cx/`)** - Plus/Pro subscription:
+- `cx/gpt-5.2-codex` - GPT 5.2 Codex
+- `cx/gpt-5.1-codex-max` - GPT 5.1 Codex Max
+
+**Gemini CLI (`gc/`)** - FREE 180K/month:
+- `gc/gemini-3-flash-preview` - Gemini 3 Flash Preview
+- `gc/gemini-2.5-pro` - Gemini 2.5 Pro
+
+**GitHub Copilot (`gh/`)** - Subscription:
+- `gh/gpt-5` - GPT-5
+- `gh/claude-4.5-sonnet` - Claude 4.5 Sonnet
+
+### Cheap Models (Backup)
+
+**GLM (`glm/`)** - $0.6/$2.2 per 1M:
+- `glm/glm-4.7` - GLM 4.7 (daily reset 10AM)
+
+**MiniMax (`minimax/`)** - $0.20/$1.00 per 1M:
+- `minimax/MiniMax-M2.1` - MiniMax M2.1 (5h reset)
+
+**Kimi (`kimi/`)** - $9/month (10M tokens):
+- `kimi/kimi-latest` - Kimi Latest
+
+### FREE Models (Emergency)
+
+**iFlow (`if/`)** - 8 models FREE:
+- `if/kimi-k2-thinking` - Kimi K2 Thinking
+- `if/qwen3-coder-plus` - Qwen3 Coder Plus
+- `if/glm-4.7` - GLM 4.7
+- `if/deepseek-r1` - DeepSeek R1
+
+**Qwen (`qw/`)** - 3 models FREE:
+- `qw/qwen3-coder-plus` - Qwen3 Coder Plus
+- `qw/qwen3-coder-flash` - Qwen3 Coder Flash
+
+**Kiro (`kr/`)** - 2 models FREE:
+- `kr/claude-sonnet-4.5` - Claude Sonnet 4.5
+- `kr/claude-haiku-4.5` - Claude Haiku 4.5
+
+---
+
+## Cost Optimization Strategy
+
+### Monthly Budget: $10-20/month
+
+```
+1. Use Gemini CLI free tier (180K/month) for quick tasks
+2. Use Claude Code subscription quota fully (you already pay)
+3. Fallback to GLM ($0.6/1M) when quota out
+4. Emergency: MiniMax M2.1 ($0.20/1M) or iFlow (free)
+
+Real example (100M tokens/month):
+ 60M via Gemini CLI: $0 (free tier)
+ 30M via Claude Code: $0 (subscription you already have)
+ 8M via GLM: $4.80
+ 2M via MiniMax: $0.40
+ Total: $5.20/month + existing subscriptions
+```
+
+### Quota Reset Strategy
+
+```
+Daily routine:
+1. Morning: Fresh Claude Code quota (5h reset)
+2. Afternoon: Switch to Gemini CLI (1K/day)
+3. Evening: GLM daily quota (reset 10AM next day)
+4. Late night: MiniMax (5h rolling) or iFlow (free)
+
+→ Code 24/7 with minimal extra cost!
+```
+
+---
+
+## Next Steps
+
+- [Installation Details](getting-started/installation.md) - Requirements, troubleshooting
+- [Features](features/) - Explore quota tracking, combos, deployment
+- [FAQ](faq.md) - Common questions and answers
+- [Troubleshooting](troubleshooting.md) - Fix common issues
+
+---
+
+## Need Help?
+
+- **Website**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/en/index.md b/gitbook/content/en/index.md
new file mode 100644
index 0000000..2c25f24
--- /dev/null
+++ b/gitbook/content/en/index.md
@@ -0,0 +1,164 @@
+# Welcome to 9Router
+
+**Use Claude, Codex, Gemini for FREE • Ultra-cheap alternatives from $0.20/1M tokens**
+
+9Router is an AI model router that maximizes your subscription value and minimizes costs through intelligent routing and automatic fallback.
+
+---
+
+## What is 9Router?
+
+9Router is a smart proxy that sits between your coding tools (Cursor, Cline, Claude Desktop) and AI providers. It automatically routes requests to the best available model based on quota, cost, and availability.
+
+**Stop wasting money:**
+- ❌ Subscription quota expires unused every month
+- ❌ Rate limits stop you mid-coding
+- ❌ Expensive APIs ($20-50/month per provider)
+- ❌ Manual switching between providers
+
+**Start maximizing value:**
+- ✅ **Maximize Subscriptions** - Track and use every bit of Claude Code, Codex, Gemini quota
+- ✅ **FREE Available** - Access iFlow, Qwen, Kiro models via CLI
+- ✅ **Ultra-Cheap Backup** - GLM ($0.6/1M), MiniMax M2.1 ($0.20/1M)
+- ✅ **Smart Fallback** - Subscription → Cheap → Free, automatic switching
+
+---
+
+## Key Features
+
+### 🔄 Smart 3-Tier Fallback
+
+```
+Setup once, never stop coding:
+
+Tier 1 (SUBSCRIPTION): Claude Code → Codex → Gemini
+ ↓ quota exhausted
+Tier 2 (CHEAP): GLM-4.7 → MiniMax M2.1 → Kimi
+ ↓ budget limit
+Tier 3 (FREE): iFlow → Qwen → Kiro
+
+→ Automatic switching, zero downtime!
+```
+
+### 📊 Quota Tracking
+
+- Real-time token consumption per provider
+- Reset countdown (5-hour, daily, weekly, monthly)
+- Cost estimation for paid tiers
+- Monthly spending reports
+
+### 🎯 Universal CLI Support
+
+Works with any tool that supports custom OpenAI endpoints:
+
+✅ **Cursor** • **Cline** • **Claude Desktop** • **Codex** • **RooCode** • **Continue** • **Any OpenAI-compatible tool**
+
+### 💰 Cost Optimization
+
+**Real example (100M tokens/month):**
+```
+60M via Gemini CLI: $0 (free tier)
+30M via Claude Code: $0 (subscription you already have)
+8M via GLM: $4.80
+2M via MiniMax: $0.40
+Total: $5.20/month vs $2000 on ChatGPT API!
+```
+
+---
+
+## Why Choose 9Router?
+
+### Maximize Subscriptions
+
+Already paying for Claude Code ($20-100/month) or Codex ($20-200/month)? Get full value:
+
+- Track quota usage in real-time
+- Auto-switch when quota resets (5-hour, weekly)
+- Use every token before it expires
+- Gemini CLI: 180K completions/month **FREE**
+
+### Ultra-Cheap Backup
+
+When subscription quota runs out, pay pennies:
+
+| Provider | Cost per 1M tokens | Reset |
+|----------|-------------------|-------|
+| **GLM-4.7** | $0.60 input / $2.20 output | Daily 10:00 AM |
+| **MiniMax M2.1** | $0.20 input / $1.00 output | 5-hour rolling |
+| **Kimi K2** | $9/month (10M tokens) | Monthly |
+
+**~90% cheaper than ChatGPT API ($20/1M)!**
+
+### Free Forever Fallback
+
+Emergency backup when everything else is quota-limited:
+
+- **iFlow**: 8 models (Kimi K2, Qwen3 Coder Plus, GLM 4.7, MiniMax M2)
+- **Qwen**: 3 models (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro**: Claude Sonnet 4.5, Haiku 4.5 (AWS Builder ID)
+
+---
+
+## Quick Start
+
+Get started in 2 minutes:
+
+```bash
+# Install globally
+npm install -g 9router
+
+# Start (dashboard opens automatically)
+9router
+```
+
+🎉 **Dashboard opens** → Connect providers → Start coding!
+
+**Use in your CLI tool:**
+
+```
+Endpoint: http://localhost:20128/v1
+API Key: [from dashboard]
+Model: cc/claude-opus-4-5-20251101
+```
+
+[→ Full Getting Started Guide](getting-started.md)
+
+---
+
+## Use Cases
+
+### For Individual Developers
+
+- Maximize your Claude Code/Codex subscription
+- Use Gemini CLI free tier (180K/month)
+- Fallback to ultra-cheap models ($0.20/1M)
+- Code 24/7 without rate limits
+
+### For Teams
+
+- Deploy on VPS/Cloud for shared access
+- Track team spending in real-time
+- Set budget limits per tier
+- Centralized provider management
+
+### For Mobile/Remote Coding
+
+- Use cloud deployment (https://9router.com)
+- Access from iPad, phone, anywhere
+- No localhost limitations
+- Cloudflare edge network (300+ locations)
+
+---
+
+## What's Next?
+
+- [Getting Started](getting-started.md) - Install and configure in 5 minutes
+- [Installation Guide](getting-started/installation.md) - Detailed setup instructions
+- [Features](features/) - Explore all capabilities
+- [FAQ](faq.md) - Common questions
+
+---
+
+
+ Built with ❤️ for developers maximizing AI value
+
diff --git a/gitbook/content/en/integration/claude-code.md b/gitbook/content/en/integration/claude-code.md
new file mode 100644
index 0000000..acf5770
--- /dev/null
+++ b/gitbook/content/en/integration/claude-code.md
@@ -0,0 +1,109 @@
+# Claude Code Integration
+
+Integrate 9Router with Claude Code CLI to route your Anthropic API requests through 9Router's intelligent routing system.
+
+## Prerequisites
+
+- Claude Code CLI installed
+- 9Router running locally or cloud endpoint configured
+- API key from 9Router dashboard
+
+## Setup
+
+### 1. Configure Environment Variables
+
+Set the following environment variables in your shell configuration file (`~/.bashrc`, `~/.zshrc`, or `~/.bash_profile`):
+
+```bash
+# Base URL for 9Router
+export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
+
+# Optional: Set default models for aliases
+export ANTHROPIC_DEFAULT_OPUS_MODEL="cc/claude-opus-4-5-20251101"
+export ANTHROPIC_DEFAULT_SONNET_MODEL="cc/claude-sonnet-4-5-20250929"
+export ANTHROPIC_DEFAULT_HAIKU_MODEL="cc/claude-haiku-4-5-20251001"
+```
+
+### 2. Reload Shell Configuration
+
+```bash
+source ~/.zshrc # or ~/.bashrc
+```
+
+### 3. Verify Configuration
+
+Check that the environment variables are set correctly:
+
+```bash
+echo $ANTHROPIC_BASE_URL
+```
+
+## Model Aliases
+
+Claude Code supports the following model aliases that map to 9Router models:
+
+| Alias | Model | Environment Variable |
+|-------|-------|---------------------|
+| `opus` | Claude Opus 4.5 | `ANTHROPIC_DEFAULT_OPUS_MODEL` |
+| `sonnet` | Claude Sonnet 4.5 | `ANTHROPIC_DEFAULT_SONNET_MODEL` |
+| `haiku` | Claude Haiku 4.5 | `ANTHROPIC_DEFAULT_HAIKU_MODEL` |
+
+## Usage Examples
+
+### Using Model Aliases
+
+```bash
+# Use Opus model
+claude --model opus "Explain quantum computing"
+
+# Use Sonnet model
+claude --model sonnet "Write a Python function"
+
+# Use Haiku model
+claude --model haiku "Quick code review"
+```
+
+### Using Full Model Names
+
+```bash
+claude --model cc/claude-opus-4-5-20251101 "Your prompt here"
+```
+
+## Settings File
+
+Claude Code stores its configuration in `~/.claude/settings.json`. You can manually edit this file if needed:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "defaultModel": "sonnet"
+}
+```
+
+## Troubleshooting
+
+### Connection Issues
+
+If you encounter connection errors:
+
+1. Verify 9Router is running: `curl http://localhost:20128/health`
+2. Check environment variables are set correctly
+3. Ensure no firewall is blocking port 20128
+
+### Model Not Found
+
+If you get "model not found" errors:
+
+1. Verify the model name matches your 9Router configuration
+2. Check that the provider connection is active in 9Router dashboard
+3. Ensure the model is available in your connected providers
+
+## Cloud Endpoint
+
+To use 9Router cloud endpoint instead of localhost:
+
+```bash
+export ANTHROPIC_BASE_URL="https://9router.com"
+```
+
+Make sure you have configured your API key in the 9Router cloud dashboard.
diff --git a/gitbook/content/en/integration/cline.md b/gitbook/content/en/integration/cline.md
new file mode 100644
index 0000000..3fa60e7
--- /dev/null
+++ b/gitbook/content/en/integration/cline.md
@@ -0,0 +1,201 @@
+# Cline Integration
+
+Integrate 9Router with Cline VSCode extension to route your AI requests through 9Router's intelligent routing system.
+
+## Prerequisites
+
+- Visual Studio Code installed
+- Cline extension installed from VSCode marketplace
+- 9Router running locally or cloud endpoint configured
+- API key from 9Router dashboard
+
+## Setup
+
+### 1. Open Cline Settings
+
+1. Open Visual Studio Code
+2. Open the Cline extension panel (click the Cline icon in the sidebar)
+3. Click the **Settings** icon (gear icon) in the Cline panel
+
+### 2. Select API Provider
+
+1. In the Cline settings, find **API Provider** dropdown
+2. Select **Ollama** from the list
+ - Note: We use Ollama provider type because it's compatible with OpenAI-style APIs
+
+### 3. Configure Base URL
+
+Set the base URL to your 9Router endpoint:
+
+**For Local 9Router:**
+```
+http://localhost:20128/v1
+```
+
+**For Cloud 9Router:**
+```
+https://9router.com
+```
+
+**Steps:**
+1. In the **Base URL** field, enter your 9Router endpoint
+2. Make sure to include `/v1` at the end
+
+### 4. Add API Key
+
+1. In the **API Key** field, enter your 9Router API key
+2. You can find your API key in the 9Router dashboard under **Settings → API Keys**
+3. The key should start with `sk-9router-`
+
+### 5. Select Model
+
+1. In the **Model** dropdown, you can either:
+ - Select from available models (if Cline auto-detects them)
+ - Manually enter the model name from your 9Router configuration
+
+2. Common model names:
+ - `gpt-4`
+ - `gpt-4o`
+ - `claude-opus-4-5`
+ - `claude-sonnet-4-5`
+ - `gemini-2.0-flash`
+
+### 6. Save Configuration
+
+Click **Save** or close the settings panel. Cline will automatically save your configuration.
+
+## Configuration Example
+
+Your Cline settings should look like this:
+
+```
+API Provider: Ollama
+Base URL: http://localhost:20128/v1
+API Key: sk-9router-xxxxxxxxxxxxx
+Model: gpt-4
+```
+
+## Available Models
+
+You can use any model configured in your 9Router dashboard. Common examples:
+
+| Model Name | Provider | Description |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## Usage
+
+### Chat with AI
+
+1. Open the Cline panel in VSCode
+2. Type your message in the chat input
+3. Press Enter to send
+4. Cline will use 9Router to process your request
+
+### Code Generation
+
+1. Ask Cline to generate code: "Create a React component for a login form"
+2. Cline will generate code using 9Router
+3. Review and accept the generated code
+
+### Code Explanation
+
+1. Select code in your editor
+2. Ask Cline: "Explain this code"
+3. Get AI-powered explanations through 9Router
+
+### File Operations
+
+1. Ask Cline to create, modify, or delete files
+2. Cline will use 9Router to understand context and make changes
+3. Review changes before accepting
+
+## Troubleshooting
+
+### "Connection Failed" Error
+
+1. Verify 9Router is running: `curl http://localhost:20128/health`
+2. Check that the base URL is correct and includes `/v1`
+3. Ensure no firewall is blocking port 20128
+4. Try restarting VSCode
+
+### "Invalid API Key" Error
+
+1. Verify your API key in 9Router dashboard
+2. Make sure you copied the entire key including the `sk-9router-` prefix
+3. Check that the API key has not expired
+4. Try regenerating a new API key
+
+### "Model Not Found" Error
+
+1. Verify the model name matches exactly with your 9Router configuration
+2. Check that the provider connection is active in 9Router dashboard
+3. Ensure the model is available in your connected providers
+4. Try using the full model name (e.g., `openai/gpt-4` instead of `gpt-4`)
+
+### Cline Not Responding
+
+1. Check the Cline output panel for error messages
+2. Verify your 9Router instance is running and healthy
+3. Try reloading VSCode window (Cmd/Ctrl + Shift + P → "Reload Window")
+4. Check 9Router logs for any errors
+
+## Advanced Configuration
+
+### Using Cloud Endpoint
+
+To use 9Router cloud endpoint instead of localhost:
+
+1. In Cline settings, set Base URL to: `https://9router.com`
+2. Make sure you have configured your API key in the 9Router cloud dashboard
+3. Ensure your cloud endpoint is active and accessible
+
+### Multiple Models
+
+You can quickly switch between models:
+
+1. Open Cline settings
+2. Change the **Model** field to a different model
+3. Save and continue chatting with the new model
+
+### Custom Timeout
+
+If you experience timeout issues with large requests:
+
+1. Open VSCode settings (Cmd/Ctrl + ,)
+2. Search for "Cline timeout"
+3. Increase the timeout value (default is usually 30 seconds)
+
+## Best Practices
+
+1. **Use Appropriate Models**: Choose faster models (like Haiku or Flash) for simple tasks, and more powerful models (like Opus or GPT-4) for complex tasks
+2. **Monitor Usage**: Check 9Router dashboard for usage statistics and costs
+3. **Context Management**: Keep your conversations focused to reduce token usage
+4. **Model Switching**: Switch models based on task complexity to optimize cost and performance
+5. **API Key Security**: Never commit your API key to version control
+
+## Integration with 9Router Features
+
+### Model Routing
+
+9Router automatically routes your requests to the best available provider based on:
+- Model availability
+- Provider health status
+- Cost optimization
+- Load balancing
+
+### Fallback Support
+
+If a provider fails, 9Router automatically falls back to alternative providers configured in your dashboard.
+
+### Usage Tracking
+
+Monitor your Cline usage through 9Router dashboard:
+- Total requests
+- Token usage
+- Cost per model
+- Provider distribution
diff --git a/gitbook/content/en/integration/codex.md b/gitbook/content/en/integration/codex.md
new file mode 100644
index 0000000..06a7073
--- /dev/null
+++ b/gitbook/content/en/integration/codex.md
@@ -0,0 +1,136 @@
+# OpenAI Codex CLI Integration
+
+Integrate 9Router with OpenAI Codex CLI to route your OpenAI API requests through 9Router's intelligent routing system.
+
+## Prerequisites
+
+- OpenAI Codex CLI installed
+- 9Router running locally or cloud endpoint configured
+- API key from 9Router dashboard
+
+## Setup
+
+### 1. Configure Environment Variables
+
+Set the following environment variables in your shell configuration file (`~/.bashrc`, `~/.zshrc`, or `~/.bash_profile`):
+
+```bash
+# Base URL for 9Router
+export OPENAI_BASE_URL="http://localhost:20128/v1"
+
+# API Key from 9Router dashboard
+export OPENAI_API_KEY="your-9router-api-key"
+```
+
+### 2. Reload Shell Configuration
+
+```bash
+source ~/.zshrc # or ~/.bashrc
+```
+
+### 3. Verify Configuration
+
+Check that the environment variables are set correctly:
+
+```bash
+echo $OPENAI_BASE_URL
+echo $OPENAI_API_KEY
+```
+
+## Available Models
+
+9Router provides the following Codex models:
+
+| Model ID | Description |
+|----------|-------------|
+| `cx/gpt-5.2-codex` | GPT-5.2 Codex - Latest version |
+| `cx/gpt-5.1-codex-max` | GPT-5.1 Codex Max - Extended context |
+
+## Usage Examples
+
+### Basic Usage
+
+```bash
+# Use GPT-5.2 Codex
+codex --model cx/gpt-5.2-codex "Write a function to sort an array"
+
+# Use GPT-5.1 Codex Max
+codex --model cx/gpt-5.1-codex-max "Explain this complex algorithm"
+```
+
+### Code Generation
+
+```bash
+codex --model cx/gpt-5.2-codex "Create a REST API endpoint for user authentication"
+```
+
+### Code Explanation
+
+```bash
+codex --model cx/gpt-5.1-codex-max "Explain what this code does: $(cat myfile.js)"
+```
+
+## Configuration File
+
+You can also configure Codex CLI using a configuration file. Create or edit `~/.codex/config.json`:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "apiKey": "your-9router-api-key",
+ "defaultModel": "cx/gpt-5.2-codex"
+}
+```
+
+## Troubleshooting
+
+### Authentication Errors
+
+If you encounter authentication errors:
+
+1. Verify your API key is correct in 9Router dashboard
+2. Check that `OPENAI_API_KEY` environment variable is set
+3. Ensure the API key has not expired
+
+### Connection Issues
+
+If you encounter connection errors:
+
+1. Verify 9Router is running: `curl http://localhost:20128/health`
+2. Check environment variables are set correctly
+3. Ensure no firewall is blocking port 20128
+
+### Model Not Available
+
+If you get "model not available" errors:
+
+1. Verify the model name matches your 9Router configuration
+2. Check that the OpenAI provider connection is active in 9Router dashboard
+3. Ensure the model is available in your connected providers
+
+## Cloud Endpoint
+
+To use 9Router cloud endpoint instead of localhost:
+
+```bash
+export OPENAI_BASE_URL="https://9router.com"
+```
+
+Make sure you have configured your API key in the 9Router cloud dashboard.
+
+## Advanced Configuration
+
+### Custom Timeout
+
+```bash
+export OPENAI_TIMEOUT=60 # seconds
+```
+
+### Debug Mode
+
+Enable debug mode to see detailed request/response logs:
+
+```bash
+export CODEX_DEBUG=true
+codex --model cx/gpt-5.2-codex "Your prompt"
+```
diff --git a/gitbook/content/en/integration/continue.md b/gitbook/content/en/integration/continue.md
new file mode 100644
index 0000000..3cd8435
--- /dev/null
+++ b/gitbook/content/en/integration/continue.md
@@ -0,0 +1,249 @@
+# Continue VSCode Extension Integration
+
+Integrate 9Router with Continue extension to bring AI assistance directly into Visual Studio Code.
+
+## Prerequisites
+
+- Visual Studio Code installed
+- Continue extension installed from VSCode marketplace
+- 9Router API key from [dashboard](https://9router.com/dashboard)
+- 9Router running (local or cloud)
+
+## Configuration Steps
+
+### 1. Open Continue Configuration
+
+1. Open VSCode
+2. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux)
+3. Type "Continue: Open Config" and select it
+4. This opens `~/.continue/config.json`
+
+### 2. Add 9Router Model Configuration
+
+Add the following configuration to your `config.json`:
+
+**Single Model Setup:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**Multiple Models Setup:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus (Best)",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Sonnet (Balanced)",
+ "provider": "openai",
+ "model": "cc/claude-sonnet-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - DeepSeek Chat (Code)",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Haiku (Fast)",
+ "provider": "openai",
+ "model": "cc/claude-haiku-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**For Cloud 9Router:**
+Replace `apiBase` with:
+```json
+"apiBase": "https://9router.com/v1"
+```
+
+### 3. Save and Reload
+
+1. Save the configuration file
+2. Reload VSCode window: `Cmd+Shift+P` → "Developer: Reload Window"
+3. Continue extension will load the new configuration
+
+### 4. Select Model
+
+1. Open Continue sidebar (click Continue icon in left panel)
+2. Click model selector dropdown at the top
+3. Choose your preferred 9Router model
+
+## Available Models
+
+### Claude Models (Anthropic)
+- `cc/claude-opus-4-5-20251101` - Most capable, best for complex tasks
+- `cc/claude-sonnet-4-20250514` - Balanced performance and speed
+- `cc/claude-haiku-4-20250514` - Fastest, good for simple tasks
+
+### DeepSeek Models
+- `cx/deepseek-chat` - Excellent for code generation
+- `cx/deepseek-reasoner` - Best for complex problem solving
+
+### GLM Models (Zhipu AI)
+- `glm/glm-4-plus` - Advanced Chinese and English
+- `glm/glm-4-flash` - Fast responses
+
+## Usage Examples
+
+### Code Explanation
+1. Select code in editor
+2. Open Continue sidebar
+3. Type: "Explain this code"
+4. Model: `cc/claude-sonnet-4-20250514`
+
+### Code Generation
+1. Open Continue sidebar
+2. Type: "Create a React component for user profile card"
+3. Model: `cx/deepseek-chat`
+
+### Refactoring
+1. Select code to refactor
+2. Type: "Refactor this to use async/await"
+3. Model: `cc/claude-sonnet-4-20250514`
+
+### Bug Fixing
+1. Select problematic code
+2. Type: "Find and fix the bug in this code"
+3. Model: `cx/deepseek-reasoner`
+
+## Advanced Configuration
+
+### Custom System Prompts
+
+Add custom system prompts for specific behaviors:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Code Expert",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "systemMessage": "You are an expert programmer. Always provide clean, well-documented code with best practices."
+ }
+ ]
+}
+```
+
+### Temperature and Parameters
+
+Adjust model behavior with parameters:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Creative Writer",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "temperature": 0.9,
+ "topP": 0.95
+ }
+ ]
+}
+```
+
+### Context Providers
+
+Configure what context Continue sends to the model:
+
+```json
+{
+ "contextProviders": [
+ {
+ "name": "code",
+ "params": {
+ "maxLines": 100
+ }
+ },
+ {
+ "name": "diff",
+ "params": {}
+ },
+ {
+ "name": "terminal",
+ "params": {}
+ }
+ ]
+}
+```
+
+## Keyboard Shortcuts
+
+- `Cmd+L` (Mac) / `Ctrl+L` (Windows/Linux) - Open Continue chat
+- `Cmd+I` (Mac) / `Ctrl+I` (Windows/Linux) - Inline edit
+- `Cmd+Shift+R` (Mac) / `Ctrl+Shift+R` (Windows/Linux) - Regenerate response
+
+## Troubleshooting
+
+### Model Not Responding
+- Check 9Router is running: `curl http://localhost:20128/health`
+- Verify API key in config.json
+- Check VSCode Developer Console for errors: `Help` → `Toggle Developer Tools`
+
+### Wrong Model Selected
+- Click model dropdown in Continue sidebar
+- Select correct 9Router model
+- Model name must match exactly (case-sensitive)
+
+### Configuration Not Loading
+- Verify JSON syntax is valid (use JSON validator)
+- Check file location: `~/.continue/config.json`
+- Reload VSCode window after changes
+
+### Slow Performance
+- Switch to faster models (haiku, flash)
+- Reduce context size in contextProviders
+- Check network latency to 9Router
+
+## Best Practices
+
+### Model Selection Strategy
+- **Quick edits**: Use `cc/claude-haiku-4-20250514`
+- **Code generation**: Use `cx/deepseek-chat`
+- **Complex refactoring**: Use `cc/claude-opus-4-5-20251101`
+- **Problem solving**: Use `cx/deepseek-reasoner`
+
+### Context Management
+- Select only relevant code before asking
+- Use specific, clear prompts
+- Break complex tasks into smaller steps
+
+### Cost Optimization
+- Use faster/cheaper models for simple tasks
+- Limit context size when possible
+- Cache frequently used responses
+
+## Next Steps
+
+- [Configure Cursor](cursor.md) for enhanced IDE integration
+- [Set up Roo](roo.md) for AI assistant
+- [Explore CLI usage](../cli/basic-usage.md)
+- [Learn about model selection](../models/overview.md)
diff --git a/gitbook/content/en/integration/cursor.md b/gitbook/content/en/integration/cursor.md
new file mode 100644
index 0000000..146fcfa
--- /dev/null
+++ b/gitbook/content/en/integration/cursor.md
@@ -0,0 +1,149 @@
+# Cursor Integration
+
+Integrate 9Router with Cursor IDE to route your AI requests through 9Router's intelligent routing system.
+
+## Prerequisites
+
+- Cursor IDE installed
+- Cursor Pro account (required for custom API endpoints)
+- 9Router cloud endpoint configured
+- API key from 9Router dashboard
+
+## ⚠️ Important Notes
+
+> **Cloud Endpoint Required**: Cursor routes requests through its own server and does not support localhost endpoints. You must use the 9Router cloud endpoint: `https://9router.com`
+
+> **Cursor Pro Required**: This feature requires a Cursor Pro account to use custom API endpoints.
+
+## Setup
+
+### 1. Open Cursor Settings
+
+1. Open Cursor IDE
+2. Go to **Settings** (Cmd/Ctrl + ,)
+3. Navigate to **Models** section
+
+### 2. Enable OpenAI API
+
+1. Find the **OpenAI API key** option
+2. Enable the toggle to activate custom API configuration
+
+### 3. Configure Base URL
+
+Set the base URL to 9Router cloud endpoint:
+
+```
+https://9router.com
+```
+
+**Steps:**
+1. In the Models settings, locate the **Base URL** field
+2. Enter: `https://9router.com`
+3. Click **Save**
+
+### 4. Add API Key
+
+1. In the **API Key** field, enter your 9Router API key
+2. You can find your API key in the 9Router dashboard under **Settings → API Keys**
+3. Click **Save**
+
+### 5. Add Custom Model
+
+1. Click **View All Models** button
+2. Click **Add Custom Model**
+3. Enter the model name from your 9Router configuration (e.g., `gpt-4`, `claude-opus-4-5`, etc.)
+4. Click **Add**
+
+### 6. Select Model
+
+1. In the Cursor chat interface, click the model selector dropdown
+2. Choose your custom model from the list
+3. Start using 9Router with Cursor!
+
+## Configuration Example
+
+Your Cursor settings should look like this:
+
+```
+OpenAI API: ✓ Enabled
+Base URL: https://9router.com
+API Key: sk-9router-xxxxxxxxxxxxx
+Custom Models: gpt-4, claude-opus-4-5, gemini-2.0-flash
+```
+
+## Available Models
+
+You can use any model configured in your 9Router dashboard. Common examples:
+
+| Model Name | Provider | Description |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## Usage
+
+### Chat Interface
+
+1. Open Cursor chat (Cmd/Ctrl + L)
+2. Select your model from the dropdown
+3. Start chatting with AI through 9Router
+
+### Inline Code Generation
+
+1. Select code in your editor
+2. Press Cmd/Ctrl + K
+3. Enter your prompt
+4. Cursor will use 9Router to generate code
+
+### Code Explanation
+
+1. Select code in your editor
+2. Press Cmd/Ctrl + L
+3. Ask "Explain this code"
+4. Get AI-powered explanations through 9Router
+
+## Troubleshooting
+
+### "Invalid API Key" Error
+
+1. Verify your API key in 9Router dashboard
+2. Make sure you copied the entire key including the `sk-9router-` prefix
+3. Check that the API key has not expired
+4. Try regenerating a new API key
+
+### "Model Not Found" Error
+
+1. Verify the model name matches exactly with your 9Router configuration
+2. Check that the provider connection is active in 9Router dashboard
+3. Ensure the model is available in your connected providers
+4. Try using the full model name (e.g., `openai/gpt-4` instead of `gpt-4`)
+
+### Connection Issues
+
+1. Verify you are using the cloud endpoint: `https://9router.com`
+2. Check your internet connection
+3. Ensure 9Router cloud service is operational
+4. Try disabling VPN or proxy if enabled
+
+### Localhost Not Working
+
+> **Remember**: Cursor does not support localhost endpoints. You must use the cloud endpoint `https://9router.com`. If you need to use a local 9Router instance, consider using a tunneling service like ngrok to expose your local endpoint.
+
+## Cloud Endpoint Setup
+
+If you're running 9Router locally and want to use it with Cursor:
+
+1. Enable cloud endpoint in 9Router settings
+2. Configure your cloud endpoint URL in 9Router dashboard
+3. Use the cloud URL in Cursor settings
+4. Ensure your local 9Router instance is accessible from the internet
+
+## Best Practices
+
+1. **Use Model Aliases**: Create short aliases for frequently used models in 9Router
+2. **Monitor Usage**: Check 9Router dashboard for usage statistics and costs
+3. **Rotate API Keys**: Regularly rotate your API keys for security
+4. **Test Models**: Try different models to find the best one for your use case
diff --git a/gitbook/content/en/integration/other-tools.md b/gitbook/content/en/integration/other-tools.md
new file mode 100644
index 0000000..c08837d
--- /dev/null
+++ b/gitbook/content/en/integration/other-tools.md
@@ -0,0 +1,416 @@
+# Other Tools Integration
+
+9Router is compatible with any tool that supports the OpenAI API format. This guide covers generic integration patterns for various tools and custom applications.
+
+## Overview
+
+9Router provides an OpenAI-compatible API endpoint that works with:
+- Custom scripts and applications
+- API clients and testing tools
+- CLI tools and utilities
+- Third-party integrations
+- Development frameworks
+
+## Generic Setup Pattern
+
+Any OpenAI-compatible tool can connect to 9Router using these settings:
+
+**Local 9Router:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+Model: any 9Router model (cc/*, cx/*, glm/*, etc.)
+```
+
+**Cloud 9Router:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+Model: any 9Router model (cc/*, cx/*, glm/*, etc.)
+```
+
+## Available Models
+
+### Claude Models (Anthropic)
+- `cc/claude-opus-4-5-20251101`
+- `cc/claude-sonnet-4-20250514`
+- `cc/claude-haiku-4-20250514`
+
+### DeepSeek Models
+- `cx/deepseek-chat`
+- `cx/deepseek-reasoner`
+
+### GLM Models (Zhipu AI)
+- `glm/glm-4-plus`
+- `glm/glm-4-flash`
+
+## Integration Examples
+
+### Python with OpenAI SDK
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+)
+
+print(response.choices[0].message.content)
+```
+
+### Node.js with OpenAI SDK
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+const response = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [
+ { role: "user", content: "Hello, how are you?" }
+ ]
+});
+
+console.log(response.choices[0].message.content);
+```
+
+### cURL Command
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer your-api-key-from-dashboard" \
+ -d '{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+ }'
+```
+
+### HTTP Client (Postman, Insomnia)
+
+**Request:**
+```
+POST http://localhost:20128/v1/chat/completions
+```
+
+**Headers:**
+```
+Content-Type: application/json
+Authorization: Bearer your-api-key-from-dashboard
+```
+
+**Body:**
+```json
+{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ],
+ "temperature": 0.7,
+ "max_tokens": 1000
+}
+```
+
+### LangChain Integration
+
+```python
+from langchain.chat_models import ChatOpenAI
+from langchain.schema import HumanMessage
+
+llm = ChatOpenAI(
+ model_name="cc/claude-sonnet-4-20250514",
+ openai_api_key="your-api-key-from-dashboard",
+ openai_api_base="http://localhost:20128/v1",
+ temperature=0.7
+)
+
+messages = [HumanMessage(content="Explain quantum computing")]
+response = llm(messages)
+print(response.content)
+```
+
+### LlamaIndex Integration
+
+```python
+from llama_index.llms import OpenAI
+
+llm = OpenAI(
+ model="cc/claude-sonnet-4-20250514",
+ api_key="your-api-key-from-dashboard",
+ api_base="http://localhost:20128/v1"
+)
+
+response = llm.complete("What is machine learning?")
+print(response.text)
+```
+
+## Custom Script Examples
+
+### Batch Processing Script
+
+```python
+import openai
+import json
+
+openai.api_key = "your-api-key-from-dashboard"
+openai.api_base = "http://localhost:20128/v1"
+
+def process_batch(prompts, model="cx/deepseek-chat"):
+ results = []
+ for prompt in prompts:
+ response = openai.ChatCompletion.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ results.append({
+ "prompt": prompt,
+ "response": response.choices[0].message.content
+ })
+ return results
+
+prompts = [
+ "Explain AI in one sentence",
+ "What is machine learning?",
+ "Define neural networks"
+]
+
+results = process_batch(prompts)
+print(json.dumps(results, indent=2))
+```
+
+### Streaming Response Handler
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+async function streamResponse(prompt) {
+ const stream = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [{ role: "user", content: prompt }],
+ stream: true
+ });
+
+ for await (const chunk of stream) {
+ const content = chunk.choices[0]?.delta?.content || "";
+ process.stdout.write(content);
+ }
+}
+
+streamResponse("Write a short story about AI");
+```
+
+### Multi-Model Comparison
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+models = [
+ "cc/claude-sonnet-4-20250514",
+ "cx/deepseek-chat",
+ "glm/glm-4-plus"
+]
+
+prompt = "Explain quantum computing in simple terms"
+
+for model in models:
+ response = client.chat.completions.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ print(f"\n=== {model} ===")
+ print(response.choices[0].message.content)
+```
+
+## Common Integration Patterns
+
+### Environment Variables
+
+Store credentials securely:
+
+```bash
+# .env file
+ROUTER_API_KEY=your-api-key-from-dashboard
+ROUTER_BASE_URL=http://localhost:20128/v1
+ROUTER_MODEL=cc/claude-sonnet-4-20250514
+```
+
+```python
+import os
+from openai import OpenAI
+
+client = OpenAI(
+ api_key=os.getenv("ROUTER_API_KEY"),
+ base_url=os.getenv("ROUTER_BASE_URL")
+)
+```
+
+### Error Handling
+
+```python
+from openai import OpenAI, OpenAIError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": "Hello"}]
+ )
+ print(response.choices[0].message.content)
+except OpenAIError as e:
+ print(f"Error: {e}")
+```
+
+### Retry Logic
+
+```python
+import time
+from openai import OpenAI, RateLimitError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+def chat_with_retry(prompt, max_retries=3):
+ for attempt in range(max_retries):
+ try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": prompt}]
+ )
+ return response.choices[0].message.content
+ except RateLimitError:
+ if attempt < max_retries - 1:
+ time.sleep(2 ** attempt) # Exponential backoff
+ else:
+ raise
+```
+
+## Troubleshooting
+
+### Connection Issues
+
+**Problem:** Cannot connect to 9Router
+```bash
+# Check if 9Router is running
+curl http://localhost:20128/health
+
+# Expected response:
+{"status": "ok"}
+```
+
+**Solution:**
+- Verify 9Router is running
+- Check port 20128 is not blocked
+- Ensure correct base URL (include `/v1`)
+
+### Authentication Errors
+
+**Problem:** 401 Unauthorized
+```
+Error: Invalid API key
+```
+
+**Solution:**
+- Verify API key from dashboard
+- Check Authorization header format: `Bearer your-api-key`
+- Ensure no extra spaces or newlines in API key
+
+### Model Not Found
+
+**Problem:** 404 Model not found
+```
+Error: Model 'cc/claude-opus' not found
+```
+
+**Solution:**
+- Use exact model name (case-sensitive)
+- Check available models: `curl http://localhost:20128/v1/models`
+- Verify model is enabled in your plan
+
+### Timeout Issues
+
+**Problem:** Request timeout
+```
+Error: Request timed out after 30s
+```
+
+**Solution:**
+- Increase timeout in client configuration
+- Use faster models for time-sensitive tasks
+- Check network connection to 9Router
+
+### Rate Limiting
+
+**Problem:** 429 Too Many Requests
+```
+Error: Rate limit exceeded
+```
+
+**Solution:**
+- Implement exponential backoff
+- Reduce request frequency
+- Check rate limits in dashboard
+- Consider upgrading plan
+
+## Best Practices
+
+### Security
+- Store API keys in environment variables
+- Never commit API keys to version control
+- Use HTTPS for cloud deployments
+- Rotate API keys regularly
+
+### Performance
+- Use appropriate models for task complexity
+- Implement caching for repeated queries
+- Use streaming for long responses
+- Batch requests when possible
+
+### Error Handling
+- Always implement try-catch blocks
+- Add retry logic with exponential backoff
+- Log errors for debugging
+- Provide fallback mechanisms
+
+### Cost Optimization
+- Choose cost-effective models for simple tasks
+- Cache responses when appropriate
+- Monitor usage in dashboard
+- Set request limits in code
+
+## Next Steps
+
+- [Configure Cursor](cursor.md) for IDE integration
+- [Set up Continue](continue.md) for VSCode
+- [Explore CLI usage](../cli/basic-usage.md)
+- [Learn about model selection](../models/overview.md)
+- [API Reference](../api/reference.md)
diff --git a/gitbook/content/en/integration/roo.md b/gitbook/content/en/integration/roo.md
new file mode 100644
index 0000000..4ad7141
--- /dev/null
+++ b/gitbook/content/en/integration/roo.md
@@ -0,0 +1,127 @@
+# Roo AI Assistant Integration
+
+Integrate 9Router with Roo AI Assistant to access multiple AI models through a unified interface.
+
+## Prerequisites
+
+- Roo AI Assistant installed
+- 9Router API key from [dashboard](https://9router.com/dashboard)
+- 9Router running (local or cloud)
+
+## Configuration Steps
+
+### 1. Open Roo Settings
+
+Launch Roo AI Assistant and open the settings panel.
+
+### 2. Configure API Provider
+
+1. Navigate to **API Provider** settings
+2. Select **Ollama** as the provider type
+3. Configure the following settings:
+
+**For Local 9Router:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+```
+
+**For Cloud 9Router:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+```
+
+### 3. Select Model
+
+Choose from available 9Router models:
+
+**Claude Models:**
+- `cc/claude-opus-4-5-20251101` - Most capable
+- `cc/claude-sonnet-4-20250514` - Balanced
+- `cc/claude-haiku-4-20250514` - Fast
+
+**DeepSeek Models:**
+- `cx/deepseek-chat` - General purpose
+- `cx/deepseek-reasoner` - Complex reasoning
+
+**GLM Models:**
+- `glm/glm-4-plus` - Advanced
+- `glm/glm-4-flash` - Fast responses
+
+### 4. Test Connection
+
+Send a test message to verify the integration:
+
+```
+Hello! Can you confirm you're connected through 9Router?
+```
+
+## Usage Examples
+
+### Basic Chat
+```
+Ask Roo: "Explain quantum computing in simple terms"
+Model: cc/claude-sonnet-4-20250514
+```
+
+### Code Generation
+```
+Ask Roo: "Write a Python function to calculate Fibonacci numbers"
+Model: cx/deepseek-chat
+```
+
+### Complex Reasoning
+```
+Ask Roo: "Analyze the trade-offs between microservices and monolithic architecture"
+Model: cx/deepseek-reasoner
+```
+
+## Model Selection Tips
+
+- **Quick tasks**: Use `cc/claude-haiku-4-20250514` or `glm/glm-4-flash`
+- **Balanced performance**: Use `cc/claude-sonnet-4-20250514` or `cx/deepseek-chat`
+- **Complex reasoning**: Use `cc/claude-opus-4-5-20251101` or `cx/deepseek-reasoner`
+- **Cost optimization**: Use DeepSeek or GLM models
+
+## Troubleshooting
+
+### Connection Failed
+- Verify 9Router is running: `curl http://localhost:20128/health`
+- Check API key is correct
+- Ensure Base URL includes `/v1` suffix
+
+### Model Not Available
+- Check model name matches exactly (case-sensitive)
+- Verify model is enabled in your 9Router plan
+- Try a different model from the list
+
+### Slow Responses
+- Switch to faster models (haiku, flash)
+- Check network connection
+- Monitor 9Router logs for issues
+
+## Advanced Configuration
+
+### Custom Model Aliases
+
+You can create shortcuts for frequently used models in Roo settings:
+
+```
+Alias: "fast" → cc/claude-haiku-4-20250514
+Alias: "smart" → cc/claude-opus-4-5-20251101
+Alias: "code" → cx/deepseek-chat
+```
+
+### Multiple Profiles
+
+Set up different profiles for different use cases:
+- **Development**: DeepSeek models for code
+- **Writing**: Claude models for content
+- **Research**: Reasoner models for analysis
+
+## Next Steps
+
+- [Configure Cursor](cursor.md) for IDE integration
+- [Set up Continue](continue.md) for VSCode
+- [Explore CLI usage](../cli/basic-usage.md)
diff --git a/gitbook/content/en/providers/cheap.md b/gitbook/content/en/providers/cheap.md
new file mode 100644
index 0000000..1e97f2f
--- /dev/null
+++ b/gitbook/content/en/providers/cheap.md
@@ -0,0 +1,462 @@
+# Cheap Providers - Ultra-Cheap Backup
+
+When subscription quota runs out, pay pennies instead of dollars. ~90% cheaper than ChatGPT API!
+
+---
+
+## Overview
+
+Cheap tier providers are your **backup** when subscription quota exhausted:
+
+- 💰 **GLM-4.7** - $0.6/$2.2 per 1M tokens (daily reset)
+- 💰 **MiniMax M2.1** - $0.2/$1.0 per 1M tokens (5h reset)
+- 💰 **Kimi K2** - $9/month flat (10M tokens)
+
+**Strategy:** Use after subscription quota out, before free tier. Massive cost savings vs ChatGPT API ($20/1M).
+
+---
+
+## GLM-4.7 (Daily Reset)
+
+### Pricing
+
+| Tier | Input | Output | Reset |
+|------|-------|--------|-------|
+| Standard | $0.60/1M | $2.20/1M | Daily 10:00 AM |
+| Coding Plan | $0.60/1M | $2.20/1M | Daily 10:00 AM (3× quota) |
+
+**Cost Example (10M tokens):**
+- Input: 10M × $0.60 = $6
+- Output: 10M × $2.20 = $22
+- **Total: $6-22** vs $200 on ChatGPT API!
+
+### Setup
+
+**Step 1: Sign Up**
+
+1. Visit [Zhipu AI](https://open.bigmodel.cn/)
+2. Create account (phone verification)
+3. Choose **Coding Plan** for 3× quota at same price
+
+**Step 2: Get API Key**
+
+```bash
+Dashboard → API Keys → Create New
+→ Copy API key (starts with "zhipu-")
+```
+
+**Step 3: Add to 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: glm
+API Key: zhipu-your-api-key-here
+```
+
+**Step 4: Use in CLI**
+
+```
+Model: glm/glm-4.7
+ glm/glm-4.6v (vision)
+```
+
+### Available Models
+
+| Model ID | Description | Context | Best For |
+|----------|-------------|---------|----------|
+| `glm/glm-4.7` | GLM 4.7 | 128K | Coding, general tasks |
+| `glm/glm-4.6v` | GLM 4.6V Vision | 128K | Image analysis |
+
+### Pro Tips
+
+- **Coding Plan** - 3× quota at same price ($0.6/$2.2)
+- **Daily reset** - Fresh quota at 10:00 AM Beijing time
+- **Best for coding** - Optimized for code generation
+- **128K context** - Handle large files
+
+### Quota Reset
+
+```
+Daily reset: 10:00 AM Beijing Time (UTC+8)
+→ 2:00 AM UTC
+→ 6:00 PM PST (previous day)
+→ 9:00 PM EST (previous day)
+
+Plan your heavy tasks around reset time!
+```
+
+---
+
+## MiniMax M2.1 (5-Hour Reset)
+
+### Pricing
+
+| Tier | Input | Output | Reset |
+|------|-------|--------|-------|
+| Standard | $0.20/1M | $1.00/1M | 5-hour rolling |
+
+**Cost Example (10M tokens):**
+- Input: 10M × $0.20 = $2
+- Output: 10M × $1.00 = $10
+- **Total: $2-10** - Cheapest option!
+
+### Setup
+
+**Step 1: Sign Up**
+
+1. Visit [MiniMax](https://www.minimax.io/)
+2. Create account
+3. Verify email/phone
+
+**Step 2: Get API Key**
+
+```bash
+Dashboard → API Management → Create Key
+→ Copy API key
+```
+
+**Step 3: Add to 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: minimax
+API Key: your-minimax-api-key
+```
+
+**Step 4: Use in CLI**
+
+```
+Model: minimax/MiniMax-M2.1
+```
+
+### Available Models
+
+| Model ID | Description | Context | Best For |
+|----------|-------------|---------|----------|
+| `minimax/MiniMax-M2.1` | MiniMax M2.1 | 1M tokens | Long context, coding |
+
+### Pro Tips
+
+- **Cheapest option** - $0.20/1M input (90% cheaper than ChatGPT)
+- **5-hour rolling** - Quota resets every 5 hours
+- **1M context** - Massive context window
+- **Best for long files** - Handle entire codebases
+
+### Quota Reset
+
+```
+5-hour rolling window:
+→ Use quota → Wait 5 hours → Fresh quota
+
+Example:
+10:00 AM - Use 5M tokens
+3:00 PM - Fresh quota available
+8:00 PM - Fresh quota available
+
+Code 24/7 with minimal cost!
+```
+
+---
+
+## Kimi K2 (Flat $9/month)
+
+### Pricing
+
+| Plan | Monthly Cost | Included Tokens | Effective Cost |
+|------|--------------|-----------------|----------------|
+| Subscription | $9 | 10M tokens | $0.90/1M |
+
+**Cost Example:**
+- $9/month flat
+- 10M tokens included
+- **Effective: $0.90/1M** - Best value for consistent usage!
+
+### Setup
+
+**Step 1: Subscribe**
+
+1. Visit [Moonshot AI](https://platform.moonshot.ai/)
+2. Create account
+3. Subscribe to $9/month plan
+
+**Step 2: Get API Key**
+
+```bash
+Dashboard → API Keys → Create New
+→ Copy API key
+```
+
+**Step 3: Add to 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: kimi
+API Key: your-kimi-api-key
+```
+
+**Step 4: Use in CLI**
+
+```
+Model: kimi/kimi-latest
+```
+
+### Available Models
+
+| Model ID | Description | Context | Best For |
+|----------|-------------|---------|----------|
+| `kimi/kimi-latest` | Kimi Latest | 200K | General coding |
+
+### Pro Tips
+
+- **Fixed cost** - $9/month regardless of usage (up to 10M)
+- **Best for consistent usage** - If you use 10M/month, only $0.90/1M
+- **Monthly reset** - 10M tokens reset monthly
+- **Predictable billing** - No surprise costs
+
+### Quota Reset
+
+```
+Monthly reset: 1st of each month
+→ 10M tokens refresh
+
+Example monthly usage:
+Week 1: 3M tokens
+Week 2: 2M tokens
+Week 3: 3M tokens
+Week 4: 2M tokens
+Total: 10M tokens = $9 flat
+```
+
+---
+
+## Pricing Comparison
+
+| Provider | Input/1M | Output/1M | Reset | 10M Cost | Best For |
+|----------|----------|-----------|-------|----------|----------|
+| **GLM-4.7** | $0.60 | $2.20 | Daily 10AM | $6-22 | Daily quota users |
+| **MiniMax M2.1** | $0.20 | $1.00 | 5-hour | $2-10 | **Cheapest!** |
+| **Kimi K2** | $0.90 | $0.90 | Monthly | **$9 flat** | Consistent usage |
+| ChatGPT API | $20.00 | $20.00 | None | $200 | ❌ Expensive |
+
+**Savings:** 90-95% cheaper than ChatGPT API!
+
+---
+
+## Usage Example
+
+### Cursor IDE Setup
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: glm/glm-4.7
+```
+
+### Create Combo (Recommended)
+
+```
+Dashboard → Combos → Create New
+
+Name: cheap-backup
+Models:
+ 1. cc/claude-opus-4-5 (Subscription primary)
+ 2. glm/glm-4.7 (Cheap backup, daily reset)
+ 3. minimax/MiniMax-M2.1 (Cheapest fallback)
+ 4. if/kimi-k2-thinking (FREE emergency)
+
+Use in CLI: cheap-backup
+```
+
+**Result:** Subscription → Cheap → Cheapest → Free
+
+---
+
+## Cost Optimization
+
+### Strategy 1: Daily Reset Routine
+
+```
+Morning (10AM): Fresh GLM quota
+→ Use GLM for heavy tasks
+→ Save subscription quota
+
+Afternoon: Subscription quota
+→ Use Claude/Codex for complex tasks
+
+Evening: MiniMax (5h reset)
+→ Cheap fallback for late work
+
+Night: Free tier (iFlow)
+→ Zero cost emergency backup
+```
+
+### Strategy 2: Budget-First
+
+```
+Set monthly budget: $20
+
+Allocation:
+- $9 Kimi K2 (10M tokens flat)
+- $6 GLM daily quota (10M tokens)
+- $5 MiniMax overflow (25M tokens)
+
+Total: 45M tokens for $20
+vs 1M tokens for $20 on ChatGPT API!
+```
+
+### Strategy 3: Maximize Subscriptions First
+
+```
+Priority:
+1. Gemini CLI (180K/month FREE)
+2. Claude Code (subscription you already pay)
+3. GLM-4.7 (cheap backup, $0.6/1M)
+4. MiniMax M2.1 (cheapest, $0.2/1M)
+5. iFlow (FREE emergency)
+
+Monthly cost example (100M tokens):
+- 60M via Gemini CLI: $0 (free)
+- 30M via Claude Code: $0 (subscription)
+- 8M via GLM: $4.80
+- 2M via MiniMax: $0.40
+Total: $5.20/month!
+```
+
+---
+
+## Real-World Examples
+
+### Example 1: Heavy Coding Month (100M tokens)
+
+```
+Breakdown:
+- 60M via subscription (Claude/Codex): $0 extra
+- 30M via GLM-4.7: $18
+- 10M via MiniMax M2.1: $2
+
+Total: $20/month
+vs $2000 on ChatGPT API!
+
+Savings: 99% cheaper!
+```
+
+### Example 2: Budget Coder ($10/month)
+
+```
+Strategy:
+- $9 Kimi K2 (10M tokens)
+- $1 MiniMax overflow (5M tokens)
+
+Total: 15M tokens for $10
+vs 0.5M tokens for $10 on ChatGPT API!
+
+30× more tokens!
+```
+
+### Example 3: Freelancer (Variable Usage)
+
+```
+Light month (20M tokens):
+- 15M via subscription: $0
+- 5M via GLM: $3
+Total: $3
+
+Heavy month (150M tokens):
+- 60M via subscription: $0
+- 60M via GLM: $36
+- 30M via MiniMax: $6
+Total: $42
+
+Average: $22.50/month
+vs $3400 on ChatGPT API!
+```
+
+---
+
+## Best Practices
+
+### 1. Track Daily Quota
+
+```
+Dashboard shows:
+- GLM quota: 75% used (reset in 6h)
+- MiniMax quota: 50% used (reset in 2h)
+- Kimi quota: 8M/10M used (reset in 15 days)
+
+Plan heavy tasks around reset times!
+```
+
+### 2. Use Coding Plan (GLM)
+
+```
+Standard: 1× quota
+Coding Plan: 3× quota (same price!)
+
+→ Always choose Coding Plan
+```
+
+### 3. Combine with Free Tier
+
+```
+Combo:
+1. gc/gemini-3-flash (FREE primary)
+2. glm/glm-4.7 (cheap backup)
+3. minimax/MiniMax-M2.1 (cheapest)
+4. if/kimi-k2-thinking (FREE emergency)
+
+Result: Minimize costs, maximize uptime
+```
+
+### 4. Set Budget Alerts
+
+```
+Dashboard → Settings → Budget Alerts
+
+Daily: $2 limit
+Weekly: $10 limit
+Monthly: $30 limit
+
+→ Auto switch to free tier when limit reached
+```
+
+---
+
+## Troubleshooting
+
+### "Quota exhausted"
+
+**Solution:**
+- GLM: Wait until 10:00 AM Beijing time
+- MiniMax: Wait 5 hours from first use
+- Kimi: Wait until 1st of next month
+- Use combo fallback to free tier
+
+### "API key invalid"
+
+**Solution:**
+- Check API key copied correctly
+- Verify account has credits
+- Regenerate API key if needed
+
+### "High costs"
+
+**Solution:**
+- Check usage stats in Dashboard
+- Set budget alerts
+- Switch to MiniMax ($0.2/1M cheapest)
+- Use free tier for non-critical tasks
+
+---
+
+## Next Steps
+
+- **Add free fallback:** [Free Providers](./free.md)
+- **Setup subscriptions:** [Subscription Providers](./subscription.md)
+- **Create combos:** Dashboard → Combos → Create New
diff --git a/gitbook/content/en/providers/free.md b/gitbook/content/en/providers/free.md
new file mode 100644
index 0000000..c80a3e1
--- /dev/null
+++ b/gitbook/content/en/providers/free.md
@@ -0,0 +1,442 @@
+# Free Providers - Zero Cost Fallback
+
+Emergency backup when everything else is quota-limited. Code 24/7 with zero cost!
+
+---
+
+## Overview
+
+Free tier providers are your **fallback** when subscription and cheap quota exhausted:
+
+- 🆓 **iFlow** - 8 models FREE (Kimi K2, Qwen3, GLM 4.7, MiniMax M2...)
+- 🆓 **Qwen** - 3 models FREE (Qwen3 Coder Plus/Flash, Vision)
+- 🆓 **Kiro** - 2 models FREE (Claude Sonnet 4.5, Haiku 4.5)
+
+**Strategy:** Use as emergency backup. Unlimited usage, zero cost forever!
+
+---
+
+## iFlow (8 FREE Models)
+
+### Pricing
+
+| Plan | Monthly Cost | Models | Quota |
+|------|--------------|--------|-------|
+| FREE | $0 | 8 models | Unlimited |
+
+**Best Value:** Most models in free tier! Kimi K2, Qwen3, GLM, MiniMax, DeepSeek.
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect iFlow
+```
+
+**Step 2: iFlow OAuth Login**
+
+- Click "Connect iFlow"
+- Browser opens → iFlow login page
+- Create account or login
+- Grant permissions
+- Auto token refresh enabled
+
+**Step 3: Use in CLI**
+
+```
+Model: if/kimi-k2-thinking
+ if/kimi-k2
+ if/qwen3-coder-plus
+ if/glm-4.7
+ if/minimax-m2
+ if/deepseek-r1
+ if/deepseek-v3.2-chat
+ if/deepseek-v3.2-reasoner
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `if/kimi-k2-thinking` | Kimi K2 Thinking | Complex reasoning |
+| `if/kimi-k2` | Kimi K2 | General coding |
+| `if/qwen3-coder-plus` | Qwen3 Coder Plus | Code generation |
+| `if/glm-4.7` | GLM 4.7 | Chinese + English |
+| `if/minimax-m2` | MiniMax M2 | Long context |
+| `if/deepseek-r1` | DeepSeek R1 | Reasoning tasks |
+| `if/deepseek-v3.2-chat` | DeepSeek V3.2 Chat | Conversational |
+| `if/deepseek-v3.2-reasoner` | DeepSeek V3.2 Reasoner | Complex logic |
+
+### Pro Tips
+
+- **8 models FREE** - Most variety in free tier
+- **Unlimited usage** - No quota limits
+- **Kimi K2 Thinking** - Best for complex reasoning
+- **DeepSeek R1** - Strong reasoning capabilities
+
+---
+
+## Qwen (3 FREE Models)
+
+### Pricing
+
+| Plan | Monthly Cost | Models | Quota |
+|------|--------------|--------|-------|
+| FREE | $0 | 3 models | Unlimited |
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Qwen
+```
+
+**Step 2: Device Code Authorization**
+
+- Click "Connect Qwen"
+- Dashboard shows device code
+- Visit authorization URL
+- Enter device code
+- Login to Qwen account
+- Auto token refresh enabled
+
+**Step 3: Use in CLI**
+
+```
+Model: qw/qwen3-coder-plus
+ qw/qwen3-coder-flash
+ qw/vision-model
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `qw/qwen3-coder-plus` | Qwen3 Coder Plus | Advanced coding |
+| `qw/qwen3-coder-flash` | Qwen3 Coder Flash | Fast responses |
+| `qw/vision-model` | Qwen3 Vision | Image analysis |
+
+### Pro Tips
+
+- **Qwen3 Coder Plus** - Strong coding capabilities
+- **Qwen3 Coder Flash** - Fast for quick tasks
+- **Vision model** - FREE image analysis
+- **Unlimited usage** - No quota limits
+
+---
+
+## Kiro (Claude FREE)
+
+### Pricing
+
+| Plan | Monthly Cost | Models | Quota |
+|------|--------------|--------|-------|
+| FREE | $0 | Claude Sonnet 4.5, Haiku 4.5 | Unlimited |
+
+**Best Value:** FREE Claude! Same quality as paid Claude Code.
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Kiro
+```
+
+**Step 2: AWS Builder ID or OAuth**
+
+- Click "Connect Kiro"
+- Choose login method:
+ - AWS Builder ID (recommended)
+ - Google account
+ - GitHub account
+- Grant permissions
+- Auto token refresh enabled
+
+**Step 3: Use in CLI**
+
+```
+Model: kr/claude-sonnet-4.5
+ kr/claude-haiku-4.5
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `kr/claude-sonnet-4.5` | Claude Sonnet 4.5 | Balanced quality/speed |
+| `kr/claude-haiku-4.5` | Claude Haiku 4.5 | Fast responses |
+
+### Pro Tips
+
+- **FREE Claude** - Same quality as paid tier
+- **AWS Builder ID** - Easy setup with AWS account
+- **Unlimited usage** - No quota limits
+- **Best quality** - Claude 4.5 for free!
+
+---
+
+## Feature Comparison
+
+| Provider | Models | Best Model | Setup | Quota |
+|----------|--------|------------|-------|-------|
+| **iFlow** | 8 | Kimi K2 Thinking | OAuth | Unlimited |
+| **Qwen** | 3 | Qwen3 Coder Plus | Device Code | Unlimited |
+| **Kiro** | 2 | Claude Sonnet 4.5 | AWS Builder ID | Unlimited |
+
+**Winner:** iFlow for variety, Kiro for quality!
+
+---
+
+## Usage Example
+
+### Cursor IDE Setup
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: if/kimi-k2-thinking
+```
+
+### Create Combo (Recommended)
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking (iFlow primary)
+ 2. qw/qwen3-coder-plus (Qwen backup)
+ 3. kr/claude-sonnet-4.5 (Kiro quality)
+
+Use in CLI: free-combo
+```
+
+**Result:** Zero cost, maximum uptime!
+
+---
+
+## Full Fallback Strategy
+
+### Complete 3-Tier Combo
+
+```
+Dashboard → Combos → Create New
+
+Name: complete-fallback
+Models:
+ 1. gc/gemini-3-flash-preview (FREE subscription)
+ 2. cc/claude-opus-4-5 (Paid subscription)
+ 3. glm/glm-4.7 (Cheap backup, $0.6/1M)
+ 4. minimax/MiniMax-M2.1 (Cheapest, $0.2/1M)
+ 5. if/kimi-k2-thinking (FREE fallback)
+ 6. kr/claude-sonnet-4.5 (FREE quality)
+
+Use in CLI: complete-fallback
+```
+
+**Result:**
+- Tier 1: FREE subscription (Gemini CLI)
+- Tier 2: Paid subscription (Claude Code)
+- Tier 3: Cheap backup (GLM, MiniMax)
+- Tier 4: FREE fallback (iFlow, Kiro)
+
+**Never stop coding!**
+
+---
+
+## Best Practices
+
+### 1. Use as Emergency Backup
+
+```
+Priority:
+1. Subscription tier (maximize paid quota)
+2. Cheap tier (pennies per 1M tokens)
+3. FREE tier (unlimited, zero cost)
+
+Only use free tier when:
+- Subscription quota exhausted
+- Budget limit reached
+- Testing/non-critical tasks
+```
+
+### 2. Choose Right Model
+
+```
+Complex reasoning: if/kimi-k2-thinking
+Fast coding: qw/qwen3-coder-flash
+Best quality: kr/claude-sonnet-4.5
+Long context: if/minimax-m2
+Vision tasks: qw/vision-model
+```
+
+### 3. Create Free-Only Combo
+
+```
+For zero-cost coding:
+
+Name: zero-cost
+Models:
+ 1. kr/claude-sonnet-4.5 (Best quality)
+ 2. if/kimi-k2-thinking (Complex tasks)
+ 3. qw/qwen3-coder-plus (Fast coding)
+
+Cost: $0 forever!
+```
+
+### 4. Test Before Production
+
+```
+Use free tier to:
+- Test prompts
+- Prototype features
+- Learn new frameworks
+- Non-critical tasks
+
+Save paid quota for:
+- Production code
+- Complex refactoring
+- Critical features
+```
+
+---
+
+## Real-World Examples
+
+### Example 1: Student/Learner (Zero Budget)
+
+```
+Setup:
+1. kr/claude-sonnet-4.5 (Best quality)
+2. if/kimi-k2-thinking (Complex reasoning)
+3. qw/qwen3-coder-plus (Fast coding)
+
+Monthly cost: $0
+Usage: Unlimited
+
+Perfect for:
+- Learning to code
+- Personal projects
+- Homework/assignments
+```
+
+### Example 2: Freelancer (Budget-Conscious)
+
+```
+Setup:
+1. gc/gemini-3-flash-preview (FREE 180K/month)
+2. glm/glm-4.7 (Cheap backup, $0.6/1M)
+3. if/kimi-k2-thinking (FREE fallback)
+
+Monthly cost: $5-10
+Usage: 100M+ tokens
+
+Perfect for:
+- Client projects (paid tier)
+- Testing (free tier)
+- Emergency backup
+```
+
+### Example 3: Heavy User (Maximize Everything)
+
+```
+Setup:
+1. gc/gemini-3-flash-preview (FREE 180K/month)
+2. cc/claude-opus-4-5 (Subscription $20-100)
+3. cx/gpt-5.2-codex (Subscription $20-200)
+4. glm/glm-4.7 (Cheap $0.6/1M)
+5. minimax/MiniMax-M2.1 (Cheapest $0.2/1M)
+6. if/kimi-k2-thinking (FREE unlimited)
+7. kr/claude-sonnet-4.5 (FREE quality)
+
+Monthly cost: $40-320 (subscriptions) + $10-20 (cheap tier)
+Usage: 500M+ tokens
+
+Perfect for:
+- Professional development
+- Team projects
+- 24/7 coding
+```
+
+---
+
+## Cost Comparison
+
+### Scenario: 100M tokens/month
+
+**Option 1: ChatGPT API Only**
+```
+100M × $20/1M = $2,000/month
+```
+
+**Option 2: 9Router Free Tier Only**
+```
+100M via free tier = $0/month
+Savings: $2,000/month (100%)
+```
+
+**Option 3: 9Router Complete Strategy**
+```
+60M via Gemini CLI (FREE): $0
+30M via Claude Code (subscription): $0 extra
+8M via GLM (cheap): $4.80
+2M via iFlow (FREE): $0
+Total: $4.80/month + subscriptions you already have
+Savings: $1,995/month (99.76%)
+```
+
+---
+
+## Troubleshooting
+
+### "OAuth failed"
+
+**Solution:**
+- Check internet connection
+- Try different browser
+- Clear browser cache
+- Reconnect in dashboard
+
+### "Model not available"
+
+**Solution:**
+- Check provider connected in dashboard
+- Verify OAuth token valid
+- Reconnect provider if needed
+
+### "Slow responses"
+
+**Solution:**
+- Free tier may have lower priority
+- Use during off-peak hours
+- Switch to different free provider
+- Upgrade to cheap tier for speed
+
+---
+
+## Limitations
+
+### Free Tier Considerations
+
+- **Speed** - May be slower than paid tiers
+- **Priority** - Lower priority during peak hours
+- **Rate limits** - Possible rate limiting (but unlimited quota)
+- **Availability** - May have occasional downtime
+
+**Solution:** Use 3-tier fallback strategy for reliability!
+
+---
+
+## Next Steps
+
+- **Setup subscriptions:** [Subscription Providers](./subscription.md)
+- **Add cheap backup:** [Cheap Providers](./cheap.md)
+- **Create combos:** Dashboard → Combos → Create New
+- **Start coding:** Use `complete-fallback` combo for maximum reliability
diff --git a/gitbook/content/en/providers/subscription.md b/gitbook/content/en/providers/subscription.md
new file mode 100644
index 0000000..830f429
--- /dev/null
+++ b/gitbook/content/en/providers/subscription.md
@@ -0,0 +1,404 @@
+# Subscription Providers - Maximize Your Value
+
+Maximize your existing AI subscriptions with smart quota tracking and automatic fallback. Use every bit of your subscription before it resets!
+
+---
+
+## Overview
+
+Subscription tier providers are your **primary** choice - you're already paying for them, so get full value:
+
+- ✅ **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- ✅ **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex, GPT 5.1 Codex Max
+- ✅ **Gemini CLI** (FREE tier!) - 180K completions/month
+- ✅ **GitHub Copilot** - GPT-5, Claude 4.5, Gemini 3
+- ✅ **Antigravity** (Google) - Gemini 3 Pro, Claude Sonnet 4.5
+
+**Strategy:** Use these first, track quota in real-time, fallback to cheap/free when exhausted.
+
+---
+
+## Claude Code (Pro/Max)
+
+### Pricing
+
+| Plan | Monthly Cost | Quota Reset | Models |
+|------|--------------|-------------|--------|
+| Pro | $20 | 5-hour + Weekly | Opus, Sonnet, Haiku |
+| Max | $100 | 5-hour + Weekly | Opus, Sonnet, Haiku |
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard opens → Providers → Connect Claude Code
+```
+
+**Step 2: OAuth Login**
+
+- Click "Connect Claude Code"
+- Browser opens → Login to Claude.ai
+- Auto token refresh enabled
+- Quota tracking starts
+
+**Step 3: Use in CLI**
+
+```
+Model: cc/claude-opus-4-5-20251101
+ cc/claude-sonnet-4-5-20250929
+ cc/claude-haiku-4-5-20251001
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `cc/claude-opus-4-5-20251101` | Claude 4.5 Opus | Complex tasks, architecture |
+| `cc/claude-sonnet-4-5-20250929` | Claude 4.5 Sonnet | Balanced speed/quality |
+| `cc/claude-haiku-4-5-20251001` | Claude 4.5 Haiku | Fast responses |
+
+### Pro Tips
+
+- **Use Opus for complex tasks** - Architecture decisions, refactoring
+- **Use Sonnet for speed** - Quick edits, code generation
+- **Track quota per model** - Dashboard shows usage per model
+- **5-hour reset** - Fresh quota every 5 hours + weekly reset
+
+---
+
+## OpenAI Codex (Plus/Pro)
+
+### Pricing
+
+| Plan | Monthly Cost | Quota Reset | Models |
+|------|--------------|-------------|--------|
+| Plus | $20 | 5-hour + Weekly | GPT 5.2, GPT 5.1 |
+| Pro | $200 | 5-hour + Weekly | GPT 5.2 Codex, GPT 5.1 Max |
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Codex
+```
+
+**Step 2: OAuth Login**
+
+- Click "Connect Codex"
+- Browser opens to `http://localhost:1455`
+- Login to OpenAI account
+- Auto token refresh enabled
+
+**Step 3: Use in CLI**
+
+```
+Model: cx/gpt-5.2-codex
+ cx/gpt-5.1-codex-max
+ cx/gpt-5.2
+ cx/gpt-5.1-codex
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `cx/gpt-5.2-codex` | GPT 5.2 Codex | Latest coding model |
+| `cx/gpt-5.1-codex-max` | GPT 5.1 Codex Max | Maximum context |
+| `cx/gpt-5.2` | GPT 5.2 | General tasks |
+| `cx/gpt-5.1-codex` | GPT 5.1 Codex | Stable coding |
+
+### Pro Tips
+
+- **5-hour rolling quota** - Fresh quota every 5 hours
+- **Weekly reset** - Full quota reset weekly
+- **Pro tier** - 10× more quota than Plus
+
+---
+
+## Gemini CLI (FREE 180K/month!)
+
+### Pricing
+
+| Plan | Monthly Cost | Quota | Reset |
+|------|--------------|-------|-------|
+| FREE | $0 | 180K completions/month + 1K/day | Daily + Monthly |
+
+**Best Value:** Huge free tier! Use this before paid tiers.
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Gemini CLI
+```
+
+**Step 2: Google OAuth**
+
+- Click "Connect Gemini CLI"
+- Browser opens → Login to Google account
+- Grant permissions
+- Auto token refresh enabled
+
+**Step 3: Use in CLI**
+
+```
+Model: gc/gemini-3-flash-preview
+ gc/gemini-3-pro-preview
+ gc/gemini-2.5-pro
+ gc/gemini-2.5-flash
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `gc/gemini-3-flash-preview` | Gemini 3 Flash Preview | Fast responses |
+| `gc/gemini-3-pro-preview` | Gemini 3 Pro Preview | Complex tasks |
+| `gc/gemini-2.5-pro` | Gemini 2.5 Pro | Stable production |
+| `gc/gemini-2.5-flash` | Gemini 2.5 Flash | Quick tasks |
+
+### Pro Tips
+
+- **180K completions/month** - Massive free tier
+- **1K/day limit** - Daily quota resets at midnight
+- **Use first** - Free tier, use before paid subscriptions
+- **No credit card** - Completely free with Google account
+
+---
+
+## GitHub Copilot
+
+### Pricing
+
+| Plan | Monthly Cost | Quota Reset | Models |
+|------|--------------|-------------|--------|
+| Individual | $10 | Monthly (1st) | GPT-5, Claude 4.5, Gemini 3 |
+| Business | $19 | Monthly (1st) | GPT-5, Claude 4.5, Gemini 3 |
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect GitHub
+```
+
+**Step 2: OAuth via GitHub**
+
+- Click "Connect GitHub"
+- Browser opens → Login to GitHub
+- Authorize GitHub Copilot
+- Auto token refresh enabled
+
+**Step 3: Use in CLI**
+
+```
+Model: gh/gpt-5
+ gh/gpt-5.1-codex-max
+ gh/claude-4.5-sonnet
+ gh/gemini-3-pro
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `gh/gpt-5` | GPT-5 | Latest OpenAI model |
+| `gh/gpt-5.1-codex-max` | GPT-5.1 Codex Max | Maximum context |
+| `gh/claude-4.5-sonnet` | Claude 4.5 Sonnet | Anthropic quality |
+| `gh/gemini-3-pro` | Gemini 3 Pro | Google quality |
+
+### Pro Tips
+
+- **Monthly reset** - Full quota reset on 1st of month
+- **Multiple models** - Access GPT, Claude, Gemini in one subscription
+- **Business tier** - Higher quota for teams
+
+---
+
+## Antigravity (Google Account)
+
+### Pricing
+
+| Plan | Monthly Cost | Quota | Models |
+|------|--------------|-------|--------|
+| FREE | $0 | Similar to Gemini CLI | Gemini 3 Pro, Claude Sonnet 4.5 |
+
+### Setup
+
+**Step 1: Connect via Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Antigravity
+```
+
+**Step 2: Google OAuth**
+
+- Click "Connect Antigravity"
+- Browser opens → Login to Google account
+- Grant permissions
+- Auto token refresh enabled
+
+**Step 3: Use in CLI**
+
+```
+Model: ag/gemini-3-pro-high
+ ag/claude-sonnet-4-5
+ ag/claude-opus-4-5-thinking
+```
+
+### Available Models
+
+| Model ID | Description | Best For |
+|----------|-------------|----------|
+| `ag/gemini-3-pro-high` | Gemini 3 Pro High | High-quality responses |
+| `ag/claude-sonnet-4-5` | Claude Sonnet 4.5 | Anthropic quality |
+| `ag/claude-opus-4-5-thinking` | Claude Opus 4.5 Thinking | Complex reasoning |
+
+### Pro Tips
+
+- **Free tier** - No cost with Google account
+- **Claude access** - Free Claude Sonnet/Opus
+- **Quota similar to Gemini CLI** - Daily/monthly limits
+
+---
+
+## Pricing Comparison
+
+| Provider | Monthly Cost | Quota Reset | Value |
+|----------|--------------|-------------|-------|
+| **Claude Code Pro** | $20 | 5-hour + Weekly | ⭐⭐⭐⭐⭐ Best quality |
+| **Claude Code Max** | $100 | 5-hour + Weekly | ⭐⭐⭐⭐⭐ Highest quota |
+| **Codex Plus** | $20 | 5-hour + Weekly | ⭐⭐⭐⭐ Good value |
+| **Codex Pro** | $200 | 5-hour + Weekly | ⭐⭐⭐⭐⭐ 10× quota |
+| **Gemini CLI** | **$0** | Daily + Monthly | ⭐⭐⭐⭐⭐ FREE 180K/month! |
+| **GitHub Copilot** | $10-19 | Monthly (1st) | ⭐⭐⭐⭐ Multi-model |
+| **Antigravity** | **$0** | Daily + Monthly | ⭐⭐⭐⭐ FREE Claude! |
+
+---
+
+## Usage Example
+
+### Cursor IDE Setup
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Create Combo (Recommended)
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. gc/gemini-3-flash-preview (FREE, use first)
+ 2. cc/claude-opus-4-5-20251101 (Subscription)
+ 3. cx/gpt-5.2-codex (Subscription backup)
+
+Use in CLI: premium-coding
+```
+
+**Result:** Maximize free tier → Use subscription → Auto fallback
+
+---
+
+## Quota Tracking
+
+9Router tracks quota in real-time:
+
+- **Token consumption** - Input/output tokens per request
+- **Reset countdown** - Time until next quota reset
+- **Usage percentage** - How much quota used
+- **Auto fallback** - Switch to next tier when exhausted
+
+**Dashboard view:**
+
+```
+Claude Code Pro
+├─ Quota: 75% used
+├─ Reset: 2h 15m (5-hour)
+├─ Weekly reset: 3 days
+└─ Fallback: glm/glm-4.7 (cheap tier)
+```
+
+---
+
+## Best Practices
+
+### 1. Use Free Tier First
+
+```
+Priority:
+1. Gemini CLI (180K/month FREE)
+2. Antigravity (FREE Claude)
+3. Claude Code/Codex (paid subscriptions)
+```
+
+### 2. Track Quota Daily
+
+- Check dashboard every morning
+- Plan heavy tasks around quota resets
+- Use cheap/free tier for non-critical tasks
+
+### 3. Create Smart Combos
+
+```
+Example combo:
+1. gc/gemini-3-flash-preview (FREE primary)
+2. cc/claude-opus-4-5 (Complex tasks)
+3. glm/glm-4.7 (Cheap backup)
+4. if/kimi-k2-thinking (FREE fallback)
+```
+
+### 4. Optimize by Time
+
+```
+Morning: Fresh 5-hour quota (Claude/Codex)
+Afternoon: Gemini CLI (1K/day)
+Evening: Subscription quota
+Night: Cheap/free tier
+```
+
+---
+
+## Troubleshooting
+
+### "Quota exhausted"
+
+**Solution:**
+- Check dashboard quota tracker
+- Wait for reset (5-hour or daily)
+- Use combo fallback to cheap/free tier
+
+### "OAuth token expired"
+
+**Solution:**
+- Auto-refreshed by 9Router
+- If issues: Dashboard → Provider → Reconnect
+
+### "Rate limiting"
+
+**Solution:**
+- Subscription quota out
+- Add fallback: `cc/claude-opus → glm/glm-4.7`
+- Use free tier: `if/kimi-k2-thinking`
+
+---
+
+## Next Steps
+
+- **Setup cheap backup:** [Cheap Providers](./cheap.md)
+- **Add free fallback:** [Free Providers](./free.md)
+- **Create combos:** Dashboard → Combos → Create New
diff --git a/gitbook/content/en/troubleshooting.md b/gitbook/content/en/troubleshooting.md
new file mode 100644
index 0000000..5b38fa4
--- /dev/null
+++ b/gitbook/content/en/troubleshooting.md
@@ -0,0 +1,351 @@
+# Troubleshooting
+
+Common issues and solutions when using 9Router.
+
+---
+
+## "Language model did not provide messages"
+
+**Problem:** Request fails with empty response or error message.
+
+**Causes:**
+- Provider quota exhausted
+- API key invalid or expired
+- Model not available
+
+**Solutions:**
+
+1. **Check quota status:**
+ ```
+ Dashboard → Providers → View quota tracker
+ ```
+ If quota is exhausted, wait for reset or switch provider.
+
+2. **Use combo fallback:**
+ ```
+ Dashboard → Combos → Create fallback chain
+ Example: cc/claude-opus → glm/glm-4.7 → if/kimi-k2
+ ```
+
+3. **Verify provider connection:**
+ ```
+ Dashboard → Providers → Reconnect if needed
+ ```
+
+---
+
+## Rate Limiting
+
+**Problem:** "Rate limit exceeded" or "Too many requests" errors.
+
+**Causes:**
+- Subscription quota depleted (5-hour/daily/weekly limits)
+- API rate limits hit
+- Too many concurrent requests
+
+**Solutions:**
+
+1. **Check reset time:**
+ ```
+ Dashboard → Quota Tracking → View reset countdown
+ ```
+
+2. **Switch to cheap tier:**
+ ```
+ Use: glm/glm-4.7 ($0.6/1M tokens)
+ minimax/MiniMax-M2.1 ($0.20/1M tokens)
+ ```
+
+3. **Add fallback combo:**
+ ```
+ Dashboard → Combos → Add backup models
+ Primary: cc/claude-opus (subscription)
+ Backup: glm/glm-4.7 (cheap)
+ Emergency: if/kimi-k2 (free)
+ ```
+
+---
+
+## OAuth Token Expired
+
+**Problem:** "Unauthorized" or "Token expired" errors.
+
+**Causes:**
+- OAuth token expired (auto-refresh failed)
+- Provider session invalidated
+- Network issues during refresh
+
+**Solutions:**
+
+1. **Auto-refresh (default):**
+ 9Router automatically refreshes tokens. Wait 30 seconds and retry.
+
+2. **Manual reconnect:**
+ ```
+ Dashboard → Providers → [Provider Name] → Reconnect
+ → Complete OAuth flow again
+ ```
+
+3. **Check provider status:**
+ Verify provider service is online (Claude Code, Codex, etc.)
+
+---
+
+## High Costs
+
+**Problem:** Unexpected high usage or costs.
+
+**Causes:**
+- Using expensive models unnecessarily
+- No fallback to cheaper tiers
+- Large context windows
+
+**Solutions:**
+
+1. **Check usage stats:**
+ ```
+ Dashboard → Usage Stats → View token consumption
+ → Identify high-cost models
+ ```
+
+2. **Switch to cheaper models:**
+ ```
+ Replace: cc/claude-opus ($20-100/month subscription)
+ With: glm/glm-4.7 ($0.6/1M tokens)
+ minimax/MiniMax-M2.1 ($0.20/1M tokens)
+ ```
+
+3. **Use free tier:**
+ ```
+ if/kimi-k2-thinking (FREE)
+ qw/qwen3-coder-plus (FREE)
+ kr/claude-sonnet-4.5 (FREE)
+ gc/gemini-3-flash-preview (FREE 180K/month)
+ ```
+
+4. **Optimize prompts:**
+ - Reduce context size
+ - Use streaming for long responses
+ - Cache common prompts
+
+---
+
+## Connection Refused
+
+**Problem:** "ECONNREFUSED" or "Cannot connect to localhost:20128".
+
+**Causes:**
+- 9Router not running
+- Port 20128 blocked
+- Firewall blocking connection
+
+**Solutions:**
+
+1. **Start 9Router:**
+ ```bash
+ 9router
+ ```
+ Dashboard should open at http://localhost:3000
+
+2. **Verify port 20128:**
+ ```bash
+ # Check if port is listening
+ lsof -i :20128
+
+ # Or on Windows
+ netstat -ano | findstr :20128
+ ```
+
+3. **Check firewall:**
+ - macOS: System Settings → Network → Firewall
+ - Windows: Windows Defender Firewall → Allow app
+ - Linux: `sudo ufw allow 20128`
+
+4. **Use cloud endpoint:**
+ If localhost doesn't work (e.g., Cursor IDE):
+ ```
+ Endpoint: https://9router.com/v1
+ ```
+
+---
+
+## Dashboard Not Opening
+
+**Problem:** Dashboard doesn't load at http://localhost:3000.
+
+**Causes:**
+- Port 3000 already in use
+- 9Router crashed
+- Browser cache issues
+
+**Solutions:**
+
+1. **Check if 9Router is running:**
+ ```bash
+ # Check process
+ ps aux | grep 9router
+
+ # Check port 3000
+ lsof -i :3000
+ ```
+
+2. **Kill conflicting process:**
+ ```bash
+ # macOS/Linux
+ lsof -ti:3000 | xargs kill -9
+
+ # Windows
+ netstat -ano | findstr :3000
+ taskkill /PID /F
+ ```
+
+3. **Restart 9Router:**
+ ```bash
+ # Stop
+ pkill -f 9router
+
+ # Start
+ 9router
+ ```
+
+4. **Clear browser cache:**
+ - Chrome: Ctrl+Shift+Delete → Clear cache
+ - Try incognito mode
+
+5. **Check firewall settings:**
+ Ensure port 3000 is not blocked.
+
+---
+
+## Model Not Found
+
+**Problem:** "Model not found" or "Invalid model" errors.
+
+**Causes:**
+- Provider not connected
+- Model ID typo
+- Provider inactive
+
+**Solutions:**
+
+1. **Verify provider connection:**
+ ```
+ Dashboard → Providers → Check status (green = active)
+ ```
+
+2. **Check model ID format:**
+ ```
+ Correct: cc/claude-opus-4-5-20251101
+ Wrong: claude-opus-4-5-20251101
+
+ Format: [provider-prefix]/[model-name]
+ ```
+
+3. **List available models:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+ ```
+
+4. **Reconnect provider:**
+ ```
+ Dashboard → Providers → [Provider] → Reconnect
+ ```
+
+---
+
+## Slow Response
+
+**Problem:** Requests take too long or timeout.
+
+**Causes:**
+- Provider latency
+- Network issues
+- Large context/response
+- Provider rate limiting
+
+**Solutions:**
+
+1. **Check provider status:**
+ ```
+ Dashboard → Providers → View latency stats
+ ```
+
+2. **Switch to faster model:**
+ ```
+ Fast: cc/claude-haiku-4-5 (Haiku is faster than Opus)
+ gc/gemini-3-flash-preview
+ qw/qwen3-coder-flash
+ ```
+
+3. **Use streaming:**
+ ```json
+ {
+ "model": "cc/claude-opus-4-5",
+ "messages": [...],
+ "stream": true
+ }
+ ```
+
+4. **Check network:**
+ ```bash
+ # Test latency
+ ping api.anthropic.com
+ ping api.openai.com
+ ```
+
+5. **Reduce context size:**
+ - Trim message history
+ - Use smaller prompts
+ - Enable context pruning in CLI tool
+
+---
+
+## API Key Invalid
+
+**Problem:** "Invalid API key" or "Authentication failed" errors.
+
+**Causes:**
+- Wrong API key copied
+- API key expired
+- API key not generated
+
+**Solutions:**
+
+1. **Regenerate API key:**
+ ```
+ Dashboard → Settings → API Keys → Generate New Key
+ → Copy and use new key
+ ```
+
+2. **Verify key format:**
+ ```
+ Correct: 9r_xxxxxxxxxxxxxxxxxxxxxxxx
+ Wrong: Missing 9r_ prefix
+ ```
+
+3. **Check key in CLI config:**
+ ```bash
+ # Cursor
+ Settings → Models → OpenAI API Key
+
+ # Cline
+ Settings → API Key
+
+ # Environment variable
+ export OPENAI_API_KEY="9r_your_key"
+ ```
+
+4. **Test API key:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer 9r_your_key"
+ ```
+
+---
+
+## Need More Help?
+
+- **GitHub Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **Documentation:** [9router.com/docs](https://9router.com/docs)
+- **FAQ:** [faq.md](faq.md)
diff --git a/gitbook/content/es/deployment/cloud.md b/gitbook/content/es/deployment/cloud.md
new file mode 100644
index 0000000..560ed9f
--- /dev/null
+++ b/gitbook/content/es/deployment/cloud.md
@@ -0,0 +1,473 @@
+# ☁️ Despliegue en la nube
+
+Despliega 9Router en VPS o Docker para acceso remoto y uso en producción.
+
+---
+
+## 🖥️ Despliegue en VPS
+
+### Requisitos previos
+
+- Ubuntu 20.04+ o distribución Linux similar
+- Node.js 20+
+- Git
+- Acceso root o sudo
+
+### Paso 1: Clonar el repositorio
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+```
+
+### Paso 2: Instalar dependencias
+
+```bash
+npm install
+```
+
+### Paso 3: Compilar la aplicación
+
+```bash
+npm run build
+```
+
+### Paso 4: Configurar variables de entorno
+
+Crea un archivo `.env` o exporta variables:
+
+```bash
+export JWT_SECRET="your-secure-secret-change-this-to-random-string"
+export INITIAL_PASSWORD="your-secure-password"
+export DATA_DIR="/var/lib/9router"
+export NODE_ENV="production"
+```
+
+**Variables de entorno:**
+
+| Variable | Por defecto | Descripción |
+|----------|---------|-------------|
+| `JWT_SECRET` | Auto-generado | **¡DEBE cambiarse en producción!** Usado para firmar tokens JWT |
+| `INITIAL_PASSWORD` | `123456` | Contraseña de login del dashboard |
+| `DATA_DIR` | `~/.9router` | Ruta de almacenamiento de la base de datos |
+| `NODE_ENV` | `development` | Establece a `production` para despliegue |
+| `ENABLE_REQUEST_LOGS` | `false` | Habilita logs de debug de request/response |
+
+### Paso 5: Crear el directorio de datos
+
+```bash
+sudo mkdir -p /var/lib/9router
+sudo chown $USER:$USER /var/lib/9router
+```
+
+### Paso 6: Iniciar la aplicación
+
+```bash
+npm run start
+```
+
+### Paso 7: Configurar PM2 para producción
+
+PM2 mantiene tu aplicación corriendo y la reinicia en caso de crash:
+
+```bash
+# Instalar PM2 globalmente
+npm install -g pm2
+
+# Iniciar 9Router con PM2
+pm2 start npm --name 9router -- start
+
+# Guardar la configuración de PM2
+pm2 save
+
+# Configurar PM2 para iniciar al arrancar el sistema
+pm2 startup
+# Sigue las instrucciones impresas por el comando anterior
+```
+
+**Comandos de gestión de PM2:**
+
+```bash
+# Ver logs
+pm2 logs 9router
+
+# Reiniciar aplicación
+pm2 restart 9router
+
+# Detener aplicación
+pm2 stop 9router
+
+# Ver estado
+pm2 status
+
+# Monitorear recursos
+pm2 monit
+```
+
+---
+
+## 🐳 Despliegue con Docker
+
+### Opción 1: Usando Dockerfile
+
+Crea un `Dockerfile` en el directorio `app`:
+
+```dockerfile
+FROM node:20-alpine
+
+WORKDIR /app
+
+# Copy package files
+COPY package*.json ./
+
+# Install dependencies
+RUN npm ci --only=production
+
+# Copy application files
+COPY . .
+
+# Build application
+RUN npm run build
+
+# Expose ports
+EXPOSE 3000 20128
+
+# Set environment variables
+ENV NODE_ENV=production
+ENV DATA_DIR=/app/data
+
+# Create data directory
+RUN mkdir -p /app/data
+
+# Start application
+CMD ["npm", "run", "start"]
+```
+
+**Build y Run:**
+
+```bash
+# Construir imagen
+docker build -t 9router .
+
+# Ejecutar contenedor
+docker run -d \
+ --name 9router \
+ -p 3000:3000 \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret-change-this" \
+ -e INITIAL_PASSWORD="your-secure-password" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Opción 2: Docker Compose
+
+Crea `docker-compose.yml`:
+
+```yaml
+version: '3.8'
+
+services:
+ 9router:
+ build: .
+ container_name: 9router
+ ports:
+ - "3000:3000"
+ - "20128:20128"
+ environment:
+ - NODE_ENV=production
+ - JWT_SECRET=your-secure-secret-change-this
+ - INITIAL_PASSWORD=your-secure-password
+ - DATA_DIR=/app/data
+ volumes:
+ - 9router-data:/app/data
+ restart: unless-stopped
+
+volumes:
+ 9router-data:
+```
+
+**Ejecutar con Docker Compose:**
+
+```bash
+# Iniciar servicios
+docker-compose up -d
+
+# Ver logs
+docker-compose logs -f
+
+# Detener servicios
+docker-compose down
+
+# Reconstruir y reiniciar
+docker-compose up -d --build
+```
+
+---
+
+## 🌐 Proxy reverso con Nginx
+
+### ¿Por qué usar Nginx?
+
+- Terminación SSL/TLS
+- Mapeo de nombre de dominio
+- Balanceo de carga
+- Mejor seguridad
+
+### Paso 1: Instalar Nginx
+
+```bash
+sudo apt update
+sudo apt install nginx
+```
+
+### Paso 2: Configurar Nginx
+
+Crea `/etc/nginx/sites-available/9router`:
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ # Redirect HTTP to HTTPS
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl http2;
+ server_name your-domain.com;
+
+ # SSL certificates (use certbot to generate)
+ ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
+
+ # SSL configuration
+ ssl_protocols TLSv1.2 TLSv1.3;
+ ssl_ciphers HIGH:!aNULL:!MD5;
+ ssl_prefer_server_ciphers on;
+
+ # Proxy to 9Router
+ location / {
+ proxy_pass http://localhost:3000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+
+ # API endpoint
+ location /v1 {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+### Paso 3: Habilitar el sitio
+
+```bash
+# Crear enlace simbólico
+sudo ln -s /etc/nginx/sites-available/9router /etc/nginx/sites-enabled/
+
+# Probar configuración
+sudo nginx -t
+
+# Recargar Nginx
+sudo systemctl reload nginx
+```
+
+### Paso 4: Configurar SSL con Let's Encrypt
+
+```bash
+# Instalar certbot
+sudo apt install certbot python3-certbot-nginx
+
+# Obtener certificado SSL
+sudo certbot --nginx -d your-domain.com
+
+# La auto-renovación se configura automáticamente
+# Probar renovación
+sudo certbot renew --dry-run
+```
+
+---
+
+## 🔒 Consideraciones de seguridad
+
+### 1. Cambiar credenciales por defecto
+
+**CRÍTICO:** Cambia `JWT_SECRET` y `INITIAL_PASSWORD` antes del despliegue:
+
+```bash
+# Generar JWT secret seguro
+openssl rand -base64 32
+
+# Usa este valor para JWT_SECRET
+export JWT_SECRET="generated-secret-here"
+```
+
+### 2. Configuración del firewall
+
+```bash
+# Permitir SSH
+sudo ufw allow 22/tcp
+
+# Permitir HTTP/HTTPS (si usas Nginx)
+sudo ufw allow 80/tcp
+sudo ufw allow 443/tcp
+
+# Si NO usas proxy reverso, permite los puertos de 9Router
+sudo ufw allow 3000/tcp
+sudo ufw allow 20128/tcp
+
+# Habilitar firewall
+sudo ufw enable
+```
+
+### 3. Restringir el acceso al dashboard
+
+Si solo necesitas acceso por API, restringe el puerto del dashboard:
+
+```bash
+# Solo permitir acceso localhost al dashboard
+sudo ufw deny 3000/tcp
+```
+
+Accede al dashboard vía túnel SSH:
+
+```bash
+ssh -L 3000:localhost:3000 user@your-server.com
+# Luego abre http://localhost:3000 en tu navegador
+```
+
+### 4. Actualizaciones regulares
+
+```bash
+# Actualizar paquetes del sistema
+sudo apt update && sudo apt upgrade -y
+
+# Actualizar 9Router
+cd /path/to/9router/app
+git pull
+npm install
+npm run build
+pm2 restart 9router
+```
+
+### 5. Estrategia de respaldo
+
+```bash
+# Respaldar el directorio de datos
+tar -czf 9router-backup-$(date +%Y%m%d).tar.gz /var/lib/9router
+
+# Respaldo automatizado diario (agregar a crontab)
+0 2 * * * tar -czf /backups/9router-$(date +\%Y\%m\%d).tar.gz /var/lib/9router
+```
+
+---
+
+## 📊 Monitoreo
+
+### Verificar el estado de la aplicación
+
+```bash
+# Estado PM2
+pm2 status
+
+# Ver logs
+pm2 logs 9router --lines 100
+
+# Monitorear recursos
+pm2 monit
+```
+
+### Logs de Nginx
+
+```bash
+# Logs de acceso
+sudo tail -f /var/log/nginx/access.log
+
+# Logs de error
+sudo tail -f /var/log/nginx/error.log
+```
+
+### Recursos del sistema
+
+```bash
+# Uso de CPU y memoria
+htop
+
+# Uso de disco
+df -h
+
+# Conexiones de red
+netstat -tulpn | grep -E '3000|20128'
+```
+
+---
+
+## 🚨 Solución de problemas
+
+### La aplicación no inicia
+
+```bash
+# Verificar logs
+pm2 logs 9router
+
+# Verificar si los puertos están en uso
+sudo lsof -i :3000
+sudo lsof -i :20128
+
+# Verificar variables de entorno
+pm2 env 9router
+```
+
+### Nginx 502 Bad Gateway
+
+```bash
+# Verificar si 9Router está corriendo
+pm2 status
+
+# Verificar logs de error de Nginx
+sudo tail -f /var/log/nginx/error.log
+
+# Probar configuración de Nginx
+sudo nginx -t
+```
+
+### El streaming SSE no funciona
+
+Asegúrate de que `proxy_buffering off` esté configurado en Nginx para soporte SSE.
+
+### Errores de permiso denegado
+
+```bash
+# Corregir permisos del directorio de datos
+sudo chown -R $USER:$USER /var/lib/9router
+chmod 755 /var/lib/9router
+```
+
+---
+
+## 🔗 Próximos pasos
+
+- [Conectar proveedores](/providers/subscription.md)
+- [Configurar combos](/features/combos.md)
+- [Integrar con herramientas](/integration/cursor.md)
diff --git a/gitbook/content/es/deployment/localhost.md b/gitbook/content/es/deployment/localhost.md
new file mode 100644
index 0000000..a082fcc
--- /dev/null
+++ b/gitbook/content/es/deployment/localhost.md
@@ -0,0 +1,164 @@
+# 🏠 Despliegue en localhost
+
+Ejecuta 9Router en tu máquina local para desarrollo y uso personal.
+
+---
+
+## 📦 Instalación
+
+Instala 9Router globalmente vía npm:
+
+```bash
+npm install -g 9router
+```
+
+**Requisitos:**
+- Node.js 20 o superior
+- npm 9 o superior
+
+---
+
+## 🚀 Iniciar el servidor
+
+Inicia 9Router con un solo comando:
+
+```bash
+9router
+```
+
+El dashboard se abrirá automáticamente en tu navegador en `http://localhost:3000`
+
+**Configuración por defecto:**
+- **Dashboard**: `http://localhost:3000`
+- **API Endpoint**: `http://localhost:20128/v1`
+- **Directorio de datos**: `~/.9router`
+
+---
+
+## 🔧 Configuración
+
+### Directorio de datos personalizado
+
+Establece un directorio de datos personalizado usando una variable de entorno:
+
+```bash
+DATA_DIR=/path/to/data 9router
+```
+
+### Puerto personalizado
+
+El puerto de API (20128) y el puerto del dashboard (3000) están configurados en la aplicación. Para cambiarlos, necesitarás modificar el código fuente o usar variables de entorno si se soportan.
+
+---
+
+## 🛑 Detener el servidor
+
+Presiona `Ctrl+C` en la terminal donde 9Router se está ejecutando.
+
+```bash
+# En la terminal ejecutando 9router
+^C # Presiona Ctrl+C
+```
+
+El servidor se apagará correctamente y guardará todos los datos.
+
+---
+
+## 🔄 Reiniciar el servidor
+
+Simplemente ejecuta el comando de inicio nuevamente:
+
+```bash
+9router
+```
+
+Todas tus configuraciones, API keys y combos se preservan en el directorio de datos.
+
+---
+
+## 📊 Actualizar 9Router
+
+Actualiza a la última versión:
+
+```bash
+npm update -g 9router
+```
+
+Verifica tu versión actual:
+
+```bash
+npm list -g 9router
+```
+
+---
+
+## 🔍 Solución de problemas
+
+### Puerto ya en uso
+
+Si el puerto 20128 o 3000 ya está en uso:
+
+```bash
+# Encontrar proceso usando el puerto (macOS/Linux)
+lsof -i :20128
+lsof -i :3000
+
+# Matar el proceso
+kill -9
+```
+
+### Errores de permisos
+
+Si encuentras errores de permisos durante la instalación:
+
+```bash
+# Usar sudo (no recomendado)
+sudo npm install -g 9router
+
+# O corregir los permisos de npm (recomendado)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+```
+
+### Problemas con el directorio de datos
+
+Si el directorio de datos no es accesible:
+
+```bash
+# Verificar permisos
+ls -la ~/.9router
+
+# Corregir permisos
+chmod 755 ~/.9router
+```
+
+---
+
+## 📁 Estructura del directorio de datos
+
+```
+~/.9router/
+├── db.json # Main database (providers, combos, settings)
+├── logs/ # Application logs
+└── cache/ # Temporary cache files
+```
+
+**Respaldar tus datos:**
+
+```bash
+# Respaldo
+cp -r ~/.9router ~/.9router.backup
+
+# Restaurar
+cp -r ~/.9router.backup ~/.9router
+```
+
+---
+
+## 🔗 Próximos pasos
+
+- [Conectar proveedores](/providers/subscription.md)
+- [Crear combos](/features/combos.md)
+- [Integrar con herramientas CLI](/integration/cursor.md)
diff --git a/gitbook/content/es/faq.md b/gitbook/content/es/faq.md
new file mode 100644
index 0000000..0d1f128
--- /dev/null
+++ b/gitbook/content/es/faq.md
@@ -0,0 +1,387 @@
+# Preguntas frecuentes
+
+Preguntas comunes sobre 9Router.
+
+---
+
+## ¿Qué es 9Router?
+
+**9Router es un router de modelos de IA que maximiza el valor de tu suscripción y minimiza los costos.**
+
+Enruta inteligentemente las solicitudes a través de múltiples proveedores de IA usando un sistema de fallback de 3 niveles:
+1. **Nivel de suscripción** - Maximiza las cuotas de Claude Code, Codex, Gemini que ya pagas
+2. **Nivel barato** - Alternativas ultra-baratas ($0.20-$0.60 por 1M tokens)
+3. **Nivel gratis** - Respaldo de emergencia con modelos gratis ilimitados
+
+**Beneficios clave:**
+- Nunca desperdicies la cuota de suscripción
+- Fallback automático cuando se agota la cuota
+- Seguimiento de cuota en tiempo real
+- 90% de ahorro en costos vs uso directo de API
+
+---
+
+## ¿Cómo funciona el precio?
+
+**9Router usa una estrategia de precios de 3 niveles:**
+
+### Nivel 1: Suscripción (Maximiza primero)
+- **Claude Code** (Pro/Max): $20-100/mes - Cuota de 5 horas + semanal
+- **OpenAI Codex** (Plus/Pro): $20-200/mes - Cuota de 5 horas + semanal
+- **Gemini CLI**: GRATIS - 180K completados/mes + 1K/día
+- **GitHub Copilot**: $10-19/mes - Reinicio mensual
+- **Antigravity**: GRATIS - Similar a Gemini
+
+**Objetivo:** ¡Usa cada bit de cuota antes de que se reinicie!
+
+### Nivel 2: Barato (Respaldo)
+- **GLM-4.7**: $0.60/$2.20 por 1M tokens - Reinicio diario 10AM
+- **MiniMax M2.1**: $0.20/$1.00 por 1M tokens - 5 horas rolling
+- **Kimi K2**: $9/mes plano (10M tokens)
+
+**Objetivo:** ¡90% más barato que ChatGPT API ($20/1M)!
+
+### Nivel 3: Gratis (Emergencia)
+- **iFlow**: 8 modelos GRATIS (Kimi K2, Qwen3, GLM, MiniMax...)
+- **Qwen**: 3 modelos GRATIS (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro**: 2 modelos GRATIS (Claude Sonnet 4.5, Haiku 4.5)
+
+**Objetivo:** ¡Fallback de cero costo cuando todo lo demás está limitado por cuota!
+
+---
+
+## ¿9Router es gratis?
+
+**Sí, 9Router en sí es 100% gratis y open source.**
+
+**Proveedores de nivel gratis disponibles:**
+- **Gemini CLI** - 180K completados/mes (cuenta Google GRATIS)
+- **iFlow** - 8 modelos ilimitados (OAuth GRATIS)
+- **Qwen** - 3 modelos ilimitados (OAuth GRATIS)
+- **Kiro** - Claude Sonnet/Haiku (AWS Builder ID GRATIS)
+
+**¡Puedes codificar GRATIS para siempre usando solo proveedores de nivel gratis!**
+
+**Proveedores de pago opcionales:**
+- Servicios de suscripción que ya puedes tener (Claude Code, Codex, Copilot)
+- Alternativas ultra-baratas ($0.20-$0.60 por 1M tokens)
+
+---
+
+## ¿Qué proveedores son compatibles?
+
+### Proveedores de suscripción
+- **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex, GPT 5.1 Codex Max
+- **Gemini CLI** (GRATIS) - Gemini 3 Flash/Pro, 2.5 Pro/Flash
+- **GitHub Copilot** - GPT-5, Claude 4.5, Gemini 3
+- **Antigravity** (Google) - Gemini 3 Pro, Claude Sonnet 4.5
+
+### Proveedores baratos
+- **GLM** (Zhipu AI) - GLM 4.7, GLM 4.6V Vision
+- **MiniMax** - MiniMax M2.1
+- **Kimi** (Moonshot AI) - Kimi Latest
+- **OpenRouter** - Passthrough a cualquier modelo de OpenRouter
+
+### Proveedores gratis
+- **iFlow** - 8 modelos (Kimi K2, Qwen3, GLM, MiniMax, DeepSeek...)
+- **Qwen** - 3 modelos (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro** - 2 modelos (Claude Sonnet 4.5, Haiku 4.5)
+
+**Total: 15+ proveedores, 50+ modelos**
+
+Consulta la [documentación de proveedores](providers/subscription.md) para más detalles.
+
+---
+
+## ¿Puedo usar múltiples proveedores?
+
+**¡Sí! Esta es la característica principal de 9Router.**
+
+**Los combos te permiten encadenar múltiples proveedores con fallback automático:**
+
+```
+Ejemplo de combo: "premium-coding"
+1. cc/claude-opus-4-5 (Suscripción principal)
+2. glm/glm-4.7 (Respaldo barato)
+3. if/kimi-k2 (Emergencia gratis)
+
+→ Cambio automático cuando se agota la cuota
+→ Nunca para de codificar
+→ Costo extra mínimo
+```
+
+**Cómo crear combos:**
+```
+Dashboard → Combos → Create New
+→ Agrega modelos en orden de prioridad
+→ Usa el nombre del combo en CLI: "premium-coding"
+```
+
+**Beneficios:**
+- Cero tiempo de inactividad cuando se agota la cuota
+- Optimización automática de costos
+- Un solo nombre de modelo para todas las herramientas
+
+Consulta la [documentación de combos](features/combos.md) para ejemplos.
+
+---
+
+## ¿Cómo funciona el seguimiento de cuota?
+
+**9Router rastrea la cuota en tiempo real para todos los proveedores:**
+
+**Características:**
+- **Consumo de tokens** - Tokens de entrada/salida por solicitud
+- **Cuenta regresiva de reinicio** - Tiempo hasta que se refresca la cuota
+- **Estadísticas de uso** - Reportes diarios/semanales/mensuales
+- **Estimación de costos** - Gasto proyectado (niveles de pago)
+- **Alertas de cuota** - Notificaciones cuando la cuota es baja
+
+**Tipos de cuota:**
+- **5 horas rolling** - Claude Code, Codex, MiniMax
+- **Reinicio diario** - Gemini CLI (1K/día), GLM (10AM)
+- **Reinicio semanal** - Claude Code, Codex (cuota adicional)
+- **Reinicio mensual** - Gemini CLI (180K), GitHub Copilot (día 1)
+
+**Ver cuota:**
+```
+Dashboard → Providers → Quota Tracking
+→ Uso en tiempo real + cuenta regresiva de reinicio
+```
+
+Consulta la [documentación de seguimiento de cuota](features/quota-tracking.md) para detalles.
+
+---
+
+## ¿9Router funciona con Cursor?
+
+**Sí, pero Cursor requiere un endpoint en la nube.**
+
+**Problema:** Cursor IDE no soporta endpoints en localhost.
+
+**Solución:** Usa el despliegue en la nube de 9Router:
+
+```
+Cursor Settings → Models → Advanced:
+ OpenAI API Base URL: https://9router.com/v1
+ OpenAI API Key: [desde el dashboard]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+**Alternativa:** Auto-hospéda en VPS con dominio público:
+```bash
+# Despliega en VPS
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+npm start
+
+# Configura proxy reverso Nginx
+# Apunta Cursor a: https://your-domain.com/v1
+```
+
+**Otras herramientas CLI funcionan con localhost:**
+- Cline ✅
+- Claude Desktop ✅
+- Codex CLI ✅
+- Continue ✅
+- RooCode ✅
+
+Consulta la [guía de integración de Cursor](integration/cursor.md) para detalles.
+
+---
+
+## ¿Puedo auto-hospedar 9Router?
+
+**¡Sí! 9Router soporta múltiples opciones de despliegue:**
+
+### Localhost (Por defecto)
+```bash
+npm install -g 9router
+9router
+→ Dashboard: http://localhost:3000
+→ API: http://localhost:20128/v1
+```
+
+### VPS/Cloud
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+npm start
+```
+
+### Docker
+```bash
+docker build -t 9router .
+docker run -d \
+ -p 3000:3000 \
+ -e JWT_SECRET="your-secret" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Cloudflare Workers
+```bash
+cd 9router/app
+npm run deploy:cloudflare
+```
+
+**Variables de entorno:**
+- `JWT_SECRET` - **¡DEBE cambiarse en producción!**
+- `DATA_DIR` - Ruta de almacenamiento de la base de datos (por defecto: `~/.9router`)
+- `INITIAL_PASSWORD` - Login del dashboard (por defecto: `123456`)
+- `NODE_ENV` - Establece en `production` para desplegar
+
+Consulta la [guía de despliegue](getting-started/installation.md#deployment) para detalles.
+
+---
+
+## ¿Mis datos están seguros?
+
+**Sí, 9Router prioriza la seguridad y privacidad:**
+
+**Almacenamiento local:**
+- Todos los datos se almacenan localmente en `~/.9router` (o `DATA_DIR` personalizado)
+- No se envían datos a los servidores de 9Router
+- Tokens OAuth cifrados con JWT
+
+**Sin telemetría:**
+- Sin seguimiento de uso
+- Sin analítica
+- Sin phone-home
+
+**Open source:**
+- Código fuente completo disponible en GitHub
+- Audita la seguridad tú mismo
+- Revisado por la comunidad
+
+**Mejores prácticas:**
+- Cambia `JWT_SECRET` en producción
+- Usa un `INITIAL_PASSWORD` fuerte
+- Habilita HTTPS para despliegues en la nube
+- Rota las API keys regularmente
+
+**Lo que 9Router almacena:**
+- Tokens OAuth de proveedores (cifrados)
+- API keys (cifradas)
+- Estadísticas de uso (solo locales)
+- Configuraciones de combos
+
+**Lo que 9Router NO almacena:**
+- Tus prompts o respuestas
+- El código que generas
+- Información personal
+
+---
+
+## ¿Cómo actualizo 9Router?
+
+**Los métodos de actualización dependen del tipo de instalación:**
+
+### Instalación global NPM
+```bash
+npm update -g 9router
+```
+
+### Instalación local
+```bash
+cd 9router/app
+git pull origin main
+npm install
+npm run build
+npm start
+```
+
+### Docker
+```bash
+docker pull 9router:latest
+docker stop 9router
+docker rm 9router
+docker run -d \
+ -p 3000:3000 \
+ -v 9router-data:/app/data \
+ 9router:latest
+```
+
+**Verificar versión:**
+```bash
+9router --version
+```
+
+**Cambios disruptivos:**
+- Revisa [CHANGELOG.md](https://github.com/decolua/9router/blob/main/CHANGELOG.md)
+- Respalda `~/.9router` antes de actualizaciones mayores
+- Revisa las guías de migración para versiones mayores
+
+---
+
+## ¿Cómo puedo contribuir?
+
+**¡Damos la bienvenida a las contribuciones!**
+
+### Formas de contribuir:
+
+1. **Reportar bugs:**
+ - [GitHub Issues](https://github.com/decolua/9router/issues)
+ - Incluye logs de error, pasos para reproducir
+
+2. **Solicitar características:**
+ - [GitHub Discussions](https://github.com/decolua/9router/discussions)
+ - Describe el caso de uso y los beneficios
+
+3. **Enviar código:**
+ ```bash
+ # Fork del repo
+ git clone https://github.com/YOUR_USERNAME/9router.git
+ cd 9router
+
+ # Crea una rama
+ git checkout -b feature/your-feature
+
+ # Haz cambios
+ npm install
+ npm run dev
+
+ # Prueba
+ npm test
+
+ # Commit y push
+ git add .
+ git commit -m "Add your feature"
+ git push origin feature/your-feature
+
+ # Crea un Pull Request en GitHub
+ ```
+
+4. **Mejorar docs:**
+ - Corrige errores tipográficos, agrega ejemplos
+ - Traduce a otros idiomas
+ - Escribe tutoriales
+
+5. **Agregar proveedores:**
+ - Implementa nuevos adaptadores de proveedores
+ - Consulta `app/lib/providers/` para ejemplos
+
+**Directrices de contribución:**
+- Sigue el estilo de código existente
+- Agrega tests para nuevas características
+- Actualiza la documentación
+- Mantén los commits atómicos y descriptivos
+
+Consulta [CONTRIBUTING.md](https://github.com/decolua/9router/blob/main/CONTRIBUTING.md) para detalles.
+
+---
+
+## ¿Necesitas más ayuda?
+
+- **Documentación:** [9router.com/docs](https://9router.com/docs)
+- **GitHub:** [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **Troubleshooting:** [troubleshooting.md](troubleshooting.md)
diff --git a/gitbook/content/es/features/combos.md b/gitbook/content/es/features/combos.md
new file mode 100644
index 0000000..aadfe19
--- /dev/null
+++ b/gitbook/content/es/features/combos.md
@@ -0,0 +1,537 @@
+# Combos - Cadenas de fallback personalizadas
+
+Crea combinaciones de modelos personalizadas con fallback automático. Los combos te permiten definir tu propia estrategia de enrutamiento basada en costo, calidad y disponibilidad.
+
+---
+
+## ¿Qué son los combos?
+
+Los combos son **cadenas de fallback personalizadas** que creas en el dashboard. En lugar de usar un solo modelo, defines una secuencia de modelos que 9Router intenta en orden.
+
+**Ejemplo:**
+```
+Nombre del combo: premium-coding
+Modelos:
+ 1. cc/claude-opus-4-5-20251101 (intentar primero)
+ 2. glm/glm-4.7 (si #1 tiene cuota agotada)
+ 3. minimax/MiniMax-M2.1 (si #2 tiene cuota agotada)
+```
+
+**Uso en CLI:**
+```
+Model: premium-coding
+```
+
+9Router intenta automáticamente cada modelo en secuencia hasta que uno tenga éxito.
+
+---
+
+## ¿Por qué usar combos?
+
+### 1. Maximiza el valor de la suscripción
+```
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ Usa la suscripción primero, respaldo barato, emergencia gratis
+→ Obtén el valor completo de las suscripciones que ya pagas
+```
+
+### 2. Minimiza costos
+```
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+
+→ Comienza con la opción de pago más barata ($0.60/1M)
+→ Fallback a una aún más barata ($0.20/1M)
+→ Nivel de emergencia gratis
+→ Costo total: ~$5-10/mes vs $2000 en ChatGPT API
+```
+
+### 3. Garantiza disponibilidad 24/7
+```
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ Siempre incluye el nivel gratis al final
+→ Nunca te quedes sin cuota
+→ Codifica en cualquier momento, en cualquier lugar
+```
+
+### 4. Optimiza por calidad
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → gc/gemini-3-pro
+
+→ Mejores modelos primero
+→ Fallback a otros modelos premium
+→ Mantén alta calidad en toda la cadena de fallback
+```
+
+---
+
+## Cómo crear combos
+
+### Paso 1: Abrir el dashboard
+
+```
+http://localhost:20128
+→ Inicia sesión con tu contraseña
+```
+
+### Paso 2: Navegar a Combos
+
+```
+Dashboard → Combos → Create New Combo
+```
+
+### Paso 3: Configurar el combo
+
+**Nombre del combo:**
+```
+premium-coding
+```
+
+**Descripción (opcional):**
+```
+Suscripción primero, respaldo barato, emergencia gratis
+```
+
+**Seleccionar modelos:**
+```
+1. cc/claude-opus-4-5-20251101
+2. glm/glm-4.7
+3. minimax/MiniMax-M2.1
+```
+
+**Arrastra para reordenar** - Prioridad de arriba a abajo.
+
+### Paso 4: Guardar
+
+```
+Clic en "Save Combo"
+→ El combo aparece en la lista de modelos
+```
+
+### Paso 5: Usar en CLI
+
+```
+Cursor/Cline/Cualquier herramienta:
+ Model: premium-coding
+```
+
+---
+
+## Combos de ejemplo
+
+### Ejemplo 1: Premium Coding (Suscripción → Barato → Gratis)
+
+**Objetivo**: Maximizar el valor de la suscripción, minimizar costos extras.
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. glm/glm-4.7
+ 3. minimax/MiniMax-M2.1
+```
+
+**Uso:**
+```
+Cursor IDE:
+ Model: premium-coding
+```
+
+**Comportamiento:**
+```
+Mañana (cuota fresca):
+ Solicitud → cc/claude-opus-4-5 ✅
+
+Tarde (cuota de Claude agotada):
+ Solicitud → glm/glm-4.7 ✅ (cambio automático)
+
+Noche (cuota de GLM agotada):
+ Solicitud → minimax/MiniMax-M2.1 ✅ (cambio automático)
+```
+
+**Costo mensual (100M tokens):**
+```
+80M vía Claude Code: $0 (suscripción)
+15M vía GLM: $9
+5M vía MiniMax: $1
+Total: $10 + tu suscripción
+```
+
+**Ahorros**: ~99% vs ChatGPT API ($2000).
+
+---
+
+### Ejemplo 2: Combo de presupuesto (Barato → Gratis)
+
+**Objetivo**: Minimizar costos, usar el nivel gratis como respaldo.
+
+```
+Dashboard → Combos → Create New
+
+Name: budget-combo
+Models:
+ 1. glm/glm-4.7
+ 2. minimax/MiniMax-M2.1
+ 3. if/kimi-k2-thinking
+```
+
+**Uso:**
+```
+Cline:
+ Provider: OpenAI Compatible
+ Base URL: http://localhost:20128/v1
+ Model: budget-combo
+```
+
+**Comportamiento:**
+```
+Solicitud → glm/glm-4.7
+ ✅ Cuota diaria disponible → Usa GLM ($0.60/1M)
+ ❌ Cuota agotada → Intenta MiniMax ($0.20/1M)
+ ❌ Cuota de MiniMax agotada → Usa iFlow (GRATIS)
+```
+
+**Costo mensual (100M tokens):**
+```
+70M vía GLM: $42
+20M vía MiniMax: $4
+10M vía iFlow: $0
+Total: $46 vs $2000 en ChatGPT API
+```
+
+**Ahorros**: 97%.
+
+---
+
+### Ejemplo 3: Combo gratis (Cero costo)
+
+**Objetivo**: 100% gratis, sin costos nunca.
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking
+ 2. qw/qwen3-coder-plus
+ 3. kr/claude-sonnet-4.5
+```
+
+**Uso:**
+```
+Claude Desktop:
+ Model: free-combo
+```
+
+**Comportamiento:**
+```
+Solicitud → if/kimi-k2-thinking
+ ✅ Disponible → Usa iFlow
+ ❌ Error → Intenta Qwen
+ ❌ Error → Intenta Kiro
+```
+
+**Costo mensual:**
+```
+100M tokens vía proveedores gratis: $0
+Total: $0 para siempre
+```
+
+**Caso de uso**: Proyectos personales, aprendizaje, experimentación.
+
+---
+
+### Ejemplo 4: Calidad primero (Solo modelos premium)
+
+**Objetivo**: Mejor calidad, sin fallback barato.
+
+```
+Dashboard → Combos → Create New
+
+Name: quality-first
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. cx/gpt-5.2-codex
+ 3. gc/gemini-3-pro-preview
+```
+
+**Uso:**
+```
+Codex CLI:
+ export OPENAI_BASE_URL="http://localhost:20128"
+ Model: quality-first
+```
+
+**Comportamiento:**
+```
+Solicitud → cc/claude-opus-4-5
+ ❌ Cuota agotada → cx/gpt-5.2-codex
+ ❌ Cuota agotada → gc/gemini-3-pro-preview
+ ❌ Todo agotado → Devuelve error (sin fallback barato)
+```
+
+**Caso de uso**: Código crítico de producción, refactoring complejo.
+
+---
+
+### Ejemplo 5: Multi-suscripción (Maximiza todo)
+
+**Objetivo**: Usa todas las suscripciones antes de pagar extra.
+
+```
+Dashboard → Combos → Create New
+
+Name: multi-sub
+Models:
+ 1. gc/gemini-3-flash-preview (GRATIS 180K/mes)
+ 2. cc/claude-opus-4-5-20251101 (suscripción Pro)
+ 3. cx/gpt-5.2-codex (suscripción Plus)
+ 4. gh/gpt-5 (suscripción Copilot)
+ 5. glm/glm-4.7 (respaldo barato)
+ 6. if/kimi-k2-thinking (emergencia gratis)
+```
+
+**Costo mensual (200M tokens):**
+```
+50M vía Gemini CLI: $0 (nivel gratis)
+80M vía Claude Code: $0 (suscripción)
+40M vía Codex: $0 (suscripción)
+20M vía Copilot: $0 (suscripción)
+8M vía GLM: $4.80
+2M vía iFlow: $0
+Total: $4.80 + suscripciones existentes
+```
+
+**Resultado**: Usa 190M tokens de suscripciones, solo $4.80 extra.
+
+---
+
+### Ejemplo 6: Optimización de reinicio de cuota
+
+**Objetivo**: Distribuir el uso según los tiempos de reinicio.
+
+```
+Dashboard → Combos → Create New
+
+Name: reset-optimized
+Models:
+ 1. cc/claude-opus-4-5 (reinicio 5h, usar mañana)
+ 2. gc/gemini-3-flash (1K/día, usar tarde)
+ 3. glm/glm-4.7 (reinicio diario 10AM, usar noche)
+ 4. minimax/MiniMax-M2.1 (rolling 5h, usar madrugada)
+ 5. if/kimi-k2-thinking (ilimitado, emergencia)
+```
+
+**Rutina diaria:**
+```
+08:00 - 13:00: Claude Code (cuota fresca de 5h)
+13:00 - 18:00: Gemini CLI (cuota 1K/día)
+18:00 - 22:00: GLM (se reinicia 10AM del día siguiente)
+22:00 - 08:00: MiniMax (rolling 5h) o iFlow
+```
+
+**Resultado**: Codifica 24/7 con costos mínimos.
+
+---
+
+## Usar combos en herramientas CLI
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [desde el dashboard]
+ Model: premium-coding
+```
+
+### Claude Desktop
+
+Edita `~/.claude/config.json`:
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key",
+ "model": "budget-combo"
+}
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex --model quality-first "your prompt"
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [desde el dashboard]
+Model: free-combo
+```
+
+### Solicitud por API
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "premium-coding",
+ "messages": [
+ {"role": "user", "content": "Write a function to..."}
+ ],
+ "stream": true
+ }'
+```
+
+---
+
+## Mejores prácticas
+
+### 1. Siempre incluye el nivel gratis
+
+```
+✅ Bueno:
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+❌ Malo:
+cc/claude-opus → glm/glm-4.7
+(sin fallback gratis, puede quedarse sin cuota)
+```
+
+**Por qué**: Garantiza disponibilidad 24/7, nunca bloqueado por cuota.
+
+### 2. Ordena por costo (Barato a costoso)
+
+```
+✅ Bueno:
+glm/glm-4.7 → minimax/MiniMax-M2.1 → cc/claude-opus
+
+❌ Malo:
+cc/claude-opus → glm/glm-4.7
+(desperdicia cuota de suscripción en tareas simples)
+```
+
+**Excepción**: Si quieres maximizar el valor de la suscripción, pon la suscripción primero.
+
+### 3. Coincide con los requisitos de calidad
+
+```
+Para código de producción:
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7
+
+Para tareas rápidas:
+glm/glm-4.7 → if/kimi-k2-thinking
+
+Para experimentación:
+if/kimi-k2-thinking → qw/qwen3-coder-plus
+```
+
+### 4. Considera los tiempos de reinicio de cuota
+
+```
+Combo matutino (cuotas frescas):
+cc/claude-opus → cx/gpt-5.2-codex
+
+Combo nocturno (cuotas probablemente agotadas):
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+### 5. Crea múltiples combos para diferentes casos de uso
+
+```
+premium-coding: Para tareas complejas
+budget-combo: Para tareas simples
+free-combo: Para experimentación
+quality-first: Para código de producción
+```
+
+**Cambia entre combos** según los requisitos de la tarea.
+
+### 6. Monitorea el desempeño del combo
+
+```
+Dashboard → Analytics → Combo Usage:
+ premium-coding:
+ 80% vía cc/claude-opus (bueno, usando suscripción)
+ 15% vía glm/glm-4.7 (respaldo aceptable)
+ 5% vía minimax (fallback raro)
+```
+
+**Optimiza**: Si hay demasiado uso de fallback, aumenta la cuota principal o reordena modelos.
+
+---
+
+## Configuración avanzada
+
+### Establecer límites de presupuesto por combo
+
+```
+Dashboard → Combos → Edit → Budget:
+ Daily limit: $5
+ Monthly limit: $50
+```
+
+Cuando se alcanza el límite, 9Router omite los modelos de pago y usa solo el nivel gratis.
+
+### Habilitar/Deshabilitar modelos en un combo
+
+```
+Dashboard → Combos → Edit → Models:
+ ✅ cc/claude-opus-4-5 (habilitado)
+ ❌ glm/glm-4.7 (deshabilitado temporalmente)
+ ✅ if/kimi-k2-thinking (habilitado)
+```
+
+**Caso de uso**: Deshabilitar temporalmente modelos costosos sin eliminar el combo.
+
+### Clonar un combo existente
+
+```
+Dashboard → Combos → Clone "premium-coding"
+→ Crea una copia con sufijo "-copy"
+→ Modifica y guarda como nuevo combo
+```
+
+**Caso de uso**: Crear variaciones para diferentes escenarios.
+
+---
+
+## Solución de problemas
+
+**Problema: El combo no aparece en la lista de modelos**
+
+**Solución:**
+1. Refresca el dashboard
+2. Verifica que el combo esté guardado (marca verde)
+3. Reinicia la herramienta CLI para refrescar la lista de modelos
+
+**Problema: El combo siempre usa el último modelo (nivel gratis)**
+
+**Solución:**
+1. Verifica la cuota de los modelos principales (Dashboard → Quota)
+2. Verifica que las API keys sean válidas (Dashboard → Providers)
+3. Verifica que no se hayan excedido los límites de presupuesto
+
+**Problema: El combo cuesta más de lo esperado**
+
+**Solución:**
+1. Dashboard → Analytics → Revisa el uso del combo
+2. Verifica si los modelos principales tienen cuota agotada
+3. Reordena los modelos (pon los más baratos primero)
+4. Establece límites de presupuesto
+
+---
+
+## Relacionado
+
+- [Enrutamiento inteligente](./smart-routing.md) - Cómo funciona el fallback automático
+- [Seguimiento de cuota](./quota-tracking.md) - Monitorea uso y costos
diff --git a/gitbook/content/es/features/quota-tracking.md b/gitbook/content/es/features/quota-tracking.md
new file mode 100644
index 0000000..437b769
--- /dev/null
+++ b/gitbook/content/es/features/quota-tracking.md
@@ -0,0 +1,687 @@
+# Seguimiento de cuota y monitoreo de uso
+
+Rastrea el consumo de tokens en tiempo real, monitorea los límites de cuota, estima costos y recibe alertas antes de quedarte sin recursos. Nunca desperdicies cuota de suscripción ni excedas los límites de presupuesto.
+
+---
+
+## Resumen
+
+9Router proporciona un seguimiento de cuota integral para todos los proveedores:
+
+- **Consumo de tokens en tiempo real** - Mira los tokens usados por solicitud
+- **Límites de cuota y restantes** - Rastrea el uso vs límites
+- **Cuenta regresiva de reinicio** - Sabe cuándo se refresca la cuota
+- **Estimación de costos** - Calcula el gasto para niveles de pago
+- **Reportes mensuales** - Analiza patrones de uso
+- **Alertas y notificaciones** - Recibe advertencias antes de los límites
+
+---
+
+## Resumen del dashboard
+
+### Resumen de cuota
+
+```
+Dashboard → Home → Quota Overview
+
+┌─────────────────────────────────────────────┐
+│ Claude Code (cc/) │
+│ ████████████░░░░░░░░ 2.5h / 5h (50%) │
+│ Se reinicia en: 2h 30m │
+│ Costo: $0 (suscripción) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ Gemini CLI (gc/) │
+│ ████████░░░░░░░░░░░░ 450 / 1000 (45%) │
+│ Reinicio diario en: 18h 30m │
+│ Mensual: 45K / 180K (25%) │
+│ Costo: $0 (nivel gratis) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ GLM-4.7 (glm/) │
+│ ██████████████░░░░░░ 7M / 10M tokens (70%) │
+│ Se reinicia: Diario 10:00 AM (en 5h 35m) │
+│ Costo hoy: $4.20 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ MiniMax M2.1 (minimax/) │
+│ ████████████████░░░░ 4M / 5M tokens (80%) │
+│ Ventana rolling 5h │
+│ Costo (5h): $0.80 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ iFlow (if/) │
+│ ████████████████████ Ilimitado │
+│ Costo: $0 (gratis para siempre) │
+└─────────────────────────────────────────────┘
+```
+
+---
+
+## Consumo de tokens en tiempo real
+
+### Seguimiento por solicitud
+
+Cada solicitud muestra el uso detallado de tokens:
+
+```
+Dashboard → Activity → Recent Requests
+
+Request #1234
+Model: cc/claude-opus-4-5-20251101
+Timestamp: 2026-02-04 04:15:32
+
+Tokens:
+ Input: 1,250 tokens
+ Output: 850 tokens
+ Total: 2,100 tokens
+
+Cost: $0 (cuota de suscripción)
+Duration: 3.2s
+Status: ✅ Success
+```
+
+### Monitor de uso en vivo
+
+```
+Dashboard → Live Monitor
+
+Solicitud actual:
+ Model: glm/glm-4.7
+ Tokens transmitidos: 450 / ~800 estimados
+ Costo hasta ahora: $0.0009
+ Duración: 1.8s
+```
+
+### Desglose de tokens por modelo
+
+```
+Dashboard → Analytics → Token Usage
+
+Hoy (4 feb 2026):
+ cc/claude-opus-4-5: 15M tokens ($0, suscripción)
+ glm/glm-4.7: 8M tokens ($4.80)
+ if/kimi-k2-thinking: 3M tokens ($0, gratis)
+
+Total: 26M tokens
+Costo: $4.80
+```
+
+---
+
+## Límites de cuota y tiempos de reinicio
+
+### Proveedores de suscripción
+
+**Claude Code (Pro/Max)**
+```
+Tipo de cuota: Basado en tiempo (rolling 5 horas)
+Límite: 5 horas de uso
+Reinicio: Ventana rolling 5 horas + refresh semanal
+Seguimiento: Tiempo de uso por modelo
+
+El dashboard muestra:
+ Opus: 2.5h / 5h usados
+ Sonnet: 1.2h / 5h usados
+ Haiku: 0.8h / 5h usados
+
+Reinicio semanal: Todos los lunes 00:00 UTC
+```
+
+**OpenAI Codex (Plus/Pro)**
+```
+Tipo de cuota: Basado en tiempo (rolling 5 horas)
+Límite: 5 horas (Plus) / 10 horas (Pro)
+Reinicio: Ventana rolling 5 horas + refresh semanal
+
+El dashboard muestra:
+ GPT-5.2 Codex: 3.5h / 5h usados
+ Se reinicia en: 1h 30m
+```
+
+**Gemini CLI (GRATIS)**
+```
+Tipo de cuota: Conteo de solicitudes + tokens mensuales
+Límite diario: 1,000 solicitudes
+Límite mensual: 180,000 completados
+Reinicio: Diario 00:00 UTC + Mensual día 1
+
+El dashboard muestra:
+ Hoy: 450 / 1,000 solicitudes (45%)
+ Este mes: 45K / 180K completados (25%)
+ Reinicio diario en: 18h 30m
+ Reinicio mensual en: 26 días
+```
+
+**GitHub Copilot**
+```
+Tipo de cuota: Uso mensual
+Límite: Varía según el plan
+Reinicio: 1ro de cada mes
+
+El dashboard muestra:
+ Uso: 60% de la cuota mensual
+ Se reinicia: 1 mar 2026 (en 25 días)
+```
+
+### Proveedores baratos
+
+**GLM-4.7**
+```
+Tipo de cuota: Límite diario de tokens
+Límite: 10M tokens/día (Coding Plan)
+Reinicio: Diario 10:00 AM hora de Beijing (UTC+8)
+
+El dashboard muestra:
+ Usados: 7M / 10M tokens (70%)
+ Restantes: 3M tokens
+ Se reinicia en: 5h 35m
+ Costo hoy: $4.20
+```
+
+**MiniMax M2.1**
+```
+Tipo de cuota: Ventana rolling 5 horas
+Límite: 5M tokens por 5 horas
+Reinicio: Ventana rolling continua
+
+El dashboard muestra:
+ Usados (5h): 4M / 5M tokens (80%)
+ El uso más antiguo expira en: 45m
+ Costo (5h): $0.80
+```
+
+**Kimi K2**
+```
+Tipo de cuota: Suscripción mensual
+Límite: 10M tokens/mes ($9 plano)
+Reinicio: Mensual en la fecha de suscripción
+
+El dashboard muestra:
+ Usados: 6M / 10M tokens (60%)
+ Se reinicia: 15 feb 2026 (en 11 días)
+ Costo: $9/mes (pagado por adelantado)
+```
+
+### Proveedores gratis
+
+**iFlow / Qwen / Kiro**
+```
+Tipo de cuota: Ilimitado (con rate-limit)
+Límite: Sin límite duro
+Reinicio: N/A
+
+El dashboard muestra:
+ Usados hoy: 5M tokens
+ Costo: $0 (gratis para siempre)
+ Estado: ✅ Disponible
+```
+
+---
+
+## Estimación de costos
+
+### Seguimiento de costos en tiempo real
+
+```
+Dashboard → Costs → Today
+
+Proveedores de suscripción: $0
+ Claude Code: 15M tokens ($0, incluido)
+ Gemini CLI: 3M tokens ($0, nivel gratis)
+
+Proveedores de pago: $4.80
+ GLM-4.7: 8M tokens ($4.80)
+ Input: 6M × $0.60/1M = $3.60
+ Output: 2M × $2.20/1M = $4.40
+ Total: $4.80
+
+Proveedores gratis: $0
+ iFlow: 3M tokens ($0)
+
+Total hoy: $4.80
+```
+
+### Reporte de gasto mensual
+
+```
+Dashboard → Costs → This Month (Febrero 2026)
+
+Semana 1 (1-7 feb):
+ Suscripción: $0 (80M tokens)
+ Pago: $15.20 (25M tokens)
+ Gratis: $0 (10M tokens)
+ Total: $15.20
+
+Semana 2 (8-14 feb):
+ Suscripción: $0 (75M tokens)
+ Pago: $12.80 (20M tokens)
+ Gratis: $0 (8M tokens)
+ Total: $12.80
+
+Mes hasta la fecha: $28.00
+Proyectado (30 días): ~$120
+
+Desglose por proveedor:
+ GLM-4.7: $22.00 (78%)
+ MiniMax M2.1: $6.00 (22%)
+
+Costo promedio por 1M tokens: $0.62
+Ahorros vs ChatGPT API: 97% ($4,000 → $120)
+```
+
+### Proyección de costos
+
+```
+Dashboard → Costs → Projections
+
+Basado en uso de los últimos 7 días:
+ Promedio diario: 50M tokens
+ Costo diario: $4.50
+
+Proyección mensual:
+ Tokens: 1,500M (1.5B)
+ Costo: $135
+
+Desglose:
+ Suscripción: 900M tokens ($0)
+ GLM-4.7: 450M tokens ($90)
+ MiniMax: 120M tokens ($24)
+ Gratis: 30M tokens ($0)
+
+Estado del presupuesto:
+ Límite diario: $5 → 90% usado hoy
+ Límite mensual: $150 → 90% proyectado
+ ⚠️ Advertencia: Puede exceder el presupuesto mensual
+```
+
+---
+
+## Dashboard de uso
+
+### Estadísticas generales
+
+```
+Dashboard → Analytics → Overview
+
+Hoy (4 feb 2026):
+ Solicitudes: 1,234
+ Tokens: 26M
+ Costo: $4.80
+ Tiempo promedio de respuesta: 2.1s
+
+Esta semana:
+ Solicitudes: 8,456
+ Tokens: 180M
+ Costo: $28.00
+ Tasa de éxito: 99.2%
+
+Este mes:
+ Solicitudes: 15,234
+ Tokens: 320M
+ Costo: $52.00
+ Modelo principal: cc/claude-opus-4-5 (45%)
+```
+
+### Uso por modelo
+
+```
+Dashboard → Analytics → Models
+
+Modelos principales (este mes):
+1. cc/claude-opus-4-5: 145M tokens (45%)
+2. glm/glm-4.7: 95M tokens (30%)
+3. if/kimi-k2-thinking: 50M tokens (16%)
+4. minimax/MiniMax-M2.1: 20M tokens (6%)
+5. gc/gemini-3-flash: 10M tokens (3%)
+
+Desglose de costos:
+ cc/claude-opus: $0 (suscripción)
+ glm/glm-4.7: $45.00
+ if/kimi-k2-thinking: $0 (gratis)
+ minimax/MiniMax-M2.1: $7.00
+ gc/gemini-3-flash: $0 (gratis)
+```
+
+### Uso por tiempo
+
+```
+Dashboard → Analytics → Timeline
+
+Uso por hora (hoy):
+00:00 - 01:00: 0.5M tokens
+01:00 - 02:00: 0.2M tokens
+...
+08:00 - 09:00: 3.2M tokens (pico)
+09:00 - 10:00: 2.8M tokens
+...
+23:00 - 00:00: 0.8M tokens
+
+Horas pico: 08:00 - 12:00 (codificación matutina)
+Horas bajas: 00:00 - 06:00 (noche)
+```
+
+### Uso por combo
+
+```
+Dashboard → Analytics → Combos
+
+premium-coding:
+ Solicitudes: 456
+ Tokens: 12M
+ Costo: $2.40
+
+ Desglose:
+ cc/claude-opus: 8M tokens (67%, $0)
+ glm/glm-4.7: 3M tokens (25%, $1.80)
+ minimax/MiniMax-M2.1: 1M tokens (8%, $0.20)
+
+budget-combo:
+ Solicitudes: 234
+ Tokens: 6M
+ Costo: $1.20
+
+ Desglose:
+ glm/glm-4.7: 4M tokens (67%, $2.40)
+ if/kimi-k2-thinking: 2M tokens (33%, $0)
+```
+
+---
+
+## Alertas y notificaciones
+
+### Alertas de cuota
+
+```
+Dashboard → Settings → Alerts
+
+Advertencias de cuota:
+ ✅ Alerta al 80% de cuota usada
+ ✅ Alerta al 90% de cuota usada
+ ✅ Alerta cuando la cuota se agota
+ ✅ Notificar cuando la cuota se reinicia
+
+Entrega:
+ ✅ Notificación del dashboard
+ ✅ Email (opcional)
+ ✅ Webhook (opcional)
+```
+
+**Ejemplo de notificaciones:**
+```
+⚠️ Cuota de Claude Code 80% usada
+ 2.5h restantes (se reinicia en 1h 30m)
+
+⚠️ Cuota de GLM-4.7 90% usada
+ 1M tokens restantes (se reinicia en 5h)
+
+✅ Cuota de Gemini CLI reiniciada
+ 1,000 solicitudes disponibles (límite diario)
+```
+
+### Alertas de presupuesto
+
+```
+Dashboard → Settings → Budget Alerts
+
+Presupuesto diario: $5
+ ✅ Alerta al 80% ($4)
+ ✅ Alerta al 100% ($5)
+ ✅ Cambio automático al nivel gratis cuando se excede
+
+Presupuesto mensual: $150
+ ✅ Alerta al 50% ($75)
+ ✅ Alerta al 80% ($120)
+ ✅ Alerta al 100% ($150)
+```
+
+**Ejemplo de notificaciones:**
+```
+⚠️ Presupuesto diario 80% usado
+ $4.00 / $5.00 gastados hoy
+
+⚠️ Presupuesto mensual 50% alcanzado
+ $75 / $150 gastados este mes
+ Proyectado: $135 (dentro del presupuesto)
+
+🚨 Presupuesto diario excedido
+ $5.20 / $5.00 gastados hoy
+ Cambio automático al nivel gratis
+```
+
+### Detección de anomalías de costo
+
+```
+Dashboard → Settings → Anomaly Detection
+
+✅ Detectar patrones de gasto inusuales
+✅ Alerta en picos de costo (>2× promedio diario)
+✅ Advertencia en patrones de agotamiento de cuota
+
+Ejemplo de alerta:
+⚠️ Pico de costo detectado
+ Hoy: $12.50 (2.5× promedio diario)
+ Razón: Alto uso de GLM-4.7 (20M tokens)
+ Sugerencia: Verifica si los modelos principales tienen cuota agotada
+```
+
+---
+
+## Mejores prácticas
+
+### 1. Monitorea la cuota diariamente
+
+```
+Rutina diaria:
+1. Revisa el resumen de cuota del dashboard (30 segundos)
+2. Revisa los tiempos de reinicio
+3. Planifica el uso según la disponibilidad de cuota
+```
+
+**Ejemplo:**
+```
+Revisión matutina:
+ ✅ Claude Code: 5h disponibles (reinicio fresco)
+ ✅ Gemini CLI: 1K solicitudes disponibles
+ ⚠️ GLM-4.7: 2M tokens restantes (se reinicia 10AM)
+
+Acción: Usar Claude Code para el trabajo matutino
+```
+
+### 2. Establece límites de presupuesto
+
+```
+Dashboard → Settings → Budget:
+ Diario: $5 (previene gastos excesivos)
+ Mensual: $150 (alinea con el presupuesto)
+```
+
+**Resultado**: Cambio automático al nivel gratis cuando se alcanza el límite.
+
+### 3. Optimiza el uso de combos
+
+```
+Dashboard → Analytics → Combos:
+ Revisa qué modelos se usan más
+ Ajusta el orden del combo para minimizar costos
+```
+
+**Ejemplo:**
+```
+Actual: cc/claude-opus → glm/glm-4.7
+ 80% vía Claude (bueno)
+ 20% vía GLM ($12/mes)
+
+Optimizado: gc/gemini-3-flash → cc/claude-opus → glm/glm-4.7
+ 50% vía Gemini (gratis)
+ 40% vía Claude (suscripción)
+ 10% vía GLM ($6/mes)
+
+Ahorros: $6/mes
+```
+
+### 4. Rastrea los tiempos de reinicio
+
+```
+Dashboard → Quota → Reset Schedule:
+ Claude Code: 5h rolling + Semanal lunes
+ Gemini CLI: Diario 00:00 UTC + Mensual día 1
+ GLM-4.7: Diario 10:00 AM hora Beijing
+ MiniMax: Ventana rolling 5h
+```
+
+**Estrategia**: Usa proveedores cuando la cuota esté fresca.
+
+### 5. Revisa los reportes mensuales
+
+```
+Dashboard → Analytics → Monthly Report:
+ Total de tokens: 1.5B
+ Costo total: $120
+ Ahorros: 97% vs ChatGPT API
+
+Insights:
+ - 60% de uso vía suscripciones ($0)
+ - 30% vía GLM ($90)
+ - 10% vía nivel gratis ($0)
+
+Optimización:
+ - Aumentar el uso de Gemini CLI (gratis)
+ - Reducir el uso de GLM (costoso)
+```
+
+---
+
+## Acceso por API
+
+### Obtener estado de cuota
+
+```bash
+GET http://localhost:20128/api/quota
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "providers": [
+ {
+ "id": "cc",
+ "name": "Claude Code",
+ "quota": {
+ "used": 2.5,
+ "limit": 5,
+ "unit": "hours",
+ "percentage": 50
+ },
+ "reset": {
+ "type": "rolling",
+ "window": "5h",
+ "nextReset": "2026-02-04T06:45:00Z"
+ },
+ "cost": {
+ "today": 0,
+ "month": 0,
+ "currency": "USD"
+ }
+ },
+ {
+ "id": "glm",
+ "name": "GLM-4.7",
+ "quota": {
+ "used": 7000000,
+ "limit": 10000000,
+ "unit": "tokens",
+ "percentage": 70
+ },
+ "reset": {
+ "type": "daily",
+ "time": "10:00 AM UTC+8",
+ "nextReset": "2026-02-04T10:00:00+08:00"
+ },
+ "cost": {
+ "today": 4.20,
+ "month": 52.00,
+ "currency": "USD"
+ }
+ }
+ ]
+}
+```
+
+### Obtener estadísticas de uso
+
+```bash
+GET http://localhost:20128/api/usage?period=today
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "period": "today",
+ "date": "2026-02-04",
+ "summary": {
+ "requests": 1234,
+ "tokens": 26000000,
+ "cost": 4.80
+ },
+ "byModel": [
+ {
+ "model": "cc/claude-opus-4-5",
+ "requests": 456,
+ "tokens": 15000000,
+ "cost": 0
+ },
+ {
+ "model": "glm/glm-4.7",
+ "requests": 234,
+ "tokens": 8000000,
+ "cost": 4.80
+ }
+ ]
+}
+```
+
+---
+
+## Solución de problemas
+
+**Problema: La cuota muestra 0% pero las solicitudes fallan**
+
+**Solución:**
+1. Verifica la conexión del proveedor (Dashboard → Providers)
+2. Verifica que las API keys sean válidas
+3. Verifica si el proveedor está caído (página de estado)
+4. Intenta reconectar los proveedores OAuth
+
+**Problema: Estimación de costos incorrecta**
+
+**Solución:**
+1. Dashboard → Settings → Pricing
+2. Verifica que el precio por proveedor coincida con las tarifas actuales
+3. Actualiza el precio si el proveedor cambió las tarifas
+4. Contacta a soporte si la discrepancia persiste
+
+**Problema: El tiempo de reinicio no se actualiza**
+
+**Solución:**
+1. Refresca el dashboard (F5)
+2. Verifica que la hora del sistema sea correcta
+3. Verifica la configuración de zona horaria
+4. Reinicia 9Router si el problema persiste
+
+**Problema: No se reciben alertas**
+
+**Solución:**
+1. Dashboard → Settings → Alerts
+2. Verifica que la dirección de email sea correcta
+3. Revisa la carpeta de spam
+4. Prueba la notificación (botón Send Test)
+
+---
+
+## Relacionado
+
+- [Enrutamiento inteligente](./smart-routing.md) - Fallback automático según cuota
+- [Combos](./combos.md) - Crea cadenas de fallback personalizadas
diff --git a/gitbook/content/es/features/smart-routing.md b/gitbook/content/es/features/smart-routing.md
new file mode 100644
index 0000000..407d5fe
--- /dev/null
+++ b/gitbook/content/es/features/smart-routing.md
@@ -0,0 +1,407 @@
+# Enrutamiento inteligente y fallback automático
+
+9Router enruta automáticamente tus solicitudes a través del mejor proveedor disponible usando un sistema de fallback de 3 niveles. Nunca dejes de codificar debido a límites de cuota o rate-limiting.
+
+---
+
+## Cómo funciona
+
+9Router usa enrutamiento inteligente para maximizar tus suscripciones existentes, minimizar costos y garantizar disponibilidad 24/7:
+
+```
+Solicitud → 9Router → Verificar Nivel 1 (Suscripción)
+ ↓ cuota agotada
+ Verificar Nivel 2 (Barato)
+ ↓ límite de presupuesto
+ Verificar Nivel 3 (Gratis)
+ ↓
+ Respuesta
+```
+
+### Sistema de fallback de 3 niveles
+
+**Nivel 1: SUSCRIPCIÓN (Primario)**
+- Claude Code (Pro/Max)
+- OpenAI Codex (Plus/Pro)
+- Gemini CLI (GRATIS 180K/mes)
+- GitHub Copilot
+- Antigravity (Google)
+
+**Objetivo**: Maximizar el valor de las suscripciones que ya pagas.
+
+**Nivel 2: BARATO (Respaldo)**
+- GLM-4.7 ($0.60/1M entrada)
+- MiniMax M2.1 ($0.20/1M entrada)
+- Kimi K2 ($9/mes plano)
+
+**Objetivo**: Respaldo ultra-barato cuando se agota la cuota de suscripción (~90% más barato que ChatGPT API).
+
+**Nivel 3: GRATIS (Emergencia)**
+- iFlow (8 modelos)
+- Qwen (3 modelos)
+- Kiro (Claude GRATIS)
+
+**Objetivo**: Fallback de cero costo para codificación ilimitada.
+
+---
+
+## Cambio automático
+
+9Router monitorea la cuota en tiempo real y cambia de proveedor automáticamente:
+
+### Escenario 1: Cuota de suscripción agotada
+
+```
+Solicitud del usuario → cc/claude-opus-4-5
+ ↓ cuota agotada (límite de 5 horas alcanzado)
+ Cambio automático → glm/glm-4.7
+ ↓ cuota diaria agotada
+ Cambio automático → minimax/MiniMax-M2.1
+ ↓ cuota de 5 horas agotada
+ Cambio automático → if/kimi-k2-thinking (GRATIS)
+ ↓
+ Respuesta entregada ✅
+```
+
+**Resultado**: Cero tiempo de inactividad, experiencia sin interrupciones.
+
+### Escenario 2: Rate limiting
+
+```
+Solicitud del usuario → cx/gpt-5.2-codex
+ ↓ rate limited (demasiadas solicitudes)
+ Cambio automático → glm/glm-4.7
+ ↓
+ Respuesta entregada ✅
+```
+
+### Escenario 3: Proveedor no disponible
+
+```
+Solicitud del usuario → cc/claude-opus-4-5
+ ↓ error del proveedor (503)
+ Cambio automático → siguiente modelo disponible
+ ↓
+ Respuesta entregada ✅
+```
+
+---
+
+## Lógica de selección de modelo
+
+9Router selecciona el mejor modelo según:
+
+1. **Disponibilidad de cuota** - Verifica si el proveedor tiene cuota restante
+2. **Nivel de costo** - Prefiere suscripción → barato → gratis
+3. **Tiempo de reinicio** - Considera cuándo se reinicia la cuota
+4. **Salud del proveedor** - Omite proveedores con errores
+
+### Ejemplo de orden de prioridad
+
+Para una solicitud a `cc/claude-opus-4-5`:
+
+```
+1. Verificar cuota de Claude Code
+ ✅ Disponible → Usa cc/claude-opus-4-5
+ ❌ Agotada → Continúa al paso 2
+
+2. Verificar nivel de fallback (si está configurado)
+ ✅ Cuota de GLM disponible → Usa glm/glm-4.7
+ ❌ Agotada → Continúa al paso 3
+
+3. Verificar nivel gratis
+ ✅ iFlow disponible → Usa if/kimi-k2-thinking
+ ❌ Todo agotado → Devuelve error de cuota
+```
+
+---
+
+## Opciones de configuración
+
+### Configuración del dashboard
+
+**1. Habilitar/Deshabilitar fallback automático**
+
+```
+Dashboard → Settings → Smart Routing
+→ Toggle "Auto Fallback" ON/OFF
+```
+
+- **ON** (por defecto): Cambio automático de nivel
+- **OFF**: Modo estricto, devuelve error si el modelo principal no está disponible
+
+**2. Establecer límites de presupuesto**
+
+```
+Dashboard → Settings → Budget Control
+→ Límite diario: $5
+→ Límite mensual: $50
+```
+
+Cuando se alcanza el presupuesto, 9Router cambia automáticamente al nivel gratis.
+
+**3. Configurar el orden de fallback**
+
+```
+Dashboard → Settings → Fallback Priority
+→ Arrastra para reordenar proveedores dentro de cada nivel
+```
+
+Ejemplo de orden personalizado:
+```
+Nivel 1: Gemini CLI → Claude Code → Codex
+Nivel 2: MiniMax → GLM → Kimi
+Nivel 3: iFlow → Kiro → Qwen
+```
+
+**4. Notificaciones de reinicio de cuota**
+
+```
+Dashboard → Settings → Notifications
+→ Email cuando se reinicia la cuota
+→ Alerta cuando se usa 80% de cuota
+```
+
+---
+
+## Ejemplos
+
+### Ejemplo 1: Fallback automático básico
+
+**Configuración:**
+```
+Model: cc/claude-opus-4-5-20251101
+Fallback: Auto (3 niveles por defecto)
+```
+
+**Comportamiento:**
+```
+Mañana (cuota fresca):
+ Solicitud → cc/claude-opus-4-5 ✅
+
+Tarde (cuota agotada):
+ Solicitud → glm/glm-4.7 ✅ (cambio automático)
+
+Noche (cuota de GLM agotada):
+ Solicitud → minimax/MiniMax-M2.1 ✅ (cambio automático)
+
+Madrugada (toda la cuota de pago agotada):
+ Solicitud → if/kimi-k2-thinking ✅ (nivel gratis)
+```
+
+**Costo**: ~$5-10/mes extra (en su mayoría cubierto por la suscripción).
+
+### Ejemplo 2: Enrutamiento consciente del presupuesto
+
+**Configuración:**
+```
+Dashboard → Settings:
+ Presupuesto diario: $2
+ Presupuesto mensual: $20
+ Fallback: Habilitado
+```
+
+**Comportamiento:**
+```
+Día 1-15 (dentro del presupuesto):
+ Solicitudes → glm/glm-4.7 (nivel barato)
+ Costo: $1.50/día
+
+Día 16 (presupuesto alcanzado):
+ Solicitudes → if/kimi-k2-thinking (nivel gratis)
+ Costo: $0
+
+Mes siguiente (presupuesto se reinicia):
+ Solicitudes → glm/glm-4.7 nuevamente
+```
+
+**Resultado**: Nunca excede $20/mes, siempre disponible.
+
+### Ejemplo 3: Modo solo suscripción
+
+**Configuración:**
+```
+Dashboard → Settings:
+ Fallback automático: OFF
+ Modo estricto: ON
+```
+
+**Comportamiento:**
+```
+Solicitud → cc/claude-opus-4-5
+ ✅ Cuota disponible → Éxito
+ ❌ Cuota agotada → Devuelve error (sin fallback)
+```
+
+**Caso de uso**: Cuando solo quieres usar suscripciones de pago, sin costos extras.
+
+### Ejemplo 4: Modo solo gratis
+
+**Configuración:**
+```
+Model: if/kimi-k2-thinking
+Fallback: qw/qwen3-coder-plus → kr/claude-sonnet-4.5
+```
+
+**Comportamiento:**
+```
+Todas las solicitudes → Solo nivel gratis
+Costo: $0 para siempre
+```
+
+**Caso de uso**: Proyectos personales, aprendizaje, experimentación.
+
+---
+
+## Mejores prácticas
+
+### 1. Maximiza el valor de la suscripción
+
+```
+Estrategia:
+- Establece modelos de suscripción como Nivel 1
+- Monitorea el uso de cuota en el dashboard
+- Usa el nivel barato solo cuando la suscripción se agote
+```
+
+**Ejemplo de combo:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 2. Optimiza por costo
+
+```
+Estrategia:
+- Usa el nivel gratis de Gemini CLI primero (180K/mes)
+- Fallback a GLM/MiniMax (ultra-baratos)
+- Emergencia: iFlow (gratis)
+```
+
+**Ejemplo de combo:**
+```
+gc/gemini-3-flash-preview → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 3. Optimiza por calidad
+
+```
+Estrategia:
+- Usa los mejores modelos (Claude Opus, GPT-5.2)
+- Fallback a modelos baratos buenos (GLM-4.7)
+- Último recurso: Nivel gratis
+```
+
+**Ejemplo de combo:**
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → glm/glm-4.7
+```
+
+### 4. Disponibilidad 24/7
+
+```
+Estrategia:
+- Siempre incluye el nivel gratis en el fallback
+- Monitorea los tiempos de reinicio de cuota
+- Distribuye el uso entre proveedores
+```
+
+**Ejemplo de combo:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+**Resultado**: Nunca te quedas sin cuota, codifica en cualquier momento.
+
+---
+
+## Estrategia de reinicio de cuota
+
+Planifica tu uso según los tiempos de reinicio de cuota:
+
+| Proveedor | Reinicio de cuota | Estrategia |
+|----------|-------------|----------|
+| **Claude Code** | 5 horas + semanal | Usar en la mañana, cuota fresca |
+| **Codex** | 5 horas + semanal | Usar después de cuota de Claude |
+| **Gemini CLI** | Diario (1K) + Mensual (180K) | Usar durante el día |
+| **GLM-4.7** | Diario 10:00 AM | Usar en la noche, se reinicia al día siguiente |
+| **MiniMax M2.1** | Rolling 5 horas | Usar cuando sea, rastrea ventana rolling |
+| **iFlow/Qwen/Kiro** | Sin límite | Respaldo de emergencia |
+
+**Ejemplo de rutina diaria:**
+```
+08:00 - 13:00: Claude Code (cuota fresca 5h)
+13:00 - 18:00: Gemini CLI (cuota 1K/día)
+18:00 - 22:00: GLM-4.7 (barato, se reinicia 10AM)
+22:00 - 08:00: MiniMax o iFlow (rolling 5h o gratis)
+```
+
+---
+
+## Monitoreo y alertas
+
+### Rastreador de cuota del dashboard
+
+```
+Dashboard → Quota Overview:
+ Claude Code: 2.5h / 5h restantes (50%)
+ Gemini CLI: 450 / 1000 solicitudes hoy
+ GLM-4.7: 5M / 10M tokens (se reinicia en 8h)
+ MiniMax: 3M / 5M tokens (rolling 5h)
+```
+
+### Notificaciones en tiempo real
+
+```
+Dashboard → Notifications:
+ ⚠️ Cuota de Claude Code 80% usada (1h restante)
+ ✅ Cuota de GLM-4.7 reiniciada (10M tokens disponibles)
+ 💰 Presupuesto diario 50% usado ($2.50 / $5)
+```
+
+### Analítica de uso
+
+```
+Dashboard → Analytics:
+ Hoy: 50M tokens
+ - 30M vía Claude Code (suscripción)
+ - 15M vía GLM-4.7 ($9)
+ - 5M vía iFlow (gratis)
+
+ Costo: $9 (vs $1000 en ChatGPT API)
+ Ahorros: 99%
+```
+
+---
+
+## Solución de problemas
+
+**Problema: "All providers quota exhausted"**
+
+**Solución:**
+1. Verifica el rastreador de cuota del dashboard
+2. Espera el reinicio de cuota (mira la cuenta regresiva)
+3. Agrega el nivel gratis a la cadena de fallback
+4. O aumenta el límite de presupuesto
+
+**Problema: "Demasiados cambios de fallback"**
+
+**Solución:**
+1. Verifica si el proveedor principal está caído
+2. Aumenta los límites de cuota (mejora la suscripción)
+3. Usa un modelo principal más barato (GLM en lugar de Claude)
+
+**Problema: "Costos inesperados"**
+
+**Solución:**
+1. Dashboard → Analytics → Revisa el uso
+2. Establece límites de presupuesto diarios/mensuales
+3. Cambia al nivel gratis para tareas no críticas
+4. Usa combos con fallback gratis
+
+---
+
+## Relacionado
+
+- [Combos](./combos.md) - Crea cadenas de fallback personalizadas
+- [Seguimiento de cuota](./quota-tracking.md) - Monitorea uso y costos
diff --git a/gitbook/content/es/getting-started/installation.md b/gitbook/content/es/getting-started/installation.md
new file mode 100644
index 0000000..8b2b8bd
--- /dev/null
+++ b/gitbook/content/es/getting-started/installation.md
@@ -0,0 +1,478 @@
+# Instalación
+
+Guía detallada de instalación de 9Router con consejos de solución de problemas.
+
+---
+
+## Requisitos
+
+### Requisitos del sistema
+
+- **Node.js**: Versión 20.0.0 o superior
+- **npm**: Versión 10.0.0 o superior (viene con Node.js)
+- **OS**: macOS, Linux, Windows (WSL recomendado)
+- **Espacio en disco**: ~200MB para la instalación
+
+### Verifica tu versión
+
+```bash
+node --version
+# Debería mostrar v20.x.x o superior
+
+npm --version
+# Debería mostrar 10.x.x o superior
+```
+
+**¿No tienes Node.js?** Instálalo desde [nodejs.org](https://nodejs.org/)
+
+---
+
+## Métodos de instalación
+
+### Método 1: Instalación global (Recomendado)
+
+Instala 9Router globalmente para usar desde cualquier lugar:
+
+```bash
+npm install -g 9router
+```
+
+**Iniciar 9Router:**
+
+```bash
+9router
+```
+
+**Beneficios:**
+- ✅ Ejecuta desde cualquier directorio
+- ✅ Comando simple: `9router`
+- ✅ Auto-actualizaciones con `npm update -g 9router`
+
+### Método 2: Instalación local
+
+Instala en un proyecto específico:
+
+```bash
+mkdir my-9router
+cd my-9router
+npm install 9router
+```
+
+**Iniciar 9Router:**
+
+```bash
+npx 9router
+```
+
+**Beneficios:**
+- ✅ Aislado por proyecto
+- ✅ Control de versiones por proyecto
+- ✅ Sin contaminación del namespace global
+
+### Método 3: Desde el código fuente (Desarrollo)
+
+Clona y compila desde GitHub:
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install
+npm run build
+npm start
+```
+
+**Beneficios:**
+- ✅ Últimas características de desarrollo
+- ✅ Contribuir al desarrollo
+- ✅ Modificaciones personalizadas
+
+---
+
+## Primera ejecución
+
+### Iniciar el servidor
+
+```bash
+9router
+```
+
+**Qué sucede:**
+1. El servidor inicia en `http://localhost:20128`
+2. El dashboard se abre automáticamente en el navegador
+3. Se crea el directorio de datos en `~/.9router`
+4. API key generada automáticamente
+
+### Login del dashboard
+
+**Credenciales por defecto:**
+- Contraseña: `123456`
+
+**⚠️ Cambia la contraseña inmediatamente:**
+1. Inicia sesión en el dashboard
+2. Settings → Change Password
+3. Usa una contraseña fuerte
+
+### Obtén tu API key
+
+```
+Dashboard → Settings → API Keys
+→ Copia tu API key
+→ Úsala en herramientas CLI
+```
+
+**Ejemplo de formato de API key:**
+```
+9r_1234567890abcdef1234567890abcdef
+```
+
+---
+
+## Verificar la instalación
+
+### Verifica el estado del servidor
+
+```bash
+curl http://localhost:20128/health
+```
+
+**Respuesta esperada:**
+```json
+{
+ "status": "ok",
+ "version": "1.0.0"
+}
+```
+
+### Lista los modelos disponibles
+
+```bash
+curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+```
+
+**Respuesta esperada:**
+```json
+{
+ "object": "list",
+ "data": [
+ {
+ "id": "cc/claude-opus-4-5-20251101",
+ "object": "model",
+ "created": 1234567890,
+ "owned_by": "claude-code"
+ }
+ ]
+}
+```
+
+### Prueba el chat completion
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "cc/claude-opus-4-5-20251101",
+ "messages": [
+ {"role": "user", "content": "Hello!"}
+ ]
+ }'
+```
+
+---
+
+## Configuración
+
+### Variables de entorno
+
+Crea un archivo `.env` o establece variables de entorno:
+
+```bash
+# Security (REQUIRED in production)
+export JWT_SECRET="your-secure-secret-change-this"
+export INITIAL_PASSWORD="your-password"
+
+# Storage
+export DATA_DIR="~/.9router"
+
+# Server
+export PORT="20128"
+export NODE_ENV="production"
+
+# Logging
+export ENABLE_REQUEST_LOGS="false"
+```
+
+### Directorio de datos
+
+**Ubicación por defecto:** `~/.9router`
+
+**Contenido:**
+```
+~/.9router/
+ ├── db.json # Database (providers, combos, usage)
+ ├── api-keys.json # API keys
+ └── logs/ # Request logs (if enabled)
+```
+
+**Cambiar ubicación:**
+
+```bash
+export DATA_DIR="/custom/path"
+9router
+```
+
+### Configuración de puerto
+
+**Puerto por defecto:** `20128`
+
+**Cambiar puerto:**
+
+```bash
+export PORT="3000"
+9router
+```
+
+**O usa la línea de comandos:**
+
+```bash
+9router --port 3000
+```
+
+---
+
+## Solución de problemas
+
+### Puerto ya en uso
+
+**Error:**
+```
+Error: listen EADDRINUSE: address already in use :::20128
+```
+
+**Solución 1: Mata el proceso existente**
+
+```bash
+# Encuentra proceso usando el puerto 20128
+lsof -i :20128
+
+# Mata el proceso
+kill -9
+```
+
+**Solución 2: Usa otro puerto**
+
+```bash
+9router --port 3000
+```
+
+### Permiso denegado
+
+**Error:**
+```
+Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/9router'
+```
+
+**Solución: Usa sudo (no recomendado) o corrige los permisos de npm**
+
+```bash
+# Corregir permisos de npm (recomendado)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+
+# Luego instalar nuevamente
+npm install -g 9router
+```
+
+### Versión de Node.js muy antigua
+
+**Error:**
+```
+Error: The engine "node" is incompatible with this module
+```
+
+**Solución: Actualizar Node.js**
+
+```bash
+# Usando nvm (recomendado)
+nvm install 20
+nvm use 20
+
+# O descargar desde nodejs.org
+```
+
+### El dashboard no se abre
+
+**Problema:** El dashboard no se abre automáticamente
+
+**Solución 1: Abrir manualmente**
+
+```
+http://localhost:20128
+```
+
+**Solución 2: Verifica el firewall**
+
+```bash
+# macOS: Permitir Node.js en System Preferences → Security
+# Linux: Verificar iptables
+# Windows: Verificar Windows Firewall
+```
+
+### No se puede conectar a proveedores
+
+**Problema:** El login OAuth falla o la API key es inválida
+
+**Solución 1: Verifica la conexión a internet**
+
+```bash
+ping google.com
+```
+
+**Solución 2: Verifica el estado del proveedor**
+
+- Claude Code: [status.anthropic.com](https://status.anthropic.com)
+- OpenAI: [status.openai.com](https://status.openai.com)
+- Gemini: [status.cloud.google.com](https://status.cloud.google.com)
+
+**Solución 3: Regenera la API key**
+
+```
+Dashboard → Provider → Disconnect → Reconnect
+```
+
+### Uso alto de memoria
+
+**Problema:** 9Router usa demasiada RAM
+
+**Solución: Reinicia el servidor**
+
+```bash
+# Detener
+pkill -f 9router
+
+# Iniciar
+9router
+```
+
+**O usa PM2 para auto-reinicio:**
+
+```bash
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+```
+
+---
+
+## Opciones de despliegue
+
+### Desarrollo local
+
+```bash
+npm install -g 9router
+9router
+```
+
+**Caso de uso:** Codificación personal, pruebas
+
+### Servidor VPS/Cloud
+
+```bash
+# Instalar
+npm install -g 9router
+
+# Configurar
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+# Iniciar con PM2
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+pm2 startup
+```
+
+**Caso de uso:** Acceso de equipo, codificación remota
+
+### Docker
+
+```bash
+docker pull 9router/9router:latest
+
+docker run -d \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret" \
+ -e INITIAL_PASSWORD="your-password" \
+ -v 9router-data:/root/.9router \
+ --name 9router \
+ 9router/9router:latest
+```
+
+**Caso de uso:** Despliegue containerizado, Kubernetes
+
+### Proxy reverso (Nginx)
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ location / {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+
+ # SSE support for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+**Caso de uso:** HTTPS, dominio personalizado, balanceo de carga
+
+---
+
+## Desinstalación
+
+### Eliminar instalación global
+
+```bash
+npm uninstall -g 9router
+```
+
+### Eliminar el directorio de datos
+
+```bash
+rm -rf ~/.9router
+```
+
+### Eliminar la configuración
+
+```bash
+# Eliminar variables de entorno del archivo de configuración del shell
+nano ~/.bashrc # o ~/.zshrc
+# Eliminar exports relacionados con 9router
+```
+
+---
+
+## Próximos pasos
+
+- [Guía para empezar](../getting-started.md) - Conecta proveedores y comienza a codificar
+- [Características](../features/) - Explora seguimiento de cuota, combos, despliegue
+- [Solución de problemas](../troubleshooting.md) - Resuelve problemas comunes
+
+---
+
+## ¿Necesitas ayuda?
+
+- **Sitio web**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/es/getting-started/quick-start.md b/gitbook/content/es/getting-started/quick-start.md
new file mode 100644
index 0000000..23d55f0
--- /dev/null
+++ b/gitbook/content/es/getting-started/quick-start.md
@@ -0,0 +1,247 @@
+# Empezar
+
+Pon en marcha 9Router en 5 minutos y comienza a enrutar solicitudes de IA de forma inteligente.
+
+---
+
+## Inicio rápido
+
+### 1. Instalar
+
+```bash
+npm install -g 9router
+```
+
+**Requisitos:** Node.js 20+ ([Detalles de instalación](getting-started/installation.md))
+
+### 2. Iniciar
+
+```bash
+9router
+```
+
+🎉 **El dashboard se abre automáticamente** en `http://localhost:20128`
+
+- Contraseña por defecto: `123456` (cámbiala en el dashboard)
+- API key generada automáticamente
+- Listo para conectar proveedores
+
+### 3. Conectar proveedores
+
+Tienes 3 formas de conectar proveedores:
+
+#### Opción A: OAuth (Proveedores de suscripción)
+
+**Ideal para:** Claude Code, Codex, Gemini CLI, GitHub Copilot
+
+```
+Dashboard → Providers → Connect [Provider]
+→ Login OAuth → Refresh automático de token
+→ Seguimiento de cuota habilitado
+```
+
+**Ejemplo: Claude Code**
+1. Clic en "Connect Claude Code"
+2. Inicia sesión con tu cuenta de Claude
+3. Autoriza 9Router
+4. ✅ ¡Listo! Usa el modelo: `cc/claude-opus-4-5-20251101`
+
+#### Opción B: API Key (Proveedores baratos)
+
+**Ideal para:** GLM, MiniMax, Kimi, OpenRouter
+
+```
+Dashboard → Providers → Add API Key
+→ Selecciona proveedor
+→ Pega API key
+→ Guardar
+```
+
+**Ejemplo: GLM-4.7**
+1. Regístrate en [Zhipu AI](https://open.bigmodel.cn/)
+2. Obtén la API key del Coding Plan
+3. Dashboard → Add API Key → Provider: `glm` → Pega la key
+4. ✅ ¡Listo! Usa el modelo: `glm/glm-4.7`
+
+#### Opción C: Proveedores gratis (Sin costo)
+
+**Ideal para:** iFlow, Qwen, Kiro
+
+```
+Dashboard → Providers → Connect [Free Provider]
+→ Device code u OAuth
+→ Uso ilimitado
+```
+
+**Ejemplo: iFlow**
+1. Clic en "Connect iFlow"
+2. Inicia sesión con tu cuenta de iFlow
+3. Autoriza
+4. ✅ ¡Listo! Usa 8 modelos: `if/kimi-k2-thinking`, `if/qwen3-coder-plus`, etc.
+
+---
+
+## 4. Usar en herramientas CLI
+
+Apunta tu herramienta de codificación a 9Router:
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [desde el dashboard de 9router]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Claude Desktop
+
+Edita `~/.claude/config.json`:
+
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key"
+}
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [desde el dashboard]
+Model: cc/claude-opus-4-5-20251101
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex "your prompt"
+```
+
+---
+
+## 5. Crear combos inteligentes (Opcional)
+
+Los combos habilitan el fallback automático entre modelos:
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101 (Suscripción principal)
+ 2. glm/glm-4.7 (Respaldo barato, $0.6/1M)
+ 3. if/kimi-k2-thinking (Fallback gratis)
+
+Usar en CLI: premium-coding
+```
+
+**Cómo funciona:**
+1. Intenta primero Claude Opus (tu suscripción)
+2. Si la cuota se agota → GLM-4.7 (ultra-barato)
+3. Si llega al límite de presupuesto → iFlow (gratis)
+4. ¡Cero tiempo de inactividad, cambio automático!
+
+---
+
+## Modelos disponibles
+
+### Modelos de suscripción (Maximiza primero)
+
+**Claude Code (`cc/`)** - Suscripción Pro/Max:
+- `cc/claude-opus-4-5-20251101` - Claude 4.5 Opus
+- `cc/claude-sonnet-4-5-20250929` - Claude 4.5 Sonnet
+- `cc/claude-haiku-4-5-20251001` - Claude 4.5 Haiku
+
+**Codex (`cx/`)** - Suscripción Plus/Pro:
+- `cx/gpt-5.2-codex` - GPT 5.2 Codex
+- `cx/gpt-5.1-codex-max` - GPT 5.1 Codex Max
+
+**Gemini CLI (`gc/`)** - GRATIS 180K/mes:
+- `gc/gemini-3-flash-preview` - Gemini 3 Flash Preview
+- `gc/gemini-2.5-pro` - Gemini 2.5 Pro
+
+**GitHub Copilot (`gh/`)** - Suscripción:
+- `gh/gpt-5` - GPT-5
+- `gh/claude-4.5-sonnet` - Claude 4.5 Sonnet
+
+### Modelos baratos (Respaldo)
+
+**GLM (`glm/`)** - $0.6/$2.2 por 1M:
+- `glm/glm-4.7` - GLM 4.7 (reinicio diario 10AM)
+
+**MiniMax (`minimax/`)** - $0.20/$1.00 por 1M:
+- `minimax/MiniMax-M2.1` - MiniMax M2.1 (reinicio 5h)
+
+**Kimi (`kimi/`)** - $9/mes (10M tokens):
+- `kimi/kimi-latest` - Kimi Latest
+
+### Modelos GRATIS (Emergencia)
+
+**iFlow (`if/`)** - 8 modelos GRATIS:
+- `if/kimi-k2-thinking` - Kimi K2 Thinking
+- `if/qwen3-coder-plus` - Qwen3 Coder Plus
+- `if/glm-4.7` - GLM 4.7
+- `if/deepseek-r1` - DeepSeek R1
+
+**Qwen (`qw/`)** - 3 modelos GRATIS:
+- `qw/qwen3-coder-plus` - Qwen3 Coder Plus
+- `qw/qwen3-coder-flash` - Qwen3 Coder Flash
+
+**Kiro (`kr/`)** - 2 modelos GRATIS:
+- `kr/claude-sonnet-4.5` - Claude Sonnet 4.5
+- `kr/claude-haiku-4.5` - Claude Haiku 4.5
+
+---
+
+## Estrategia de optimización de costos
+
+### Presupuesto mensual: $10-20/mes
+
+```
+1. Usa el nivel gratis de Gemini CLI (180K/mes) para tareas rápidas
+2. Usa la cuota de suscripción de Claude Code al máximo (ya pagas)
+3. Fallback a GLM ($0.6/1M) cuando se agote la cuota
+4. Emergencia: MiniMax M2.1 ($0.20/1M) o iFlow (gratis)
+
+Ejemplo real (100M tokens/mes):
+ 60M vía Gemini CLI: $0 (nivel gratis)
+ 30M vía Claude Code: $0 (suscripción que ya tienes)
+ 8M vía GLM: $4.80
+ 2M vía MiniMax: $0.40
+ Total: $5.20/mes + suscripciones existentes
+```
+
+### Estrategia de reinicio de cuota
+
+```
+Rutina diaria:
+1. Mañana: Cuota fresca de Claude Code (reinicio 5h)
+2. Tarde: Cambia a Gemini CLI (1K/día)
+3. Noche: Cuota diaria de GLM (reinicio 10AM del día siguiente)
+4. Madrugada: MiniMax (rolling 5h) o iFlow (gratis)
+
+→ ¡Codifica 24/7 con costo extra mínimo!
+```
+
+---
+
+## Próximos pasos
+
+- [Detalles de instalación](getting-started/installation.md) - Requisitos, troubleshooting
+- [Características](features/) - Explora seguimiento de cuota, combos, despliegue
+- [FAQ](faq.md) - Preguntas y respuestas comunes
+- [Troubleshooting](troubleshooting.md) - Soluciona problemas comunes
+
+---
+
+## ¿Necesitas ayuda?
+
+- **Sitio web**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/es/index.md b/gitbook/content/es/index.md
new file mode 100644
index 0000000..9e7c053
--- /dev/null
+++ b/gitbook/content/es/index.md
@@ -0,0 +1,164 @@
+# Bienvenido a 9Router
+
+**Usa Claude, Codex, Gemini GRATIS • Alternativas ultra-baratas desde $0.20/1M tokens**
+
+9Router es un router de modelos de IA que maximiza el valor de tus suscripciones y minimiza los costos mediante enrutamiento inteligente y fallback automático.
+
+---
+
+## ¿Qué es 9Router?
+
+9Router es un proxy inteligente que se sitúa entre tus herramientas de codificación (Cursor, Cline, Claude Desktop) y los proveedores de IA. Enruta automáticamente las solicitudes al mejor modelo disponible según la cuota, el costo y la disponibilidad.
+
+**Deja de desperdiciar dinero:**
+- ❌ La cuota de suscripción expira sin usar cada mes
+- ❌ Los límites de tasa te detienen a mitad de la codificación
+- ❌ APIs costosas ($20-50/mes por proveedor)
+- ❌ Cambio manual entre proveedores
+
+**Empieza a maximizar el valor:**
+- ✅ **Maximiza tus suscripciones** - Rastrea y usa cada bit de cuota de Claude Code, Codex, Gemini
+- ✅ **GRATIS disponible** - Accede a modelos iFlow, Qwen, Kiro vía CLI
+- ✅ **Respaldo ultra-barato** - GLM ($0.6/1M), MiniMax M2.1 ($0.20/1M)
+- ✅ **Fallback inteligente** - Suscripción → Barato → Gratis, cambio automático
+
+---
+
+## Características clave
+
+### 🔄 Fallback inteligente de 3 niveles
+
+```
+Configura una vez, nunca dejes de codificar:
+
+Nivel 1 (SUSCRIPCIÓN): Claude Code → Codex → Gemini
+ ↓ cuota agotada
+Nivel 2 (BARATO): GLM-4.7 → MiniMax M2.1 → Kimi
+ ↓ límite de presupuesto
+Nivel 3 (GRATIS): iFlow → Qwen → Kiro
+
+→ Cambio automático, sin tiempo de inactividad!
+```
+
+### 📊 Seguimiento de cuota
+
+- Consumo de tokens en tiempo real por proveedor
+- Cuenta regresiva de reinicio (5 horas, diario, semanal, mensual)
+- Estimación de costos para niveles de pago
+- Reportes de gasto mensual
+
+### 🎯 Soporte universal de CLI
+
+Funciona con cualquier herramienta que soporte endpoints personalizados de OpenAI:
+
+✅ **Cursor** • **Cline** • **Claude Desktop** • **Codex** • **RooCode** • **Continue** • **Cualquier herramienta compatible con OpenAI**
+
+### 💰 Optimización de costos
+
+**Ejemplo real (100M tokens/mes):**
+```
+60M vía Gemini CLI: $0 (nivel gratis)
+30M vía Claude Code: $0 (suscripción que ya tienes)
+8M vía GLM: $4.80
+2M vía MiniMax: $0.40
+Total: $5.20/mes vs $2000 en ChatGPT API!
+```
+
+---
+
+## ¿Por qué elegir 9Router?
+
+### Maximiza tus suscripciones
+
+¿Ya pagas Claude Code ($20-100/mes) o Codex ($20-200/mes)? Obtén el valor completo:
+
+- Rastrea el uso de cuota en tiempo real
+- Cambio automático cuando se reinicia la cuota (5 horas, semanal)
+- Usa cada token antes de que expire
+- Gemini CLI: 180K completados/mes **GRATIS**
+
+### Respaldo ultra-barato
+
+Cuando se agota la cuota de suscripción, paga centavos:
+
+| Proveedor | Costo por 1M tokens | Reinicio |
+|----------|-------------------|-------|
+| **GLM-4.7** | $0.60 entrada / $2.20 salida | Diario 10:00 AM |
+| **MiniMax M2.1** | $0.20 entrada / $1.00 salida | 5 horas rolling |
+| **Kimi K2** | $9/mes (10M tokens) | Mensual |
+
+**~90% más barato que ChatGPT API ($20/1M)!**
+
+### Fallback gratis para siempre
+
+Respaldo de emergencia cuando todo lo demás está limitado por cuota:
+
+- **iFlow**: 8 modelos (Kimi K2, Qwen3 Coder Plus, GLM 4.7, MiniMax M2)
+- **Qwen**: 3 modelos (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro**: Claude Sonnet 4.5, Haiku 4.5 (AWS Builder ID)
+
+---
+
+## Inicio rápido
+
+Comienza en 2 minutos:
+
+```bash
+# Instala globalmente
+npm install -g 9router
+
+# Inicia (el dashboard se abre automáticamente)
+9router
+```
+
+🎉 **Se abre el dashboard** → Conecta proveedores → ¡Empieza a codificar!
+
+**Úsalo en tu herramienta CLI:**
+
+```
+Endpoint: http://localhost:20128/v1
+API Key: [desde el dashboard]
+Model: cc/claude-opus-4-5-20251101
+```
+
+[→ Guía completa para empezar](getting-started.md)
+
+---
+
+## Casos de uso
+
+### Para desarrolladores individuales
+
+- Maximiza tu suscripción de Claude Code/Codex
+- Usa el nivel gratis de Gemini CLI (180K/mes)
+- Fallback a modelos ultra-baratos ($0.20/1M)
+- Codifica 24/7 sin límites de tasa
+
+### Para equipos
+
+- Despliega en VPS/Cloud para acceso compartido
+- Rastrea el gasto del equipo en tiempo real
+- Establece límites de presupuesto por nivel
+- Gestión centralizada de proveedores
+
+### Para codificación móvil/remota
+
+- Usa el despliegue en la nube (https://9router.com)
+- Accede desde iPad, teléfono, donde sea
+- Sin limitaciones de localhost
+- Red edge de Cloudflare (300+ ubicaciones)
+
+---
+
+## ¿Qué sigue?
+
+- [Empezar](getting-started.md) - Instala y configura en 5 minutos
+- [Guía de instalación](getting-started/installation.md) - Instrucciones detalladas
+- [Características](features/) - Explora todas las capacidades
+- [FAQ](faq.md) - Preguntas comunes
+
+---
+
+
+ Construido con ❤️ para desarrolladores que maximizan el valor de la IA
+
diff --git a/gitbook/content/es/integration/claude-code.md b/gitbook/content/es/integration/claude-code.md
new file mode 100644
index 0000000..61b3c1f
--- /dev/null
+++ b/gitbook/content/es/integration/claude-code.md
@@ -0,0 +1,109 @@
+# Integración con Claude Code
+
+Integra 9Router con Claude Code CLI para enrutar tus solicitudes de la API de Anthropic a través del sistema de enrutamiento inteligente de 9Router.
+
+## Requisitos previos
+
+- Claude Code CLI instalado
+- 9Router ejecutándose localmente o endpoint en la nube configurado
+- API key del dashboard de 9Router
+
+## Configuración
+
+### 1. Configurar variables de entorno
+
+Establece las siguientes variables de entorno en tu archivo de configuración del shell (`~/.bashrc`, `~/.zshrc`, o `~/.bash_profile`):
+
+```bash
+# Base URL for 9Router
+export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
+
+# Optional: Set default models for aliases
+export ANTHROPIC_DEFAULT_OPUS_MODEL="cc/claude-opus-4-5-20251101"
+export ANTHROPIC_DEFAULT_SONNET_MODEL="cc/claude-sonnet-4-5-20250929"
+export ANTHROPIC_DEFAULT_HAIKU_MODEL="cc/claude-haiku-4-5-20251001"
+```
+
+### 2. Recargar la configuración del shell
+
+```bash
+source ~/.zshrc # o ~/.bashrc
+```
+
+### 3. Verificar la configuración
+
+Verifica que las variables de entorno estén configuradas correctamente:
+
+```bash
+echo $ANTHROPIC_BASE_URL
+```
+
+## Aliases de modelos
+
+Claude Code soporta los siguientes aliases de modelos que mapean a modelos de 9Router:
+
+| Alias | Modelo | Variable de entorno |
+|-------|-------|---------------------|
+| `opus` | Claude Opus 4.5 | `ANTHROPIC_DEFAULT_OPUS_MODEL` |
+| `sonnet` | Claude Sonnet 4.5 | `ANTHROPIC_DEFAULT_SONNET_MODEL` |
+| `haiku` | Claude Haiku 4.5 | `ANTHROPIC_DEFAULT_HAIKU_MODEL` |
+
+## Ejemplos de uso
+
+### Usando aliases de modelos
+
+```bash
+# Usar modelo Opus
+claude --model opus "Explain quantum computing"
+
+# Usar modelo Sonnet
+claude --model sonnet "Write a Python function"
+
+# Usar modelo Haiku
+claude --model haiku "Quick code review"
+```
+
+### Usando nombres completos de modelos
+
+```bash
+claude --model cc/claude-opus-4-5-20251101 "Your prompt here"
+```
+
+## Archivo de configuración
+
+Claude Code almacena su configuración en `~/.claude/settings.json`. Puedes editar este archivo manualmente si es necesario:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "defaultModel": "sonnet"
+}
+```
+
+## Solución de problemas
+
+### Problemas de conexión
+
+Si encuentras errores de conexión:
+
+1. Verifica que 9Router esté corriendo: `curl http://localhost:20128/health`
+2. Verifica que las variables de entorno estén configuradas correctamente
+3. Asegúrate de que ningún firewall esté bloqueando el puerto 20128
+
+### Modelo no encontrado
+
+Si obtienes errores de "modelo no encontrado":
+
+1. Verifica que el nombre del modelo coincida con tu configuración de 9Router
+2. Verifica que la conexión del proveedor esté activa en el dashboard de 9Router
+3. Asegúrate de que el modelo esté disponible en tus proveedores conectados
+
+## Endpoint en la nube
+
+Para usar el endpoint en la nube de 9Router en lugar de localhost:
+
+```bash
+export ANTHROPIC_BASE_URL="https://9router.com"
+```
+
+Asegúrate de haber configurado tu API key en el dashboard en la nube de 9Router.
diff --git a/gitbook/content/es/integration/cline.md b/gitbook/content/es/integration/cline.md
new file mode 100644
index 0000000..07fe447
--- /dev/null
+++ b/gitbook/content/es/integration/cline.md
@@ -0,0 +1,201 @@
+# Integración con Cline
+
+Integra 9Router con la extensión Cline de VSCode para enrutar tus solicitudes de IA a través del sistema de enrutamiento inteligente de 9Router.
+
+## Requisitos previos
+
+- Visual Studio Code instalado
+- Extensión Cline instalada desde el marketplace de VSCode
+- 9Router ejecutándose localmente o endpoint en la nube configurado
+- API key del dashboard de 9Router
+
+## Configuración
+
+### 1. Abrir la configuración de Cline
+
+1. Abre Visual Studio Code
+2. Abre el panel de la extensión Cline (clic en el ícono de Cline en la barra lateral)
+3. Clic en el ícono de **Settings** (engranaje) en el panel de Cline
+
+### 2. Seleccionar el proveedor de API
+
+1. En la configuración de Cline, encuentra el dropdown **API Provider**
+2. Selecciona **Ollama** de la lista
+ - Nota: Usamos el tipo de proveedor Ollama porque es compatible con APIs estilo OpenAI
+
+### 3. Configurar Base URL
+
+Establece la URL base a tu endpoint de 9Router:
+
+**Para 9Router local:**
+```
+http://localhost:20128/v1
+```
+
+**Para 9Router en la nube:**
+```
+https://9router.com
+```
+
+**Pasos:**
+1. En el campo **Base URL**, ingresa tu endpoint de 9Router
+2. Asegúrate de incluir `/v1` al final
+
+### 4. Agregar API Key
+
+1. En el campo **API Key**, ingresa tu API key de 9Router
+2. Puedes encontrar tu API key en el dashboard de 9Router en **Settings → API Keys**
+3. La key debe comenzar con `sk-9router-`
+
+### 5. Seleccionar modelo
+
+1. En el dropdown **Model**, puedes:
+ - Seleccionar de los modelos disponibles (si Cline los auto-detecta)
+ - Ingresar manualmente el nombre del modelo desde tu configuración de 9Router
+
+2. Nombres comunes de modelos:
+ - `gpt-4`
+ - `gpt-4o`
+ - `claude-opus-4-5`
+ - `claude-sonnet-4-5`
+ - `gemini-2.0-flash`
+
+### 6. Guardar la configuración
+
+Clic en **Save** o cierra el panel de configuración. Cline guardará automáticamente tu configuración.
+
+## Ejemplo de configuración
+
+Tu configuración de Cline debería verse así:
+
+```
+API Provider: Ollama
+Base URL: http://localhost:20128/v1
+API Key: sk-9router-xxxxxxxxxxxxx
+Model: gpt-4
+```
+
+## Modelos disponibles
+
+Puedes usar cualquier modelo configurado en tu dashboard de 9Router. Ejemplos comunes:
+
+| Nombre del modelo | Proveedor | Descripción |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## Uso
+
+### Chat con IA
+
+1. Abre el panel de Cline en VSCode
+2. Escribe tu mensaje en el input del chat
+3. Presiona Enter para enviar
+4. Cline usará 9Router para procesar tu solicitud
+
+### Generación de código
+
+1. Pide a Cline que genere código: "Create a React component for a login form"
+2. Cline generará código usando 9Router
+3. Revisa y acepta el código generado
+
+### Explicación de código
+
+1. Selecciona código en tu editor
+2. Pregunta a Cline: "Explain this code"
+3. Obtén explicaciones potenciadas por IA a través de 9Router
+
+### Operaciones con archivos
+
+1. Pide a Cline que cree, modifique o elimine archivos
+2. Cline usará 9Router para entender el contexto y hacer cambios
+3. Revisa los cambios antes de aceptar
+
+## Solución de problemas
+
+### Error "Connection Failed"
+
+1. Verifica que 9Router esté corriendo: `curl http://localhost:20128/health`
+2. Verifica que la URL base sea correcta e incluya `/v1`
+3. Asegúrate de que ningún firewall esté bloqueando el puerto 20128
+4. Intenta reiniciar VSCode
+
+### Error "Invalid API Key"
+
+1. Verifica tu API key en el dashboard de 9Router
+2. Asegúrate de haber copiado la key completa incluyendo el prefijo `sk-9router-`
+3. Verifica que la API key no haya expirado
+4. Intenta regenerar una nueva API key
+
+### Error "Model Not Found"
+
+1. Verifica que el nombre del modelo coincida exactamente con tu configuración de 9Router
+2. Verifica que la conexión del proveedor esté activa en el dashboard de 9Router
+3. Asegúrate de que el modelo esté disponible en tus proveedores conectados
+4. Intenta usar el nombre completo del modelo (ej. `openai/gpt-4` en lugar de `gpt-4`)
+
+### Cline no responde
+
+1. Revisa el panel de output de Cline para mensajes de error
+2. Verifica que tu instancia de 9Router esté ejecutándose y saludable
+3. Intenta recargar la ventana de VSCode (Cmd/Ctrl + Shift + P → "Reload Window")
+4. Revisa los logs de 9Router para cualquier error
+
+## Configuración avanzada
+
+### Usar endpoint en la nube
+
+Para usar el endpoint en la nube de 9Router en lugar de localhost:
+
+1. En la configuración de Cline, establece Base URL a: `https://9router.com`
+2. Asegúrate de haber configurado tu API key en el dashboard en la nube de 9Router
+3. Asegúrate de que tu endpoint en la nube esté activo y accesible
+
+### Múltiples modelos
+
+Puedes cambiar rápidamente entre modelos:
+
+1. Abre la configuración de Cline
+2. Cambia el campo **Model** a otro modelo
+3. Guarda y continúa chateando con el nuevo modelo
+
+### Timeout personalizado
+
+Si experimentas problemas de timeout con solicitudes grandes:
+
+1. Abre la configuración de VSCode (Cmd/Ctrl + ,)
+2. Busca "Cline timeout"
+3. Aumenta el valor de timeout (por defecto suele ser 30 segundos)
+
+## Mejores prácticas
+
+1. **Usa modelos apropiados**: Elige modelos rápidos (como Haiku o Flash) para tareas simples, y modelos más potentes (como Opus o GPT-4) para tareas complejas
+2. **Monitorea el uso**: Revisa el dashboard de 9Router para estadísticas de uso y costos
+3. **Gestión de contexto**: Mantén tus conversaciones enfocadas para reducir el uso de tokens
+4. **Cambio de modelo**: Cambia modelos según la complejidad de la tarea para optimizar costo y rendimiento
+5. **Seguridad de API Key**: Nunca subas tu API key al control de versiones
+
+## Integración con características de 9Router
+
+### Enrutamiento de modelos
+
+9Router enruta automáticamente tus solicitudes al mejor proveedor disponible según:
+- Disponibilidad del modelo
+- Estado de salud del proveedor
+- Optimización de costos
+- Balanceo de carga
+
+### Soporte de fallback
+
+Si un proveedor falla, 9Router automáticamente cambia a proveedores alternativos configurados en tu dashboard.
+
+### Seguimiento de uso
+
+Monitorea tu uso de Cline a través del dashboard de 9Router:
+- Total de solicitudes
+- Uso de tokens
+- Costo por modelo
+- Distribución por proveedor
diff --git a/gitbook/content/es/integration/codex.md b/gitbook/content/es/integration/codex.md
new file mode 100644
index 0000000..db030e8
--- /dev/null
+++ b/gitbook/content/es/integration/codex.md
@@ -0,0 +1,136 @@
+# Integración con OpenAI Codex CLI
+
+Integra 9Router con OpenAI Codex CLI para enrutar tus solicitudes de la API de OpenAI a través del sistema de enrutamiento inteligente de 9Router.
+
+## Requisitos previos
+
+- OpenAI Codex CLI instalado
+- 9Router ejecutándose localmente o endpoint en la nube configurado
+- API key del dashboard de 9Router
+
+## Configuración
+
+### 1. Configurar variables de entorno
+
+Establece las siguientes variables de entorno en tu archivo de configuración del shell (`~/.bashrc`, `~/.zshrc`, o `~/.bash_profile`):
+
+```bash
+# Base URL for 9Router
+export OPENAI_BASE_URL="http://localhost:20128/v1"
+
+# API Key from 9Router dashboard
+export OPENAI_API_KEY="your-9router-api-key"
+```
+
+### 2. Recargar la configuración del shell
+
+```bash
+source ~/.zshrc # o ~/.bashrc
+```
+
+### 3. Verificar la configuración
+
+Verifica que las variables de entorno estén configuradas correctamente:
+
+```bash
+echo $OPENAI_BASE_URL
+echo $OPENAI_API_KEY
+```
+
+## Modelos disponibles
+
+9Router proporciona los siguientes modelos de Codex:
+
+| ID del modelo | Descripción |
+|----------|-------------|
+| `cx/gpt-5.2-codex` | GPT-5.2 Codex - Última versión |
+| `cx/gpt-5.1-codex-max` | GPT-5.1 Codex Max - Contexto extendido |
+
+## Ejemplos de uso
+
+### Uso básico
+
+```bash
+# Usar GPT-5.2 Codex
+codex --model cx/gpt-5.2-codex "Write a function to sort an array"
+
+# Usar GPT-5.1 Codex Max
+codex --model cx/gpt-5.1-codex-max "Explain this complex algorithm"
+```
+
+### Generación de código
+
+```bash
+codex --model cx/gpt-5.2-codex "Create a REST API endpoint for user authentication"
+```
+
+### Explicación de código
+
+```bash
+codex --model cx/gpt-5.1-codex-max "Explain what this code does: $(cat myfile.js)"
+```
+
+## Archivo de configuración
+
+También puedes configurar Codex CLI usando un archivo de configuración. Crea o edita `~/.codex/config.json`:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "apiKey": "your-9router-api-key",
+ "defaultModel": "cx/gpt-5.2-codex"
+}
+```
+
+## Solución de problemas
+
+### Errores de autenticación
+
+Si encuentras errores de autenticación:
+
+1. Verifica que tu API key sea correcta en el dashboard de 9Router
+2. Verifica que la variable de entorno `OPENAI_API_KEY` esté configurada
+3. Asegúrate de que la API key no haya expirado
+
+### Problemas de conexión
+
+Si encuentras errores de conexión:
+
+1. Verifica que 9Router esté corriendo: `curl http://localhost:20128/health`
+2. Verifica que las variables de entorno estén configuradas correctamente
+3. Asegúrate de que ningún firewall esté bloqueando el puerto 20128
+
+### Modelo no disponible
+
+Si obtienes errores de "modelo no disponible":
+
+1. Verifica que el nombre del modelo coincida con tu configuración de 9Router
+2. Verifica que la conexión del proveedor de OpenAI esté activa en el dashboard de 9Router
+3. Asegúrate de que el modelo esté disponible en tus proveedores conectados
+
+## Endpoint en la nube
+
+Para usar el endpoint en la nube de 9Router en lugar de localhost:
+
+```bash
+export OPENAI_BASE_URL="https://9router.com"
+```
+
+Asegúrate de haber configurado tu API key en el dashboard en la nube de 9Router.
+
+## Configuración avanzada
+
+### Timeout personalizado
+
+```bash
+export OPENAI_TIMEOUT=60 # segundos
+```
+
+### Modo debug
+
+Habilita el modo debug para ver logs detallados de request/response:
+
+```bash
+export CODEX_DEBUG=true
+codex --model cx/gpt-5.2-codex "Your prompt"
+```
diff --git a/gitbook/content/es/integration/continue.md b/gitbook/content/es/integration/continue.md
new file mode 100644
index 0000000..9fbecdd
--- /dev/null
+++ b/gitbook/content/es/integration/continue.md
@@ -0,0 +1,249 @@
+# Integración con la extensión Continue de VSCode
+
+Integra 9Router con la extensión Continue para llevar la asistencia de IA directamente a Visual Studio Code.
+
+## Requisitos previos
+
+- Visual Studio Code instalado
+- Extensión Continue instalada desde el marketplace de VSCode
+- API key de 9Router desde el [dashboard](https://9router.com/dashboard)
+- 9Router ejecutándose (local o en la nube)
+
+## Pasos de configuración
+
+### 1. Abrir la configuración de Continue
+
+1. Abre VSCode
+2. Presiona `Cmd+Shift+P` (Mac) o `Ctrl+Shift+P` (Windows/Linux)
+3. Escribe "Continue: Open Config" y selecciónalo
+4. Esto abre `~/.continue/config.json`
+
+### 2. Agregar configuración de modelo de 9Router
+
+Agrega la siguiente configuración a tu `config.json`:
+
+**Configuración de un solo modelo:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**Configuración de múltiples modelos:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus (Best)",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Sonnet (Balanced)",
+ "provider": "openai",
+ "model": "cc/claude-sonnet-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - DeepSeek Chat (Code)",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Haiku (Fast)",
+ "provider": "openai",
+ "model": "cc/claude-haiku-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**Para 9Router en la nube:**
+Reemplaza `apiBase` con:
+```json
+"apiBase": "https://9router.com/v1"
+```
+
+### 3. Guardar y recargar
+
+1. Guarda el archivo de configuración
+2. Recarga la ventana de VSCode: `Cmd+Shift+P` → "Developer: Reload Window"
+3. La extensión Continue cargará la nueva configuración
+
+### 4. Seleccionar modelo
+
+1. Abre la barra lateral de Continue (clic en el ícono de Continue en el panel izquierdo)
+2. Clic en el dropdown selector de modelo en la parte superior
+3. Elige tu modelo preferido de 9Router
+
+## Modelos disponibles
+
+### Modelos Claude (Anthropic)
+- `cc/claude-opus-4-5-20251101` - El más capaz, ideal para tareas complejas
+- `cc/claude-sonnet-4-20250514` - Rendimiento y velocidad equilibrados
+- `cc/claude-haiku-4-20250514` - El más rápido, bueno para tareas simples
+
+### Modelos DeepSeek
+- `cx/deepseek-chat` - Excelente para generación de código
+- `cx/deepseek-reasoner` - Mejor para resolución de problemas complejos
+
+### Modelos GLM (Zhipu AI)
+- `glm/glm-4-plus` - Chino e inglés avanzado
+- `glm/glm-4-flash` - Respuestas rápidas
+
+## Ejemplos de uso
+
+### Explicación de código
+1. Selecciona código en el editor
+2. Abre la barra lateral de Continue
+3. Escribe: "Explain this code"
+4. Modelo: `cc/claude-sonnet-4-20250514`
+
+### Generación de código
+1. Abre la barra lateral de Continue
+2. Escribe: "Create a React component for user profile card"
+3. Modelo: `cx/deepseek-chat`
+
+### Refactorización
+1. Selecciona código para refactorizar
+2. Escribe: "Refactor this to use async/await"
+3. Modelo: `cc/claude-sonnet-4-20250514`
+
+### Corrección de bugs
+1. Selecciona código problemático
+2. Escribe: "Find and fix the bug in this code"
+3. Modelo: `cx/deepseek-reasoner`
+
+## Configuración avanzada
+
+### Prompts de sistema personalizados
+
+Agrega prompts de sistema personalizados para comportamientos específicos:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Code Expert",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "systemMessage": "You are an expert programmer. Always provide clean, well-documented code with best practices."
+ }
+ ]
+}
+```
+
+### Temperatura y parámetros
+
+Ajusta el comportamiento del modelo con parámetros:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Creative Writer",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "temperature": 0.9,
+ "topP": 0.95
+ }
+ ]
+}
+```
+
+### Proveedores de contexto
+
+Configura qué contexto envía Continue al modelo:
+
+```json
+{
+ "contextProviders": [
+ {
+ "name": "code",
+ "params": {
+ "maxLines": 100
+ }
+ },
+ {
+ "name": "diff",
+ "params": {}
+ },
+ {
+ "name": "terminal",
+ "params": {}
+ }
+ ]
+}
+```
+
+## Atajos de teclado
+
+- `Cmd+L` (Mac) / `Ctrl+L` (Windows/Linux) - Abrir chat de Continue
+- `Cmd+I` (Mac) / `Ctrl+I` (Windows/Linux) - Edición inline
+- `Cmd+Shift+R` (Mac) / `Ctrl+Shift+R` (Windows/Linux) - Regenerar respuesta
+
+## Solución de problemas
+
+### El modelo no responde
+- Verifica que 9Router esté corriendo: `curl http://localhost:20128/health`
+- Verifica la API key en config.json
+- Revisa la consola de desarrollador de VSCode por errores: `Help` → `Toggle Developer Tools`
+
+### Modelo incorrecto seleccionado
+- Clic en el dropdown de modelo en la barra lateral de Continue
+- Selecciona el modelo correcto de 9Router
+- El nombre del modelo debe coincidir exactamente (sensible a mayúsculas)
+
+### La configuración no se carga
+- Verifica que la sintaxis JSON sea válida (usa un validador de JSON)
+- Verifica la ubicación del archivo: `~/.continue/config.json`
+- Recarga la ventana de VSCode después de cambios
+
+### Rendimiento lento
+- Cambia a modelos más rápidos (haiku, flash)
+- Reduce el tamaño del contexto en contextProviders
+- Verifica la latencia de red hacia 9Router
+
+## Mejores prácticas
+
+### Estrategia de selección de modelo
+- **Ediciones rápidas**: Usa `cc/claude-haiku-4-20250514`
+- **Generación de código**: Usa `cx/deepseek-chat`
+- **Refactoring complejo**: Usa `cc/claude-opus-4-5-20251101`
+- **Resolución de problemas**: Usa `cx/deepseek-reasoner`
+
+### Gestión de contexto
+- Selecciona solo el código relevante antes de preguntar
+- Usa prompts específicos y claros
+- Divide tareas complejas en pasos más pequeños
+
+### Optimización de costos
+- Usa modelos más rápidos/baratos para tareas simples
+- Limita el tamaño del contexto cuando sea posible
+- Cachea respuestas usadas con frecuencia
+
+## Próximos pasos
+
+- [Configurar Cursor](cursor.md) para integración mejorada con IDE
+- [Configurar Roo](roo.md) para asistente de IA
+- [Explorar uso de CLI](../cli/basic-usage.md)
+- [Aprende sobre la selección de modelos](../models/overview.md)
diff --git a/gitbook/content/es/integration/cursor.md b/gitbook/content/es/integration/cursor.md
new file mode 100644
index 0000000..6fa60f3
--- /dev/null
+++ b/gitbook/content/es/integration/cursor.md
@@ -0,0 +1,149 @@
+# Integración con Cursor
+
+Integra 9Router con Cursor IDE para enrutar tus solicitudes de IA a través del sistema de enrutamiento inteligente de 9Router.
+
+## Requisitos previos
+
+- Cursor IDE instalado
+- Cuenta Cursor Pro (requerida para endpoints de API personalizados)
+- Endpoint en la nube de 9Router configurado
+- API key del dashboard de 9Router
+
+## ⚠️ Notas importantes
+
+> **Endpoint en la nube requerido**: Cursor enruta solicitudes a través de su propio servidor y no soporta endpoints localhost. Debes usar el endpoint en la nube de 9Router: `https://9router.com`
+
+> **Cursor Pro requerido**: Esta característica requiere una cuenta Cursor Pro para usar endpoints de API personalizados.
+
+## Configuración
+
+### 1. Abrir la configuración de Cursor
+
+1. Abre Cursor IDE
+2. Ve a **Settings** (Cmd/Ctrl + ,)
+3. Navega a la sección **Models**
+
+### 2. Habilitar OpenAI API
+
+1. Encuentra la opción **OpenAI API key**
+2. Activa el toggle para habilitar la configuración de API personalizada
+
+### 3. Configurar Base URL
+
+Establece la URL base al endpoint en la nube de 9Router:
+
+```
+https://9router.com
+```
+
+**Pasos:**
+1. En la configuración de Models, localiza el campo **Base URL**
+2. Ingresa: `https://9router.com`
+3. Clic en **Save**
+
+### 4. Agregar API Key
+
+1. En el campo **API Key**, ingresa tu API key de 9Router
+2. Puedes encontrar tu API key en el dashboard de 9Router en **Settings → API Keys**
+3. Clic en **Save**
+
+### 5. Agregar modelo personalizado
+
+1. Clic en el botón **View All Models**
+2. Clic en **Add Custom Model**
+3. Ingresa el nombre del modelo desde tu configuración de 9Router (ej. `gpt-4`, `claude-opus-4-5`, etc.)
+4. Clic en **Add**
+
+### 6. Seleccionar modelo
+
+1. En la interfaz de chat de Cursor, clic en el dropdown selector de modelo
+2. Elige tu modelo personalizado de la lista
+3. ¡Empieza a usar 9Router con Cursor!
+
+## Ejemplo de configuración
+
+Tu configuración de Cursor debería verse así:
+
+```
+OpenAI API: ✓ Enabled
+Base URL: https://9router.com
+API Key: sk-9router-xxxxxxxxxxxxx
+Custom Models: gpt-4, claude-opus-4-5, gemini-2.0-flash
+```
+
+## Modelos disponibles
+
+Puedes usar cualquier modelo configurado en tu dashboard de 9Router. Ejemplos comunes:
+
+| Nombre del modelo | Proveedor | Descripción |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## Uso
+
+### Interfaz de chat
+
+1. Abre el chat de Cursor (Cmd/Ctrl + L)
+2. Selecciona tu modelo del dropdown
+3. Comienza a chatear con IA a través de 9Router
+
+### Generación de código inline
+
+1. Selecciona código en tu editor
+2. Presiona Cmd/Ctrl + K
+3. Ingresa tu prompt
+4. Cursor usará 9Router para generar código
+
+### Explicación de código
+
+1. Selecciona código en tu editor
+2. Presiona Cmd/Ctrl + L
+3. Pregunta "Explain this code"
+4. Obtén explicaciones potenciadas por IA a través de 9Router
+
+## Solución de problemas
+
+### Error "Invalid API Key"
+
+1. Verifica tu API key en el dashboard de 9Router
+2. Asegúrate de haber copiado la key completa incluyendo el prefijo `sk-9router-`
+3. Verifica que la API key no haya expirado
+4. Intenta regenerar una nueva API key
+
+### Error "Model Not Found"
+
+1. Verifica que el nombre del modelo coincida exactamente con tu configuración de 9Router
+2. Verifica que la conexión del proveedor esté activa en el dashboard de 9Router
+3. Asegúrate de que el modelo esté disponible en tus proveedores conectados
+4. Intenta usar el nombre completo del modelo (ej. `openai/gpt-4` en lugar de `gpt-4`)
+
+### Problemas de conexión
+
+1. Verifica que estés usando el endpoint en la nube: `https://9router.com`
+2. Verifica tu conexión a internet
+3. Asegúrate de que el servicio en la nube de 9Router esté operativo
+4. Intenta deshabilitar VPN o proxy si está habilitado
+
+### Localhost no funciona
+
+> **Recuerda**: Cursor no soporta endpoints localhost. Debes usar el endpoint en la nube `https://9router.com`. Si necesitas usar una instancia local de 9Router, considera usar un servicio de tunneling como ngrok para exponer tu endpoint local.
+
+## Configuración del endpoint en la nube
+
+Si estás ejecutando 9Router localmente y quieres usarlo con Cursor:
+
+1. Habilita el endpoint en la nube en la configuración de 9Router
+2. Configura tu URL del endpoint en la nube en el dashboard de 9Router
+3. Usa la URL en la nube en la configuración de Cursor
+4. Asegúrate de que tu instancia local de 9Router sea accesible desde internet
+
+## Mejores prácticas
+
+1. **Usa aliases de modelos**: Crea aliases cortos para modelos usados con frecuencia en 9Router
+2. **Monitorea el uso**: Revisa el dashboard de 9Router para estadísticas de uso y costos
+3. **Rota las API Keys**: Rota tus API keys regularmente por seguridad
+4. **Prueba modelos**: Prueba diferentes modelos para encontrar el mejor para tu caso de uso
diff --git a/gitbook/content/es/integration/other-tools.md b/gitbook/content/es/integration/other-tools.md
new file mode 100644
index 0000000..62816f8
--- /dev/null
+++ b/gitbook/content/es/integration/other-tools.md
@@ -0,0 +1,416 @@
+# Integración con otras herramientas
+
+9Router es compatible con cualquier herramienta que soporte el formato de API de OpenAI. Esta guía cubre patrones de integración genéricos para varias herramientas y aplicaciones personalizadas.
+
+## Resumen
+
+9Router proporciona un endpoint de API compatible con OpenAI que funciona con:
+- Scripts y aplicaciones personalizadas
+- Clientes de API y herramientas de testing
+- Herramientas CLI y utilidades
+- Integraciones de terceros
+- Frameworks de desarrollo
+
+## Patrón de configuración genérico
+
+Cualquier herramienta compatible con OpenAI puede conectarse a 9Router usando estas configuraciones:
+
+**9Router local:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+Model: cualquier modelo de 9Router (cc/*, cx/*, glm/*, etc.)
+```
+
+**9Router en la nube:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+Model: cualquier modelo de 9Router (cc/*, cx/*, glm/*, etc.)
+```
+
+## Modelos disponibles
+
+### Modelos Claude (Anthropic)
+- `cc/claude-opus-4-5-20251101`
+- `cc/claude-sonnet-4-20250514`
+- `cc/claude-haiku-4-20250514`
+
+### Modelos DeepSeek
+- `cx/deepseek-chat`
+- `cx/deepseek-reasoner`
+
+### Modelos GLM (Zhipu AI)
+- `glm/glm-4-plus`
+- `glm/glm-4-flash`
+
+## Ejemplos de integración
+
+### Python con OpenAI SDK
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+)
+
+print(response.choices[0].message.content)
+```
+
+### Node.js con OpenAI SDK
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+const response = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [
+ { role: "user", content: "Hello, how are you?" }
+ ]
+});
+
+console.log(response.choices[0].message.content);
+```
+
+### Comando cURL
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer your-api-key-from-dashboard" \
+ -d '{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+ }'
+```
+
+### Cliente HTTP (Postman, Insomnia)
+
+**Solicitud:**
+```
+POST http://localhost:20128/v1/chat/completions
+```
+
+**Headers:**
+```
+Content-Type: application/json
+Authorization: Bearer your-api-key-from-dashboard
+```
+
+**Body:**
+```json
+{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ],
+ "temperature": 0.7,
+ "max_tokens": 1000
+}
+```
+
+### Integración con LangChain
+
+```python
+from langchain.chat_models import ChatOpenAI
+from langchain.schema import HumanMessage
+
+llm = ChatOpenAI(
+ model_name="cc/claude-sonnet-4-20250514",
+ openai_api_key="your-api-key-from-dashboard",
+ openai_api_base="http://localhost:20128/v1",
+ temperature=0.7
+)
+
+messages = [HumanMessage(content="Explain quantum computing")]
+response = llm(messages)
+print(response.content)
+```
+
+### Integración con LlamaIndex
+
+```python
+from llama_index.llms import OpenAI
+
+llm = OpenAI(
+ model="cc/claude-sonnet-4-20250514",
+ api_key="your-api-key-from-dashboard",
+ api_base="http://localhost:20128/v1"
+)
+
+response = llm.complete("What is machine learning?")
+print(response.text)
+```
+
+## Ejemplos de scripts personalizados
+
+### Script de procesamiento por lotes
+
+```python
+import openai
+import json
+
+openai.api_key = "your-api-key-from-dashboard"
+openai.api_base = "http://localhost:20128/v1"
+
+def process_batch(prompts, model="cx/deepseek-chat"):
+ results = []
+ for prompt in prompts:
+ response = openai.ChatCompletion.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ results.append({
+ "prompt": prompt,
+ "response": response.choices[0].message.content
+ })
+ return results
+
+prompts = [
+ "Explain AI in one sentence",
+ "What is machine learning?",
+ "Define neural networks"
+]
+
+results = process_batch(prompts)
+print(json.dumps(results, indent=2))
+```
+
+### Manejador de respuestas streaming
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+async function streamResponse(prompt) {
+ const stream = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [{ role: "user", content: prompt }],
+ stream: true
+ });
+
+ for await (const chunk of stream) {
+ const content = chunk.choices[0]?.delta?.content || "";
+ process.stdout.write(content);
+ }
+}
+
+streamResponse("Write a short story about AI");
+```
+
+### Comparación multi-modelo
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+models = [
+ "cc/claude-sonnet-4-20250514",
+ "cx/deepseek-chat",
+ "glm/glm-4-plus"
+]
+
+prompt = "Explain quantum computing in simple terms"
+
+for model in models:
+ response = client.chat.completions.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ print(f"\n=== {model} ===")
+ print(response.choices[0].message.content)
+```
+
+## Patrones comunes de integración
+
+### Variables de entorno
+
+Almacena credenciales de forma segura:
+
+```bash
+# .env file
+ROUTER_API_KEY=your-api-key-from-dashboard
+ROUTER_BASE_URL=http://localhost:20128/v1
+ROUTER_MODEL=cc/claude-sonnet-4-20250514
+```
+
+```python
+import os
+from openai import OpenAI
+
+client = OpenAI(
+ api_key=os.getenv("ROUTER_API_KEY"),
+ base_url=os.getenv("ROUTER_BASE_URL")
+)
+```
+
+### Manejo de errores
+
+```python
+from openai import OpenAI, OpenAIError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": "Hello"}]
+ )
+ print(response.choices[0].message.content)
+except OpenAIError as e:
+ print(f"Error: {e}")
+```
+
+### Lógica de reintentos
+
+```python
+import time
+from openai import OpenAI, RateLimitError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+def chat_with_retry(prompt, max_retries=3):
+ for attempt in range(max_retries):
+ try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": prompt}]
+ )
+ return response.choices[0].message.content
+ except RateLimitError:
+ if attempt < max_retries - 1:
+ time.sleep(2 ** attempt) # Exponential backoff
+ else:
+ raise
+```
+
+## Solución de problemas
+
+### Problemas de conexión
+
+**Problema:** No se puede conectar a 9Router
+```bash
+# Verifica si 9Router está corriendo
+curl http://localhost:20128/health
+
+# Respuesta esperada:
+{"status": "ok"}
+```
+
+**Solución:**
+- Verifica que 9Router esté corriendo
+- Verifica que el puerto 20128 no esté bloqueado
+- Asegúrate de tener la URL base correcta (incluir `/v1`)
+
+### Errores de autenticación
+
+**Problema:** 401 Unauthorized
+```
+Error: Invalid API key
+```
+
+**Solución:**
+- Verifica la API key desde el dashboard
+- Verifica el formato del header de Authorization: `Bearer your-api-key`
+- Asegúrate de no tener espacios extras o saltos de línea en la API key
+
+### Modelo no encontrado
+
+**Problema:** 404 Model not found
+```
+Error: Model 'cc/claude-opus' not found
+```
+
+**Solución:**
+- Usa el nombre exacto del modelo (sensible a mayúsculas)
+- Verifica los modelos disponibles: `curl http://localhost:20128/v1/models`
+- Verifica que el modelo esté habilitado en tu plan
+
+### Problemas de timeout
+
+**Problema:** Request timeout
+```
+Error: Request timed out after 30s
+```
+
+**Solución:**
+- Aumenta el timeout en la configuración del cliente
+- Usa modelos más rápidos para tareas sensibles al tiempo
+- Verifica la conexión de red a 9Router
+
+### Rate limiting
+
+**Problema:** 429 Too Many Requests
+```
+Error: Rate limit exceeded
+```
+
+**Solución:**
+- Implementa exponential backoff
+- Reduce la frecuencia de solicitudes
+- Verifica los límites de tasa en el dashboard
+- Considera actualizar tu plan
+
+## Mejores prácticas
+
+### Seguridad
+- Almacena las API keys en variables de entorno
+- Nunca subas las API keys al control de versiones
+- Usa HTTPS para despliegues en la nube
+- Rota las API keys regularmente
+
+### Rendimiento
+- Usa modelos apropiados para la complejidad de la tarea
+- Implementa caché para consultas repetidas
+- Usa streaming para respuestas largas
+- Agrupa solicitudes cuando sea posible
+
+### Manejo de errores
+- Siempre implementa bloques try-catch
+- Agrega lógica de reintento con exponential backoff
+- Registra errores para debugging
+- Proporciona mecanismos de fallback
+
+### Optimización de costos
+- Elige modelos costo-efectivos para tareas simples
+- Cachea respuestas cuando sea apropiado
+- Monitorea el uso en el dashboard
+- Establece límites de solicitudes en el código
+
+## Próximos pasos
+
+- [Configurar Cursor](cursor.md) para integración con IDE
+- [Configurar Continue](continue.md) para VSCode
+- [Explorar uso de CLI](../cli/basic-usage.md)
+- [Aprende sobre la selección de modelos](../models/overview.md)
+- [Referencia de API](../api/reference.md)
diff --git a/gitbook/content/es/integration/roo.md b/gitbook/content/es/integration/roo.md
new file mode 100644
index 0000000..b4f4c67
--- /dev/null
+++ b/gitbook/content/es/integration/roo.md
@@ -0,0 +1,127 @@
+# Integración con Roo AI Assistant
+
+Integra 9Router con Roo AI Assistant para acceder a múltiples modelos de IA a través de una interfaz unificada.
+
+## Requisitos previos
+
+- Roo AI Assistant instalado
+- API key de 9Router desde el [dashboard](https://9router.com/dashboard)
+- 9Router ejecutándose (local o en la nube)
+
+## Pasos de configuración
+
+### 1. Abrir la configuración de Roo
+
+Inicia Roo AI Assistant y abre el panel de configuración.
+
+### 2. Configurar el proveedor de API
+
+1. Navega a la configuración de **API Provider**
+2. Selecciona **Ollama** como tipo de proveedor
+3. Configura los siguientes ajustes:
+
+**Para 9Router local:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+```
+
+**Para 9Router en la nube:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+```
+
+### 3. Seleccionar modelo
+
+Elige entre los modelos disponibles de 9Router:
+
+**Modelos Claude:**
+- `cc/claude-opus-4-5-20251101` - El más capaz
+- `cc/claude-sonnet-4-20250514` - Equilibrado
+- `cc/claude-haiku-4-20250514` - Rápido
+
+**Modelos DeepSeek:**
+- `cx/deepseek-chat` - Propósito general
+- `cx/deepseek-reasoner` - Razonamiento complejo
+
+**Modelos GLM:**
+- `glm/glm-4-plus` - Avanzado
+- `glm/glm-4-flash` - Respuestas rápidas
+
+### 4. Probar la conexión
+
+Envía un mensaje de prueba para verificar la integración:
+
+```
+Hello! Can you confirm you're connected through 9Router?
+```
+
+## Ejemplos de uso
+
+### Chat básico
+```
+Pregunta a Roo: "Explain quantum computing in simple terms"
+Modelo: cc/claude-sonnet-4-20250514
+```
+
+### Generación de código
+```
+Pregunta a Roo: "Write a Python function to calculate Fibonacci numbers"
+Modelo: cx/deepseek-chat
+```
+
+### Razonamiento complejo
+```
+Pregunta a Roo: "Analyze the trade-offs between microservices and monolithic architecture"
+Modelo: cx/deepseek-reasoner
+```
+
+## Consejos de selección de modelo
+
+- **Tareas rápidas**: Usa `cc/claude-haiku-4-20250514` o `glm/glm-4-flash`
+- **Rendimiento equilibrado**: Usa `cc/claude-sonnet-4-20250514` o `cx/deepseek-chat`
+- **Razonamiento complejo**: Usa `cc/claude-opus-4-5-20251101` o `cx/deepseek-reasoner`
+- **Optimización de costos**: Usa modelos DeepSeek o GLM
+
+## Solución de problemas
+
+### Connection Failed
+- Verifica que 9Router esté corriendo: `curl http://localhost:20128/health`
+- Verifica que la API key sea correcta
+- Asegúrate de que la Base URL incluya el sufijo `/v1`
+
+### Modelo no disponible
+- Verifica que el nombre del modelo coincida exactamente (sensible a mayúsculas)
+- Verifica que el modelo esté habilitado en tu plan de 9Router
+- Intenta otro modelo de la lista
+
+### Respuestas lentas
+- Cambia a modelos más rápidos (haiku, flash)
+- Verifica la conexión de red
+- Monitorea los logs de 9Router por problemas
+
+## Configuración avanzada
+
+### Aliases personalizados de modelos
+
+Puedes crear atajos para modelos usados con frecuencia en la configuración de Roo:
+
+```
+Alias: "fast" → cc/claude-haiku-4-20250514
+Alias: "smart" → cc/claude-opus-4-5-20251101
+Alias: "code" → cx/deepseek-chat
+```
+
+### Múltiples perfiles
+
+Configura diferentes perfiles para distintos casos de uso:
+- **Desarrollo**: Modelos DeepSeek para código
+- **Escritura**: Modelos Claude para contenido
+- **Investigación**: Modelos reasoner para análisis
+
+## Próximos pasos
+
+- [Configurar Cursor](cursor.md) para integración con IDE
+- [Configurar Continue](continue.md) para VSCode
+- [Explorar uso de CLI](../cli/basic-usage.md)
diff --git a/gitbook/content/es/providers/cheap.md b/gitbook/content/es/providers/cheap.md
new file mode 100644
index 0000000..757199a
--- /dev/null
+++ b/gitbook/content/es/providers/cheap.md
@@ -0,0 +1,462 @@
+# Proveedores baratos - Respaldo ultra-barato
+
+Cuando se agota la cuota de suscripción, paga centavos en lugar de dólares. ¡~90% más barato que ChatGPT API!
+
+---
+
+## Resumen
+
+Los proveedores del nivel barato son tu **respaldo** cuando se agota la cuota de suscripción:
+
+- 💰 **GLM-4.7** - $0.6/$2.2 por 1M tokens (reinicio diario)
+- 💰 **MiniMax M2.1** - $0.2/$1.0 por 1M tokens (reinicio 5h)
+- 💰 **Kimi K2** - $9/mes plano (10M tokens)
+
+**Estrategia:** Úsalos después de agotar la cuota de suscripción, antes del nivel gratis. Ahorros masivos vs ChatGPT API ($20/1M).
+
+---
+
+## GLM-4.7 (Reinicio diario)
+
+### Precios
+
+| Nivel | Entrada | Salida | Reinicio |
+|------|-------|--------|-------|
+| Standard | $0.60/1M | $2.20/1M | Diario 10:00 AM |
+| Coding Plan | $0.60/1M | $2.20/1M | Diario 10:00 AM (3× cuota) |
+
+**Ejemplo de costo (10M tokens):**
+- Entrada: 10M × $0.60 = $6
+- Salida: 10M × $2.20 = $22
+- **Total: $6-22** ¡vs $200 en ChatGPT API!
+
+### Configuración
+
+**Paso 1: Registrarse**
+
+1. Visita [Zhipu AI](https://open.bigmodel.cn/)
+2. Crea cuenta (verificación por teléfono)
+3. Elige **Coding Plan** para 3× cuota al mismo precio
+
+**Paso 2: Obtener API Key**
+
+```bash
+Dashboard → API Keys → Create New
+→ Copia la API key (comienza con "zhipu-")
+```
+
+**Paso 3: Agregar a 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: glm
+API Key: zhipu-your-api-key-here
+```
+
+**Paso 4: Usar en CLI**
+
+```
+Model: glm/glm-4.7
+ glm/glm-4.6v (vision)
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Contexto | Ideal para |
+|----------|-------------|---------|----------|
+| `glm/glm-4.7` | GLM 4.7 | 128K | Codificación, tareas generales |
+| `glm/glm-4.6v` | GLM 4.6V Vision | 128K | Análisis de imágenes |
+
+### Pro Tips
+
+- **Coding Plan** - 3× cuota al mismo precio ($0.6/$2.2)
+- **Reinicio diario** - Cuota fresca a las 10:00 AM hora de Beijing
+- **Ideal para codificación** - Optimizado para generación de código
+- **128K de contexto** - Maneja archivos grandes
+
+### Reinicio de cuota
+
+```
+Reinicio diario: 10:00 AM hora Beijing (UTC+8)
+→ 2:00 AM UTC
+→ 6:00 PM PST (día anterior)
+→ 9:00 PM EST (día anterior)
+
+¡Planifica tus tareas pesadas según el tiempo de reinicio!
+```
+
+---
+
+## MiniMax M2.1 (Reinicio 5 horas)
+
+### Precios
+
+| Nivel | Entrada | Salida | Reinicio |
+|------|-------|--------|-------|
+| Standard | $0.20/1M | $1.00/1M | Rolling 5 horas |
+
+**Ejemplo de costo (10M tokens):**
+- Entrada: 10M × $0.20 = $2
+- Salida: 10M × $1.00 = $10
+- **Total: $2-10** - ¡La opción más barata!
+
+### Configuración
+
+**Paso 1: Registrarse**
+
+1. Visita [MiniMax](https://www.minimax.io/)
+2. Crea cuenta
+3. Verifica email/teléfono
+
+**Paso 2: Obtener API Key**
+
+```bash
+Dashboard → API Management → Create Key
+→ Copia la API key
+```
+
+**Paso 3: Agregar a 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: minimax
+API Key: your-minimax-api-key
+```
+
+**Paso 4: Usar en CLI**
+
+```
+Model: minimax/MiniMax-M2.1
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Contexto | Ideal para |
+|----------|-------------|---------|----------|
+| `minimax/MiniMax-M2.1` | MiniMax M2.1 | 1M tokens | Contexto largo, codificación |
+
+### Pro Tips
+
+- **La opción más barata** - $0.20/1M entrada (90% más barato que ChatGPT)
+- **Rolling 5 horas** - La cuota se reinicia cada 5 horas
+- **Contexto de 1M** - Ventana de contexto masiva
+- **Ideal para archivos largos** - Maneja codebases enteras
+
+### Reinicio de cuota
+
+```
+Ventana rolling de 5 horas:
+→ Usar cuota → Esperar 5 horas → Cuota fresca
+
+Ejemplo:
+10:00 AM - Usar 5M tokens
+3:00 PM - Cuota fresca disponible
+8:00 PM - Cuota fresca disponible
+
+¡Codifica 24/7 con costo mínimo!
+```
+
+---
+
+## Kimi K2 ($9/mes plano)
+
+### Precios
+
+| Plan | Costo mensual | Tokens incluidos | Costo efectivo |
+|------|--------------|-----------------|----------------|
+| Subscription | $9 | 10M tokens | $0.90/1M |
+
+**Ejemplo de costo:**
+- $9/mes plano
+- 10M tokens incluidos
+- **Efectivo: $0.90/1M** - ¡Mejor valor para uso constante!
+
+### Configuración
+
+**Paso 1: Suscribirse**
+
+1. Visita [Moonshot AI](https://platform.moonshot.ai/)
+2. Crea cuenta
+3. Suscríbete al plan $9/mes
+
+**Paso 2: Obtener API Key**
+
+```bash
+Dashboard → API Keys → Create New
+→ Copia la API key
+```
+
+**Paso 3: Agregar a 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: kimi
+API Key: your-kimi-api-key
+```
+
+**Paso 4: Usar en CLI**
+
+```
+Model: kimi/kimi-latest
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Contexto | Ideal para |
+|----------|-------------|---------|----------|
+| `kimi/kimi-latest` | Kimi Latest | 200K | Codificación general |
+
+### Pro Tips
+
+- **Costo fijo** - $9/mes sin importar el uso (hasta 10M)
+- **Ideal para uso constante** - Si usas 10M/mes, solo $0.90/1M
+- **Reinicio mensual** - 10M tokens se reinician mensualmente
+- **Facturación predecible** - Sin costos sorpresa
+
+### Reinicio de cuota
+
+```
+Reinicio mensual: 1ro de cada mes
+→ 10M tokens se refrescan
+
+Ejemplo de uso mensual:
+Semana 1: 3M tokens
+Semana 2: 2M tokens
+Semana 3: 3M tokens
+Semana 4: 2M tokens
+Total: 10M tokens = $9 plano
+```
+
+---
+
+## Comparación de precios
+
+| Proveedor | Entrada/1M | Salida/1M | Reinicio | Costo 10M | Ideal para |
+|----------|----------|-----------|-------|----------|----------|
+| **GLM-4.7** | $0.60 | $2.20 | Diario 10AM | $6-22 | Usuarios con cuota diaria |
+| **MiniMax M2.1** | $0.20 | $1.00 | 5 horas | $2-10 | **¡La más barata!** |
+| **Kimi K2** | $0.90 | $0.90 | Mensual | **$9 plano** | Uso constante |
+| ChatGPT API | $20.00 | $20.00 | Ninguno | $200 | ❌ Costoso |
+
+**Ahorros:** ¡90-95% más barato que ChatGPT API!
+
+---
+
+## Ejemplo de uso
+
+### Configuración en Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [desde el dashboard de 9router]
+ Model: glm/glm-4.7
+```
+
+### Crear combo (Recomendado)
+
+```
+Dashboard → Combos → Create New
+
+Name: cheap-backup
+Models:
+ 1. cc/claude-opus-4-5 (Suscripción principal)
+ 2. glm/glm-4.7 (Respaldo barato, reinicio diario)
+ 3. minimax/MiniMax-M2.1 (Fallback más barato)
+ 4. if/kimi-k2-thinking (Emergencia GRATIS)
+
+Usar en CLI: cheap-backup
+```
+
+**Resultado:** Suscripción → Barato → Más barato → Gratis
+
+---
+
+## Optimización de costos
+
+### Estrategia 1: Rutina de reinicio diario
+
+```
+Mañana (10AM): Cuota fresca de GLM
+→ Usa GLM para tareas pesadas
+→ Ahorra cuota de suscripción
+
+Tarde: Cuota de suscripción
+→ Usa Claude/Codex para tareas complejas
+
+Noche: MiniMax (reinicio 5h)
+→ Respaldo barato para trabajo nocturno
+
+Madrugada: Nivel gratis (iFlow)
+→ Respaldo de emergencia cero costo
+```
+
+### Estrategia 2: Presupuesto primero
+
+```
+Establece presupuesto mensual: $20
+
+Asignación:
+- $9 Kimi K2 (10M tokens plano)
+- $6 cuota diaria de GLM (10M tokens)
+- $5 overflow de MiniMax (25M tokens)
+
+Total: 45M tokens por $20
+¡vs 1M tokens por $20 en ChatGPT API!
+```
+
+### Estrategia 3: Maximiza suscripciones primero
+
+```
+Prioridad:
+1. Gemini CLI (180K/mes GRATIS)
+2. Claude Code (suscripción que ya pagas)
+3. GLM-4.7 (respaldo barato, $0.6/1M)
+4. MiniMax M2.1 (más barato, $0.2/1M)
+5. iFlow (emergencia GRATIS)
+
+Ejemplo de costo mensual (100M tokens):
+- 60M vía Gemini CLI: $0 (gratis)
+- 30M vía Claude Code: $0 (suscripción)
+- 8M vía GLM: $4.80
+- 2M vía MiniMax: $0.40
+¡Total: $5.20/mes!
+```
+
+---
+
+## Ejemplos reales
+
+### Ejemplo 1: Mes de codificación intensa (100M tokens)
+
+```
+Desglose:
+- 60M vía suscripción (Claude/Codex): $0 extra
+- 30M vía GLM-4.7: $18
+- 10M vía MiniMax M2.1: $2
+
+Total: $20/mes
+¡vs $2000 en ChatGPT API!
+
+Ahorros: ¡99% más barato!
+```
+
+### Ejemplo 2: Codificador con presupuesto ($10/mes)
+
+```
+Estrategia:
+- $9 Kimi K2 (10M tokens)
+- $1 overflow de MiniMax (5M tokens)
+
+Total: 15M tokens por $10
+¡vs 0.5M tokens por $10 en ChatGPT API!
+
+¡30× más tokens!
+```
+
+### Ejemplo 3: Freelancer (Uso variable)
+
+```
+Mes ligero (20M tokens):
+- 15M vía suscripción: $0
+- 5M vía GLM: $3
+Total: $3
+
+Mes intenso (150M tokens):
+- 60M vía suscripción: $0
+- 60M vía GLM: $36
+- 30M vía MiniMax: $6
+Total: $42
+
+Promedio: $22.50/mes
+¡vs $3400 en ChatGPT API!
+```
+
+---
+
+## Mejores prácticas
+
+### 1. Rastrea la cuota diaria
+
+```
+El dashboard muestra:
+- Cuota GLM: 75% usado (reinicio en 6h)
+- Cuota MiniMax: 50% usado (reinicio en 2h)
+- Cuota Kimi: 8M/10M usado (reinicio en 15 días)
+
+¡Planifica tareas pesadas según los tiempos de reinicio!
+```
+
+### 2. Usa el Coding Plan (GLM)
+
+```
+Standard: 1× cuota
+Coding Plan: 3× cuota (¡mismo precio!)
+
+→ Siempre elige Coding Plan
+```
+
+### 3. Combina con el nivel gratis
+
+```
+Combo:
+1. gc/gemini-3-flash (GRATIS principal)
+2. glm/glm-4.7 (respaldo barato)
+3. minimax/MiniMax-M2.1 (más barato)
+4. if/kimi-k2-thinking (emergencia GRATIS)
+
+Resultado: Minimiza costos, maximiza uptime
+```
+
+### 4. Establece alertas de presupuesto
+
+```
+Dashboard → Settings → Budget Alerts
+
+Diario: $2 límite
+Semanal: $10 límite
+Mensual: $30 límite
+
+→ Cambio automático al nivel gratis cuando se alcanza el límite
+```
+
+---
+
+## Solución de problemas
+
+### "Cuota agotada"
+
+**Solución:**
+- GLM: Espera hasta las 10:00 AM hora Beijing
+- MiniMax: Espera 5 horas desde el primer uso
+- Kimi: Espera hasta el 1ro del próximo mes
+- Usa fallback de combo al nivel gratis
+
+### "API key inválida"
+
+**Solución:**
+- Verifica que la API key esté copiada correctamente
+- Verifica que la cuenta tenga créditos
+- Regenera la API key si es necesario
+
+### "Costos altos"
+
+**Solución:**
+- Revisa las estadísticas de uso en el dashboard
+- Establece alertas de presupuesto
+- Cambia a MiniMax ($0.2/1M, la más barata)
+- Usa el nivel gratis para tareas no críticas
+
+---
+
+## Próximos pasos
+
+- **Agregar fallback gratis:** [Proveedores gratis](./free.md)
+- **Configurar suscripciones:** [Proveedores de suscripción](./subscription.md)
+- **Crear combos:** Dashboard → Combos → Create New
diff --git a/gitbook/content/es/providers/free.md b/gitbook/content/es/providers/free.md
new file mode 100644
index 0000000..937f8a2
--- /dev/null
+++ b/gitbook/content/es/providers/free.md
@@ -0,0 +1,442 @@
+# Proveedores gratis - Fallback de cero costo
+
+Respaldo de emergencia cuando todo lo demás está limitado por cuota. ¡Codifica 24/7 con cero costo!
+
+---
+
+## Resumen
+
+Los proveedores del nivel gratis son tu **fallback** cuando se agota la cuota de suscripción y la del nivel barato:
+
+- 🆓 **iFlow** - 8 modelos GRATIS (Kimi K2, Qwen3, GLM 4.7, MiniMax M2...)
+- 🆓 **Qwen** - 3 modelos GRATIS (Qwen3 Coder Plus/Flash, Vision)
+- 🆓 **Kiro** - 2 modelos GRATIS (Claude Sonnet 4.5, Haiku 4.5)
+
+**Estrategia:** Úsalos como respaldo de emergencia. ¡Uso ilimitado, cero costo para siempre!
+
+---
+
+## iFlow (8 modelos GRATIS)
+
+### Precios
+
+| Plan | Costo mensual | Modelos | Cuota |
+|------|--------------|--------|-------|
+| FREE | $0 | 8 modelos | Ilimitado |
+
+**Mejor valor:** ¡La mayoría de modelos en el nivel gratis! Kimi K2, Qwen3, GLM, MiniMax, DeepSeek.
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect iFlow
+```
+
+**Paso 2: Login OAuth de iFlow**
+
+- Clic en "Connect iFlow"
+- El navegador abre → página de login de iFlow
+- Crea cuenta o inicia sesión
+- Otorga permisos
+- Auto-refresh de token habilitado
+
+**Paso 3: Usar en CLI**
+
+```
+Model: if/kimi-k2-thinking
+ if/kimi-k2
+ if/qwen3-coder-plus
+ if/glm-4.7
+ if/minimax-m2
+ if/deepseek-r1
+ if/deepseek-v3.2-chat
+ if/deepseek-v3.2-reasoner
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `if/kimi-k2-thinking` | Kimi K2 Thinking | Razonamiento complejo |
+| `if/kimi-k2` | Kimi K2 | Codificación general |
+| `if/qwen3-coder-plus` | Qwen3 Coder Plus | Generación de código |
+| `if/glm-4.7` | GLM 4.7 | Chino + inglés |
+| `if/minimax-m2` | MiniMax M2 | Contexto largo |
+| `if/deepseek-r1` | DeepSeek R1 | Tareas de razonamiento |
+| `if/deepseek-v3.2-chat` | DeepSeek V3.2 Chat | Conversacional |
+| `if/deepseek-v3.2-reasoner` | DeepSeek V3.2 Reasoner | Lógica compleja |
+
+### Pro Tips
+
+- **8 modelos GRATIS** - La mayor variedad en el nivel gratis
+- **Uso ilimitado** - Sin límites de cuota
+- **Kimi K2 Thinking** - Ideal para razonamiento complejo
+- **DeepSeek R1** - Fuertes capacidades de razonamiento
+
+---
+
+## Qwen (3 modelos GRATIS)
+
+### Precios
+
+| Plan | Costo mensual | Modelos | Cuota |
+|------|--------------|--------|-------|
+| FREE | $0 | 3 modelos | Ilimitado |
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Qwen
+```
+
+**Paso 2: Autorización por código de dispositivo**
+
+- Clic en "Connect Qwen"
+- El dashboard muestra el código de dispositivo
+- Visita la URL de autorización
+- Ingresa el código de dispositivo
+- Inicia sesión en la cuenta de Qwen
+- Auto-refresh de token habilitado
+
+**Paso 3: Usar en CLI**
+
+```
+Model: qw/qwen3-coder-plus
+ qw/qwen3-coder-flash
+ qw/vision-model
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `qw/qwen3-coder-plus` | Qwen3 Coder Plus | Codificación avanzada |
+| `qw/qwen3-coder-flash` | Qwen3 Coder Flash | Respuestas rápidas |
+| `qw/vision-model` | Qwen3 Vision | Análisis de imágenes |
+
+### Pro Tips
+
+- **Qwen3 Coder Plus** - Fuertes capacidades de codificación
+- **Qwen3 Coder Flash** - Rápido para tareas rápidas
+- **Modelo de visión** - Análisis de imágenes GRATIS
+- **Uso ilimitado** - Sin límites de cuota
+
+---
+
+## Kiro (Claude GRATIS)
+
+### Precios
+
+| Plan | Costo mensual | Modelos | Cuota |
+|------|--------------|--------|-------|
+| FREE | $0 | Claude Sonnet 4.5, Haiku 4.5 | Ilimitado |
+
+**Mejor valor:** ¡Claude GRATIS! Misma calidad que Claude Code de pago.
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Kiro
+```
+
+**Paso 2: AWS Builder ID u OAuth**
+
+- Clic en "Connect Kiro"
+- Elige método de login:
+ - AWS Builder ID (recomendado)
+ - Cuenta Google
+ - Cuenta GitHub
+- Otorga permisos
+- Auto-refresh de token habilitado
+
+**Paso 3: Usar en CLI**
+
+```
+Model: kr/claude-sonnet-4.5
+ kr/claude-haiku-4.5
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `kr/claude-sonnet-4.5` | Claude Sonnet 4.5 | Calidad/velocidad equilibrada |
+| `kr/claude-haiku-4.5` | Claude Haiku 4.5 | Respuestas rápidas |
+
+### Pro Tips
+
+- **Claude GRATIS** - Misma calidad que el nivel de pago
+- **AWS Builder ID** - Configuración fácil con cuenta AWS
+- **Uso ilimitado** - Sin límites de cuota
+- **Mejor calidad** - ¡Claude 4.5 gratis!
+
+---
+
+## Comparación de características
+
+| Proveedor | Modelos | Mejor modelo | Configuración | Cuota |
+|----------|--------|------------|-------|-------|
+| **iFlow** | 8 | Kimi K2 Thinking | OAuth | Ilimitado |
+| **Qwen** | 3 | Qwen3 Coder Plus | Device Code | Ilimitado |
+| **Kiro** | 2 | Claude Sonnet 4.5 | AWS Builder ID | Ilimitado |
+
+**Ganador:** ¡iFlow por variedad, Kiro por calidad!
+
+---
+
+## Ejemplo de uso
+
+### Configuración en Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [desde el dashboard de 9router]
+ Model: if/kimi-k2-thinking
+```
+
+### Crear combo (Recomendado)
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking (iFlow principal)
+ 2. qw/qwen3-coder-plus (Qwen respaldo)
+ 3. kr/claude-sonnet-4.5 (Kiro calidad)
+
+Usar en CLI: free-combo
+```
+
+**Resultado:** ¡Cero costo, máximo uptime!
+
+---
+
+## Estrategia de fallback completa
+
+### Combo completo de 3 niveles
+
+```
+Dashboard → Combos → Create New
+
+Name: complete-fallback
+Models:
+ 1. gc/gemini-3-flash-preview (Suscripción GRATIS)
+ 2. cc/claude-opus-4-5 (Suscripción de pago)
+ 3. glm/glm-4.7 (Respaldo barato, $0.6/1M)
+ 4. minimax/MiniMax-M2.1 (Más barato, $0.2/1M)
+ 5. if/kimi-k2-thinking (Fallback GRATIS)
+ 6. kr/claude-sonnet-4.5 (Calidad GRATIS)
+
+Usar en CLI: complete-fallback
+```
+
+**Resultado:**
+- Nivel 1: Suscripción GRATIS (Gemini CLI)
+- Nivel 2: Suscripción de pago (Claude Code)
+- Nivel 3: Respaldo barato (GLM, MiniMax)
+- Nivel 4: Fallback GRATIS (iFlow, Kiro)
+
+**¡Nunca dejes de codificar!**
+
+---
+
+## Mejores prácticas
+
+### 1. Úsalos como respaldo de emergencia
+
+```
+Prioridad:
+1. Nivel de suscripción (maximiza cuota de pago)
+2. Nivel barato (centavos por 1M tokens)
+3. Nivel GRATIS (ilimitado, cero costo)
+
+Usa el nivel gratis solo cuando:
+- Cuota de suscripción agotada
+- Límite de presupuesto alcanzado
+- Pruebas/tareas no críticas
+```
+
+### 2. Elige el modelo correcto
+
+```
+Razonamiento complejo: if/kimi-k2-thinking
+Codificación rápida: qw/qwen3-coder-flash
+Mejor calidad: kr/claude-sonnet-4.5
+Contexto largo: if/minimax-m2
+Tareas de visión: qw/vision-model
+```
+
+### 3. Crea un combo solo-gratis
+
+```
+Para codificación de cero costo:
+
+Name: zero-cost
+Models:
+ 1. kr/claude-sonnet-4.5 (Mejor calidad)
+ 2. if/kimi-k2-thinking (Tareas complejas)
+ 3. qw/qwen3-coder-plus (Codificación rápida)
+
+¡Costo: $0 para siempre!
+```
+
+### 4. Prueba antes de producción
+
+```
+Usa el nivel gratis para:
+- Probar prompts
+- Prototipar características
+- Aprender nuevos frameworks
+- Tareas no críticas
+
+Guarda la cuota de pago para:
+- Código de producción
+- Refactoring complejo
+- Características críticas
+```
+
+---
+
+## Ejemplos reales
+
+### Ejemplo 1: Estudiante/Aprendiz (Cero presupuesto)
+
+```
+Configuración:
+1. kr/claude-sonnet-4.5 (Mejor calidad)
+2. if/kimi-k2-thinking (Razonamiento complejo)
+3. qw/qwen3-coder-plus (Codificación rápida)
+
+Costo mensual: $0
+Uso: Ilimitado
+
+Perfecto para:
+- Aprender a programar
+- Proyectos personales
+- Tareas/asignaciones
+```
+
+### Ejemplo 2: Freelancer (Consciente del presupuesto)
+
+```
+Configuración:
+1. gc/gemini-3-flash-preview (GRATIS 180K/mes)
+2. glm/glm-4.7 (Respaldo barato, $0.6/1M)
+3. if/kimi-k2-thinking (Fallback GRATIS)
+
+Costo mensual: $5-10
+Uso: 100M+ tokens
+
+Perfecto para:
+- Proyectos de cliente (nivel de pago)
+- Pruebas (nivel gratis)
+- Respaldo de emergencia
+```
+
+### Ejemplo 3: Usuario intensivo (Maximiza todo)
+
+```
+Configuración:
+1. gc/gemini-3-flash-preview (GRATIS 180K/mes)
+2. cc/claude-opus-4-5 (Suscripción $20-100)
+3. cx/gpt-5.2-codex (Suscripción $20-200)
+4. glm/glm-4.7 (Barato $0.6/1M)
+5. minimax/MiniMax-M2.1 (Más barato $0.2/1M)
+6. if/kimi-k2-thinking (GRATIS ilimitado)
+7. kr/claude-sonnet-4.5 (Calidad GRATIS)
+
+Costo mensual: $40-320 (suscripciones) + $10-20 (nivel barato)
+Uso: 500M+ tokens
+
+Perfecto para:
+- Desarrollo profesional
+- Proyectos de equipo
+- Codificación 24/7
+```
+
+---
+
+## Comparación de costos
+
+### Escenario: 100M tokens/mes
+
+**Opción 1: Solo ChatGPT API**
+```
+100M × $20/1M = $2,000/mes
+```
+
+**Opción 2: Solo nivel gratis de 9Router**
+```
+100M vía nivel gratis = $0/mes
+Ahorros: $2,000/mes (100%)
+```
+
+**Opción 3: Estrategia completa de 9Router**
+```
+60M vía Gemini CLI (GRATIS): $0
+30M vía Claude Code (suscripción): $0 extra
+8M vía GLM (barato): $4.80
+2M vía iFlow (GRATIS): $0
+Total: $4.80/mes + suscripciones que ya tienes
+Ahorros: $1,995/mes (99.76%)
+```
+
+---
+
+## Solución de problemas
+
+### "OAuth failed"
+
+**Solución:**
+- Verifica la conexión a internet
+- Prueba otro navegador
+- Limpia la caché del navegador
+- Reconecta en el dashboard
+
+### "Modelo no disponible"
+
+**Solución:**
+- Verifica que el proveedor esté conectado en el dashboard
+- Verifica que el token OAuth sea válido
+- Reconecta el proveedor si es necesario
+
+### "Respuestas lentas"
+
+**Solución:**
+- El nivel gratis puede tener menor prioridad
+- Úsalo durante horas off-peak
+- Cambia a otro proveedor gratis
+- Mejora al nivel barato para velocidad
+
+---
+
+## Limitaciones
+
+### Consideraciones del nivel gratis
+
+- **Velocidad** - Puede ser más lento que los niveles de pago
+- **Prioridad** - Menor prioridad en horas pico
+- **Rate limits** - Posible rate-limiting (pero cuota ilimitada)
+- **Disponibilidad** - Puede tener tiempo de inactividad ocasional
+
+**Solución:** ¡Usa la estrategia de fallback de 3 niveles para confiabilidad!
+
+---
+
+## Próximos pasos
+
+- **Configurar suscripciones:** [Proveedores de suscripción](./subscription.md)
+- **Agregar respaldo barato:** [Proveedores baratos](./cheap.md)
+- **Crear combos:** Dashboard → Combos → Create New
+- **Empezar a codificar:** Usa el combo `complete-fallback` para máxima confiabilidad
diff --git a/gitbook/content/es/providers/subscription.md b/gitbook/content/es/providers/subscription.md
new file mode 100644
index 0000000..9e83a25
--- /dev/null
+++ b/gitbook/content/es/providers/subscription.md
@@ -0,0 +1,404 @@
+# Proveedores de suscripción - Maximiza tu valor
+
+Maximiza tus suscripciones de IA existentes con seguimiento inteligente de cuota y fallback automático. ¡Usa cada bit de tu suscripción antes de que se reinicie!
+
+---
+
+## Resumen
+
+Los proveedores del nivel de suscripción son tu opción **principal** - ya estás pagando por ellos, así que obtén el valor completo:
+
+- ✅ **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- ✅ **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex, GPT 5.1 Codex Max
+- ✅ **Gemini CLI** (¡Nivel GRATIS!) - 180K completados/mes
+- ✅ **GitHub Copilot** - GPT-5, Claude 4.5, Gemini 3
+- ✅ **Antigravity** (Google) - Gemini 3 Pro, Claude Sonnet 4.5
+
+**Estrategia:** Úsalos primero, rastrea la cuota en tiempo real, fallback al barato/gratis cuando se agote.
+
+---
+
+## Claude Code (Pro/Max)
+
+### Precios
+
+| Plan | Costo mensual | Reinicio de cuota | Modelos |
+|------|--------------|-------------|--------|
+| Pro | $20 | 5 horas + semanal | Opus, Sonnet, Haiku |
+| Max | $100 | 5 horas + semanal | Opus, Sonnet, Haiku |
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Se abre el dashboard → Providers → Connect Claude Code
+```
+
+**Paso 2: Login OAuth**
+
+- Clic en "Connect Claude Code"
+- El navegador abre → Inicia sesión en Claude.ai
+- Auto-refresh de token habilitado
+- Comienza el seguimiento de cuota
+
+**Paso 3: Usar en CLI**
+
+```
+Model: cc/claude-opus-4-5-20251101
+ cc/claude-sonnet-4-5-20250929
+ cc/claude-haiku-4-5-20251001
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `cc/claude-opus-4-5-20251101` | Claude 4.5 Opus | Tareas complejas, arquitectura |
+| `cc/claude-sonnet-4-5-20250929` | Claude 4.5 Sonnet | Velocidad/calidad equilibrada |
+| `cc/claude-haiku-4-5-20251001` | Claude 4.5 Haiku | Respuestas rápidas |
+
+### Pro Tips
+
+- **Usa Opus para tareas complejas** - Decisiones de arquitectura, refactoring
+- **Usa Sonnet por velocidad** - Ediciones rápidas, generación de código
+- **Rastrea cuota por modelo** - El dashboard muestra uso por modelo
+- **Reinicio de 5 horas** - Cuota fresca cada 5 horas + reinicio semanal
+
+---
+
+## OpenAI Codex (Plus/Pro)
+
+### Precios
+
+| Plan | Costo mensual | Reinicio de cuota | Modelos |
+|------|--------------|-------------|--------|
+| Plus | $20 | 5 horas + semanal | GPT 5.2, GPT 5.1 |
+| Pro | $200 | 5 horas + semanal | GPT 5.2 Codex, GPT 5.1 Max |
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Codex
+```
+
+**Paso 2: Login OAuth**
+
+- Clic en "Connect Codex"
+- El navegador abre `http://localhost:1455`
+- Inicia sesión en la cuenta de OpenAI
+- Auto-refresh de token habilitado
+
+**Paso 3: Usar en CLI**
+
+```
+Model: cx/gpt-5.2-codex
+ cx/gpt-5.1-codex-max
+ cx/gpt-5.2
+ cx/gpt-5.1-codex
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `cx/gpt-5.2-codex` | GPT 5.2 Codex | Último modelo de codificación |
+| `cx/gpt-5.1-codex-max` | GPT 5.1 Codex Max | Contexto máximo |
+| `cx/gpt-5.2` | GPT 5.2 | Tareas generales |
+| `cx/gpt-5.1-codex` | GPT 5.1 Codex | Codificación estable |
+
+### Pro Tips
+
+- **Cuota rolling de 5 horas** - Cuota fresca cada 5 horas
+- **Reinicio semanal** - Reinicio completo de cuota cada semana
+- **Nivel Pro** - 10× más cuota que Plus
+
+---
+
+## Gemini CLI (¡GRATIS 180K/mes!)
+
+### Precios
+
+| Plan | Costo mensual | Cuota | Reinicio |
+|------|--------------|-------|-------|
+| FREE | $0 | 180K completados/mes + 1K/día | Diario + Mensual |
+
+**Mejor valor:** ¡Nivel gratis enorme! Úsalo antes de los niveles de pago.
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Gemini CLI
+```
+
+**Paso 2: OAuth de Google**
+
+- Clic en "Connect Gemini CLI"
+- El navegador abre → Inicia sesión en cuenta Google
+- Otorga permisos
+- Auto-refresh de token habilitado
+
+**Paso 3: Usar en CLI**
+
+```
+Model: gc/gemini-3-flash-preview
+ gc/gemini-3-pro-preview
+ gc/gemini-2.5-pro
+ gc/gemini-2.5-flash
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `gc/gemini-3-flash-preview` | Gemini 3 Flash Preview | Respuestas rápidas |
+| `gc/gemini-3-pro-preview` | Gemini 3 Pro Preview | Tareas complejas |
+| `gc/gemini-2.5-pro` | Gemini 2.5 Pro | Producción estable |
+| `gc/gemini-2.5-flash` | Gemini 2.5 Flash | Tareas rápidas |
+
+### Pro Tips
+
+- **180K completados/mes** - Nivel gratis masivo
+- **Límite de 1K/día** - La cuota diaria se reinicia a medianoche
+- **Úsalo primero** - Nivel gratis, úsalo antes de las suscripciones de pago
+- **Sin tarjeta de crédito** - Completamente gratis con cuenta Google
+
+---
+
+## GitHub Copilot
+
+### Precios
+
+| Plan | Costo mensual | Reinicio de cuota | Modelos |
+|------|--------------|-------------|--------|
+| Individual | $10 | Mensual (día 1) | GPT-5, Claude 4.5, Gemini 3 |
+| Business | $19 | Mensual (día 1) | GPT-5, Claude 4.5, Gemini 3 |
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect GitHub
+```
+
+**Paso 2: OAuth vía GitHub**
+
+- Clic en "Connect GitHub"
+- El navegador abre → Inicia sesión en GitHub
+- Autoriza GitHub Copilot
+- Auto-refresh de token habilitado
+
+**Paso 3: Usar en CLI**
+
+```
+Model: gh/gpt-5
+ gh/gpt-5.1-codex-max
+ gh/claude-4.5-sonnet
+ gh/gemini-3-pro
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `gh/gpt-5` | GPT-5 | Último modelo de OpenAI |
+| `gh/gpt-5.1-codex-max` | GPT-5.1 Codex Max | Contexto máximo |
+| `gh/claude-4.5-sonnet` | Claude 4.5 Sonnet | Calidad de Anthropic |
+| `gh/gemini-3-pro` | Gemini 3 Pro | Calidad de Google |
+
+### Pro Tips
+
+- **Reinicio mensual** - Reinicio completo de cuota el 1ro del mes
+- **Múltiples modelos** - Accede a GPT, Claude, Gemini en una suscripción
+- **Nivel Business** - Mayor cuota para equipos
+
+---
+
+## Antigravity (Cuenta Google)
+
+### Precios
+
+| Plan | Costo mensual | Cuota | Modelos |
+|------|--------------|-------|--------|
+| FREE | $0 | Similar a Gemini CLI | Gemini 3 Pro, Claude Sonnet 4.5 |
+
+### Configuración
+
+**Paso 1: Conectar vía Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Antigravity
+```
+
+**Paso 2: OAuth de Google**
+
+- Clic en "Connect Antigravity"
+- El navegador abre → Inicia sesión en cuenta Google
+- Otorga permisos
+- Auto-refresh de token habilitado
+
+**Paso 3: Usar en CLI**
+
+```
+Model: ag/gemini-3-pro-high
+ ag/claude-sonnet-4-5
+ ag/claude-opus-4-5-thinking
+```
+
+### Modelos disponibles
+
+| ID del modelo | Descripción | Ideal para |
+|----------|-------------|----------|
+| `ag/gemini-3-pro-high` | Gemini 3 Pro High | Respuestas de alta calidad |
+| `ag/claude-sonnet-4-5` | Claude Sonnet 4.5 | Calidad de Anthropic |
+| `ag/claude-opus-4-5-thinking` | Claude Opus 4.5 Thinking | Razonamiento complejo |
+
+### Pro Tips
+
+- **Nivel gratis** - Sin costo con cuenta Google
+- **Acceso a Claude** - Claude Sonnet/Opus gratis
+- **Cuota similar a Gemini CLI** - Límites diarios/mensuales
+
+---
+
+## Comparación de precios
+
+| Proveedor | Costo mensual | Reinicio de cuota | Valor |
+|----------|--------------|-------------|-------|
+| **Claude Code Pro** | $20 | 5 horas + semanal | ⭐⭐⭐⭐⭐ Mejor calidad |
+| **Claude Code Max** | $100 | 5 horas + semanal | ⭐⭐⭐⭐⭐ Mayor cuota |
+| **Codex Plus** | $20 | 5 horas + semanal | ⭐⭐⭐⭐ Buen valor |
+| **Codex Pro** | $200 | 5 horas + semanal | ⭐⭐⭐⭐⭐ 10× cuota |
+| **Gemini CLI** | **$0** | Diario + Mensual | ⭐⭐⭐⭐⭐ ¡GRATIS 180K/mes! |
+| **GitHub Copilot** | $10-19 | Mensual (día 1) | ⭐⭐⭐⭐ Multi-modelo |
+| **Antigravity** | **$0** | Diario + Mensual | ⭐⭐⭐⭐ ¡Claude GRATIS! |
+
+---
+
+## Ejemplo de uso
+
+### Configuración en Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [desde el dashboard de 9router]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Crear combo (Recomendado)
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. gc/gemini-3-flash-preview (GRATIS, usar primero)
+ 2. cc/claude-opus-4-5-20251101 (Suscripción)
+ 3. cx/gpt-5.2-codex (Respaldo de suscripción)
+
+Usar en CLI: premium-coding
+```
+
+**Resultado:** Maximiza el nivel gratis → Usa suscripción → Fallback automático
+
+---
+
+## Seguimiento de cuota
+
+9Router rastrea la cuota en tiempo real:
+
+- **Consumo de tokens** - Tokens de entrada/salida por solicitud
+- **Cuenta regresiva de reinicio** - Tiempo hasta el próximo reinicio de cuota
+- **Porcentaje de uso** - Cuánta cuota se ha usado
+- **Fallback automático** - Cambia al siguiente nivel cuando se agota
+
+**Vista del dashboard:**
+
+```
+Claude Code Pro
+├─ Cuota: 75% usada
+├─ Reinicio: 2h 15m (5 horas)
+├─ Reinicio semanal: 3 días
+└─ Fallback: glm/glm-4.7 (nivel barato)
+```
+
+---
+
+## Mejores prácticas
+
+### 1. Usa el nivel gratis primero
+
+```
+Prioridad:
+1. Gemini CLI (180K/mes GRATIS)
+2. Antigravity (Claude GRATIS)
+3. Claude Code/Codex (suscripciones de pago)
+```
+
+### 2. Rastrea la cuota diariamente
+
+- Revisa el dashboard cada mañana
+- Planifica tareas pesadas según reinicios de cuota
+- Usa el nivel barato/gratis para tareas no críticas
+
+### 3. Crea combos inteligentes
+
+```
+Ejemplo de combo:
+1. gc/gemini-3-flash-preview (GRATIS principal)
+2. cc/claude-opus-4-5 (Tareas complejas)
+3. glm/glm-4.7 (Respaldo barato)
+4. if/kimi-k2-thinking (Fallback GRATIS)
+```
+
+### 4. Optimiza por tiempo
+
+```
+Mañana: Cuota fresca de 5 horas (Claude/Codex)
+Tarde: Gemini CLI (1K/día)
+Noche: Cuota de suscripción
+Madrugada: Nivel barato/gratis
+```
+
+---
+
+## Solución de problemas
+
+### "Cuota agotada"
+
+**Solución:**
+- Verifica el rastreador de cuota del dashboard
+- Espera el reinicio (5 horas o diario)
+- Usa fallback de combo al nivel barato/gratis
+
+### "Token OAuth expirado"
+
+**Solución:**
+- Auto-refresh por 9Router
+- Si hay problemas: Dashboard → Provider → Reconnect
+
+### "Rate limiting"
+
+**Solución:**
+- Cuota de suscripción agotada
+- Agrega fallback: `cc/claude-opus → glm/glm-4.7`
+- Usa el nivel gratis: `if/kimi-k2-thinking`
+
+---
+
+## Próximos pasos
+
+- **Configurar respaldo barato:** [Proveedores baratos](./cheap.md)
+- **Agregar fallback gratis:** [Proveedores gratis](./free.md)
+- **Crear combos:** Dashboard → Combos → Create New
diff --git a/gitbook/content/es/troubleshooting.md b/gitbook/content/es/troubleshooting.md
new file mode 100644
index 0000000..77d0359
--- /dev/null
+++ b/gitbook/content/es/troubleshooting.md
@@ -0,0 +1,351 @@
+# Solución de problemas
+
+Problemas comunes y soluciones al usar 9Router.
+
+---
+
+## "Language model did not provide messages"
+
+**Problema:** La solicitud falla con una respuesta vacía o un mensaje de error.
+
+**Causas:**
+- Cuota del proveedor agotada
+- API key inválida o expirada
+- Modelo no disponible
+
+**Soluciones:**
+
+1. **Verifica el estado de la cuota:**
+ ```
+ Dashboard → Providers → Ver el rastreador de cuota
+ ```
+ Si la cuota está agotada, espera el reinicio o cambia de proveedor.
+
+2. **Usa el fallback con combo:**
+ ```
+ Dashboard → Combos → Crea cadena de fallback
+ Ejemplo: cc/claude-opus → glm/glm-4.7 → if/kimi-k2
+ ```
+
+3. **Verifica la conexión del proveedor:**
+ ```
+ Dashboard → Providers → Reconecta si es necesario
+ ```
+
+---
+
+## Rate Limiting
+
+**Problema:** Errores "Rate limit exceeded" o "Too many requests".
+
+**Causas:**
+- Cuota de suscripción agotada (límites de 5 horas/diario/semanal)
+- Límites de tasa de API alcanzados
+- Demasiadas solicitudes concurrentes
+
+**Soluciones:**
+
+1. **Verifica el tiempo de reinicio:**
+ ```
+ Dashboard → Quota Tracking → Ver cuenta regresiva
+ ```
+
+2. **Cambia al nivel barato:**
+ ```
+ Usa: glm/glm-4.7 ($0.6/1M tokens)
+ minimax/MiniMax-M2.1 ($0.20/1M tokens)
+ ```
+
+3. **Agrega un combo de fallback:**
+ ```
+ Dashboard → Combos → Agrega modelos de respaldo
+ Principal: cc/claude-opus (suscripción)
+ Respaldo: glm/glm-4.7 (barato)
+ Emergencia: if/kimi-k2 (gratis)
+ ```
+
+---
+
+## Token OAuth expirado
+
+**Problema:** Errores "Unauthorized" o "Token expired".
+
+**Causas:**
+- Token OAuth expirado (refresh automático falló)
+- Sesión del proveedor invalidada
+- Problemas de red durante el refresh
+
+**Soluciones:**
+
+1. **Refresh automático (por defecto):**
+ 9Router refresca automáticamente los tokens. Espera 30 segundos y reintenta.
+
+2. **Reconexión manual:**
+ ```
+ Dashboard → Providers → [Nombre del proveedor] → Reconnect
+ → Completa el flujo OAuth de nuevo
+ ```
+
+3. **Verifica el estado del proveedor:**
+ Verifica que el servicio del proveedor esté en línea (Claude Code, Codex, etc.)
+
+---
+
+## Costos altos
+
+**Problema:** Uso o costos altos inesperados.
+
+**Causas:**
+- Uso de modelos costosos innecesariamente
+- Sin fallback a niveles más baratos
+- Ventanas de contexto grandes
+
+**Soluciones:**
+
+1. **Verifica las estadísticas de uso:**
+ ```
+ Dashboard → Usage Stats → Ver consumo de tokens
+ → Identifica modelos de alto costo
+ ```
+
+2. **Cambia a modelos más baratos:**
+ ```
+ Reemplaza: cc/claude-opus (suscripción $20-100/mes)
+ Con: glm/glm-4.7 ($0.6/1M tokens)
+ minimax/MiniMax-M2.1 ($0.20/1M tokens)
+ ```
+
+3. **Usa el nivel gratis:**
+ ```
+ if/kimi-k2-thinking (GRATIS)
+ qw/qwen3-coder-plus (GRATIS)
+ kr/claude-sonnet-4.5 (GRATIS)
+ gc/gemini-3-flash-preview (GRATIS 180K/mes)
+ ```
+
+4. **Optimiza los prompts:**
+ - Reduce el tamaño del contexto
+ - Usa streaming para respuestas largas
+ - Cachea prompts comunes
+
+---
+
+## Connection Refused
+
+**Problema:** "ECONNREFUSED" o "Cannot connect to localhost:20128".
+
+**Causas:**
+- 9Router no está ejecutándose
+- Puerto 20128 bloqueado
+- Firewall bloqueando la conexión
+
+**Soluciones:**
+
+1. **Inicia 9Router:**
+ ```bash
+ 9router
+ ```
+ El dashboard debe abrir en http://localhost:3000
+
+2. **Verifica el puerto 20128:**
+ ```bash
+ # Verifica si el puerto está escuchando
+ lsof -i :20128
+
+ # O en Windows
+ netstat -ano | findstr :20128
+ ```
+
+3. **Revisa el firewall:**
+ - macOS: System Settings → Network → Firewall
+ - Windows: Windows Defender Firewall → Allow app
+ - Linux: `sudo ufw allow 20128`
+
+4. **Usa el endpoint en la nube:**
+ Si localhost no funciona (ej. Cursor IDE):
+ ```
+ Endpoint: https://9router.com/v1
+ ```
+
+---
+
+## El dashboard no abre
+
+**Problema:** El dashboard no carga en http://localhost:3000.
+
+**Causas:**
+- Puerto 3000 ya en uso
+- 9Router crasheó
+- Problemas de caché del navegador
+
+**Soluciones:**
+
+1. **Verifica si 9Router está ejecutándose:**
+ ```bash
+ # Verifica el proceso
+ ps aux | grep 9router
+
+ # Verifica el puerto 3000
+ lsof -i :3000
+ ```
+
+2. **Mata el proceso en conflicto:**
+ ```bash
+ # macOS/Linux
+ lsof -ti:3000 | xargs kill -9
+
+ # Windows
+ netstat -ano | findstr :3000
+ taskkill /PID /F
+ ```
+
+3. **Reinicia 9Router:**
+ ```bash
+ # Detener
+ pkill -f 9router
+
+ # Iniciar
+ 9router
+ ```
+
+4. **Limpia la caché del navegador:**
+ - Chrome: Ctrl+Shift+Delete → Limpiar caché
+ - Prueba en modo incógnito
+
+5. **Verifica la configuración del firewall:**
+ Asegúrate de que el puerto 3000 no esté bloqueado.
+
+---
+
+## Modelo no encontrado
+
+**Problema:** Errores "Model not found" o "Invalid model".
+
+**Causas:**
+- Proveedor no conectado
+- Error tipográfico en el ID del modelo
+- Proveedor inactivo
+
+**Soluciones:**
+
+1. **Verifica la conexión del proveedor:**
+ ```
+ Dashboard → Providers → Verifica estado (verde = activo)
+ ```
+
+2. **Revisa el formato del ID del modelo:**
+ ```
+ Correcto: cc/claude-opus-4-5-20251101
+ Incorrecto: claude-opus-4-5-20251101
+
+ Formato: [prefijo-proveedor]/[nombre-modelo]
+ ```
+
+3. **Lista los modelos disponibles:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+ ```
+
+4. **Reconecta el proveedor:**
+ ```
+ Dashboard → Providers → [Proveedor] → Reconnect
+ ```
+
+---
+
+## Respuesta lenta
+
+**Problema:** Las solicitudes tardan demasiado o hacen timeout.
+
+**Causas:**
+- Latencia del proveedor
+- Problemas de red
+- Contexto/respuesta grande
+- Rate limiting del proveedor
+
+**Soluciones:**
+
+1. **Verifica el estado del proveedor:**
+ ```
+ Dashboard → Providers → Ver estadísticas de latencia
+ ```
+
+2. **Cambia a un modelo más rápido:**
+ ```
+ Rápidos: cc/claude-haiku-4-5 (Haiku es más rápido que Opus)
+ gc/gemini-3-flash-preview
+ qw/qwen3-coder-flash
+ ```
+
+3. **Usa streaming:**
+ ```json
+ {
+ "model": "cc/claude-opus-4-5",
+ "messages": [...],
+ "stream": true
+ }
+ ```
+
+4. **Verifica la red:**
+ ```bash
+ # Prueba la latencia
+ ping api.anthropic.com
+ ping api.openai.com
+ ```
+
+5. **Reduce el tamaño del contexto:**
+ - Recorta el historial de mensajes
+ - Usa prompts más pequeños
+ - Habilita el pruning de contexto en la herramienta CLI
+
+---
+
+## API Key inválida
+
+**Problema:** Errores "Invalid API key" o "Authentication failed".
+
+**Causas:**
+- API key incorrecta copiada
+- API key expirada
+- API key no generada
+
+**Soluciones:**
+
+1. **Regenera la API key:**
+ ```
+ Dashboard → Settings → API Keys → Generate New Key
+ → Copia y usa la nueva key
+ ```
+
+2. **Verifica el formato de la key:**
+ ```
+ Correcto: 9r_xxxxxxxxxxxxxxxxxxxxxxxx
+ Incorrecto: Falta el prefijo 9r_
+ ```
+
+3. **Verifica la key en la configuración del CLI:**
+ ```bash
+ # Cursor
+ Settings → Models → OpenAI API Key
+
+ # Cline
+ Settings → API Key
+
+ # Variable de entorno
+ export OPENAI_API_KEY="9r_your_key"
+ ```
+
+4. **Prueba la API key:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer 9r_your_key"
+ ```
+
+---
+
+## ¿Necesitas más ayuda?
+
+- **GitHub Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **Documentación:** [9router.com/docs](https://9router.com/docs)
+- **FAQ:** [faq.md](faq.md)
diff --git a/gitbook/content/ja/deployment/cloud.md b/gitbook/content/ja/deployment/cloud.md
new file mode 100644
index 0000000..e15a293
--- /dev/null
+++ b/gitbook/content/ja/deployment/cloud.md
@@ -0,0 +1,473 @@
+# ☁️ クラウドデプロイメント
+
+リモートアクセスと本番利用のため、VPSまたはDockerに9Routerをデプロイ。
+
+---
+
+## 🖥️ VPSデプロイメント
+
+### 前提条件
+
+- Ubuntu 20.04+ または同様のLinuxディストリビューション
+- Node.js 20以上
+- Git
+- rootまたはsudoアクセス
+
+### ステップ1: リポジトリをクローン
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+```
+
+### ステップ2: 依存関係をインストール
+
+```bash
+npm install
+```
+
+### ステップ3: アプリケーションをビルド
+
+```bash
+npm run build
+```
+
+### ステップ4: 環境変数を設定
+
+`.env` ファイルを作成するか、変数をエクスポート:
+
+```bash
+export JWT_SECRET="your-secure-secret-change-this-to-random-string"
+export INITIAL_PASSWORD="your-secure-password"
+export DATA_DIR="/var/lib/9router"
+export NODE_ENV="production"
+```
+
+**環境変数:**
+
+| 変数 | デフォルト | 説明 |
+|----------|---------|-------------|
+| `JWT_SECRET` | 自動生成 | **本番環境では必ず変更!** JWTトークンの署名に使用 |
+| `INITIAL_PASSWORD` | `123456` | ダッシュボードログインパスワード |
+| `DATA_DIR` | `~/.9router` | データベースとデータの保存パス |
+| `NODE_ENV` | `development` | デプロイ時は `production` に設定 |
+| `ENABLE_REQUEST_LOGS` | `false` | デバッグリクエスト/レスポンスログを有効化 |
+
+### ステップ5: データディレクトリを作成
+
+```bash
+sudo mkdir -p /var/lib/9router
+sudo chown $USER:$USER /var/lib/9router
+```
+
+### ステップ6: アプリケーションを起動
+
+```bash
+npm run start
+```
+
+### ステップ7: 本番環境用にPM2をセットアップ
+
+PM2はアプリケーションを稼働させ続け、クラッシュ時に再起動します:
+
+```bash
+# PM2をグローバルにインストール
+npm install -g pm2
+
+# PM2で9Routerを起動
+pm2 start npm --name 9router -- start
+
+# PM2設定を保存
+pm2 save
+
+# システム起動時にPM2を開始するようセットアップ
+pm2 startup
+# 上記コマンドが出力する指示に従ってください
+```
+
+**PM2管理コマンド:**
+
+```bash
+# ログを表示
+pm2 logs 9router
+
+# アプリケーションを再起動
+pm2 restart 9router
+
+# アプリケーションを停止
+pm2 stop 9router
+
+# ステータスを表示
+pm2 status
+
+# リソースをモニタリング
+pm2 monit
+```
+
+---
+
+## 🐳 Dockerデプロイメント
+
+### オプション1: Dockerfileを使用
+
+`app` ディレクトリに `Dockerfile` を作成:
+
+```dockerfile
+FROM node:20-alpine
+
+WORKDIR /app
+
+# Copy package files
+COPY package*.json ./
+
+# Install dependencies
+RUN npm ci --only=production
+
+# Copy application files
+COPY . .
+
+# Build application
+RUN npm run build
+
+# Expose ports
+EXPOSE 3000 20128
+
+# Set environment variables
+ENV NODE_ENV=production
+ENV DATA_DIR=/app/data
+
+# Create data directory
+RUN mkdir -p /app/data
+
+# Start application
+CMD ["npm", "run", "start"]
+```
+
+**ビルドと実行:**
+
+```bash
+# イメージをビルド
+docker build -t 9router .
+
+# コンテナを実行
+docker run -d \
+ --name 9router \
+ -p 3000:3000 \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret-change-this" \
+ -e INITIAL_PASSWORD="your-secure-password" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### オプション2: Docker Compose
+
+`docker-compose.yml` を作成:
+
+```yaml
+version: '3.8'
+
+services:
+ 9router:
+ build: .
+ container_name: 9router
+ ports:
+ - "3000:3000"
+ - "20128:20128"
+ environment:
+ - NODE_ENV=production
+ - JWT_SECRET=your-secure-secret-change-this
+ - INITIAL_PASSWORD=your-secure-password
+ - DATA_DIR=/app/data
+ volumes:
+ - 9router-data:/app/data
+ restart: unless-stopped
+
+volumes:
+ 9router-data:
+```
+
+**Docker Composeで実行:**
+
+```bash
+# サービスを起動
+docker-compose up -d
+
+# ログを表示
+docker-compose logs -f
+
+# サービスを停止
+docker-compose down
+
+# 再ビルドして再起動
+docker-compose up -d --build
+```
+
+---
+
+## 🌐 Nginxリバースプロキシ
+
+### Nginxを使う理由
+
+- SSL/TLS終端
+- ドメイン名マッピング
+- ロードバランシング
+- セキュリティ強化
+
+### ステップ1: Nginxをインストール
+
+```bash
+sudo apt update
+sudo apt install nginx
+```
+
+### ステップ2: Nginxを設定
+
+`/etc/nginx/sites-available/9router` を作成:
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ # Redirect HTTP to HTTPS
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl http2;
+ server_name your-domain.com;
+
+ # SSL certificates (use certbot to generate)
+ ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
+
+ # SSL configuration
+ ssl_protocols TLSv1.2 TLSv1.3;
+ ssl_ciphers HIGH:!aNULL:!MD5;
+ ssl_prefer_server_ciphers on;
+
+ # Proxy to 9Router
+ location / {
+ proxy_pass http://localhost:3000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+
+ # API endpoint
+ location /v1 {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+### ステップ3: サイトを有効化
+
+```bash
+# シンボリックリンクを作成
+sudo ln -s /etc/nginx/sites-available/9router /etc/nginx/sites-enabled/
+
+# 設定をテスト
+sudo nginx -t
+
+# Nginxをリロード
+sudo systemctl reload nginx
+```
+
+### ステップ4: Let's EncryptでSSLをセットアップ
+
+```bash
+# certbotをインストール
+sudo apt install certbot python3-certbot-nginx
+
+# SSL証明書を取得
+sudo certbot --nginx -d your-domain.com
+
+# 自動更新は自動的に設定されます
+# 更新をテスト
+sudo certbot renew --dry-run
+```
+
+---
+
+## 🔒 セキュリティ考慮事項
+
+### 1. デフォルト認証情報を変更
+
+**重要:** デプロイ前に `JWT_SECRET` と `INITIAL_PASSWORD` を変更:
+
+```bash
+# 安全なJWTシークレットを生成
+openssl rand -base64 32
+
+# この値をJWT_SECRETに使用
+export JWT_SECRET="generated-secret-here"
+```
+
+### 2. ファイアウォール設定
+
+```bash
+# SSHを許可
+sudo ufw allow 22/tcp
+
+# HTTP/HTTPSを許可 (Nginx使用時)
+sudo ufw allow 80/tcp
+sudo ufw allow 443/tcp
+
+# リバースプロキシを使用しない場合、9Routerポートを許可
+sudo ufw allow 3000/tcp
+sudo ufw allow 20128/tcp
+
+# ファイアウォールを有効化
+sudo ufw enable
+```
+
+### 3. ダッシュボードアクセスを制限
+
+APIアクセスのみ必要な場合、ダッシュボードポートを制限:
+
+```bash
+# ダッシュボードへのlocalhostアクセスのみ許可
+sudo ufw deny 3000/tcp
+```
+
+SSHトンネル経由でダッシュボードにアクセス:
+
+```bash
+ssh -L 3000:localhost:3000 user@your-server.com
+# ブラウザで http://localhost:3000 を開く
+```
+
+### 4. 定期的な更新
+
+```bash
+# システムパッケージを更新
+sudo apt update && sudo apt upgrade -y
+
+# 9Routerを更新
+cd /path/to/9router/app
+git pull
+npm install
+npm run build
+pm2 restart 9router
+```
+
+### 5. バックアップ戦略
+
+```bash
+# データディレクトリをバックアップ
+tar -czf 9router-backup-$(date +%Y%m%d).tar.gz /var/lib/9router
+
+# 自動毎日バックアップ (crontabに追加)
+0 2 * * * tar -czf /backups/9router-$(date +\%Y\%m\%d).tar.gz /var/lib/9router
+```
+
+---
+
+## 📊 モニタリング
+
+### アプリケーションステータスを確認
+
+```bash
+# PM2ステータス
+pm2 status
+
+# ログを表示
+pm2 logs 9router --lines 100
+
+# リソースをモニタリング
+pm2 monit
+```
+
+### Nginxログ
+
+```bash
+# アクセスログ
+sudo tail -f /var/log/nginx/access.log
+
+# エラーログ
+sudo tail -f /var/log/nginx/error.log
+```
+
+### システムリソース
+
+```bash
+# CPUとメモリ使用量
+htop
+
+# ディスク使用量
+df -h
+
+# ネットワーク接続
+netstat -tulpn | grep -E '3000|20128'
+```
+
+---
+
+## 🚨 トラブルシューティング
+
+### アプリケーションが起動しない
+
+```bash
+# ログを確認
+pm2 logs 9router
+
+# ポートが使用中か確認
+sudo lsof -i :3000
+sudo lsof -i :20128
+
+# 環境変数を確認
+pm2 env 9router
+```
+
+### Nginx 502 Bad Gateway
+
+```bash
+# 9Routerが実行中か確認
+pm2 status
+
+# Nginxエラーログを確認
+sudo tail -f /var/log/nginx/error.log
+
+# Nginx設定をテスト
+sudo nginx -t
+```
+
+### SSEストリーミングが動作しない
+
+SSEサポート用にNginx設定で `proxy_buffering off` が設定されていることを確認。
+
+### Permission Deniedエラー
+
+```bash
+# データディレクトリ権限を修正
+sudo chown -R $USER:$USER /var/lib/9router
+chmod 755 /var/lib/9router
+```
+
+---
+
+## 🔗 次のステップ
+
+- [プロバイダーを接続](/providers/subscription.md)
+- [コンボをセットアップ](/features/combos.md)
+- [ツールと統合](/integration/cursor.md)
diff --git a/gitbook/content/ja/deployment/localhost.md b/gitbook/content/ja/deployment/localhost.md
new file mode 100644
index 0000000..c7f1bb2
--- /dev/null
+++ b/gitbook/content/ja/deployment/localhost.md
@@ -0,0 +1,164 @@
+# 🏠 ローカルホストデプロイメント
+
+開発と個人利用のため、ローカルマシンで9Routerを実行。
+
+---
+
+## 📦 インストール
+
+npm経由で9Routerをグローバルインストール:
+
+```bash
+npm install -g 9router
+```
+
+**要件:**
+- Node.js 20以上
+- npm 9以上
+
+---
+
+## 🚀 サーバーの起動
+
+一つのコマンドで9Routerを起動:
+
+```bash
+9router
+```
+
+ダッシュボードが自動的にブラウザで `http://localhost:3000` に開きます。
+
+**デフォルト設定:**
+- **ダッシュボード**: `http://localhost:3000`
+- **APIエンドポイント**: `http://localhost:20128/v1`
+- **データディレクトリ**: `~/.9router`
+
+---
+
+## 🔧 設定
+
+### カスタムデータディレクトリ
+
+環境変数を使ってカスタムデータディレクトリを設定:
+
+```bash
+DATA_DIR=/path/to/data 9router
+```
+
+### カスタムポート
+
+APIポート(20128)とダッシュボードポート(3000)はアプリケーションで設定されています。変更するにはソースコードを修正するか、サポートされている場合は環境変数を使用してください。
+
+---
+
+## 🛑 サーバーの停止
+
+9Routerが実行されているターミナルで `Ctrl+C` を押します。
+
+```bash
+# 9routerを実行しているターミナル
+^C # Ctrl+Cを押す
+```
+
+サーバーはグレースフルにシャットダウンし、すべてのデータを保存します。
+
+---
+
+## 🔄 サーバーの再起動
+
+起動コマンドを再度実行するだけです:
+
+```bash
+9router
+```
+
+すべての設定、APIキー、コンボはデータディレクトリに保持されます。
+
+---
+
+## 📊 9Routerの更新
+
+最新バージョンに更新:
+
+```bash
+npm update -g 9router
+```
+
+現在のバージョンを確認:
+
+```bash
+npm list -g 9router
+```
+
+---
+
+## 🔍 トラブルシューティング
+
+### ポートがすでに使用されている
+
+ポート20128または3000がすでに使用されている場合:
+
+```bash
+# ポートを使用しているプロセスを検索 (macOS/Linux)
+lsof -i :20128
+lsof -i :3000
+
+# プロセスを終了
+kill -9
+```
+
+### 権限エラー
+
+インストール中に権限エラーが発生した場合:
+
+```bash
+# sudoを使用 (非推奨)
+sudo npm install -g 9router
+
+# またはnpm権限を修正 (推奨)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+```
+
+### データディレクトリの問題
+
+データディレクトリにアクセスできない場合:
+
+```bash
+# 権限を確認
+ls -la ~/.9router
+
+# 権限を修正
+chmod 755 ~/.9router
+```
+
+---
+
+## 📁 データディレクトリ構造
+
+```
+~/.9router/
+├── db.json # メインデータベース (プロバイダー、コンボ、設定)
+├── logs/ # アプリケーションログ
+└── cache/ # 一時キャッシュファイル
+```
+
+**データのバックアップ:**
+
+```bash
+# バックアップ
+cp -r ~/.9router ~/.9router.backup
+
+# 復元
+cp -r ~/.9router.backup ~/.9router
+```
+
+---
+
+## 🔗 次のステップ
+
+- [プロバイダーを接続](/providers/subscription.md)
+- [コンボを作成](/features/combos.md)
+- [CLIツールとの統合](/integration/cursor.md)
diff --git a/gitbook/content/ja/faq.md b/gitbook/content/ja/faq.md
new file mode 100644
index 0000000..3eee083
--- /dev/null
+++ b/gitbook/content/ja/faq.md
@@ -0,0 +1,387 @@
+# よくある質問
+
+9Routerに関する一般的な質問。
+
+---
+
+## 9Routerとは?
+
+**9Routerは、サブスクリプションの価値を最大化し、コストを最小限に抑えるAIモデルルーターです。**
+
+3階層フォールバックシステムを使用して、複数のAIプロバイダー間でリクエストをインテリジェントにルーティングします:
+1. **サブスクリプション階層** - すでに支払っているClaude Code、Codex、Geminiのクォータを最大化
+2. **低価格階層** - 超低価格な代替手段(100万トークンあたり$0.20〜$0.60)
+3. **無料階層** - 無制限の無料モデルによる緊急バックアップ
+
+**主な利点:**
+- サブスクリプションのクォータを無駄にしない
+- クォータ消費時の自動フォールバック
+- リアルタイムクォータトラッキング
+- 直接API利用に対して90%のコスト削減
+
+---
+
+## 料金体系はどうなっていますか?
+
+**9Routerは3階層の料金戦略を使用します:**
+
+### Tier 1: サブスクリプション(最初に最大化)
+- **Claude Code** (Pro/Max): 月$20〜100 - 5時間 + 週次クォータ
+- **OpenAI Codex** (Plus/Pro): 月$20〜200 - 5時間 + 週次クォータ
+- **Gemini CLI**: 無料 - 月18万コンプリーション + 1K/日
+- **GitHub Copilot**: 月$10〜19 - 月次リセット
+- **Antigravity**: 無料 - Geminiと同様
+
+**目標:** リセット前にクォータを余すことなく使用!
+
+### Tier 2: 低価格(バックアップ)
+- **GLM-4.7**: 100万トークンあたり$0.60/$2.20 - 毎日午前10時リセット
+- **MiniMax M2.1**: 100万トークンあたり$0.20/$1.00 - 5時間ローリング
+- **Kimi K2**: 月$9固定(1000万トークン)
+
+**目標:** ChatGPT API(100万あたり$20)より90%安い!
+
+### Tier 3: 無料(緊急時)
+- **iFlow**: 8モデル無料(Kimi K2、Qwen3、GLM、MiniMax...)
+- **Qwen**: 3モデル無料(Qwen3 Coder Plus/Flash、Vision)
+- **Kiro**: 2モデル無料(Claude Sonnet 4.5、Haiku 4.5)
+
+**目標:** 他のすべてがクォータ制限に達した時のゼロコストフォールバック!
+
+---
+
+## 9Routerは無料ですか?
+
+**はい、9Router自体は100%無料でオープンソースです。**
+
+**利用可能な無料階層プロバイダー:**
+- **Gemini CLI** - 月18万コンプリーション(無料Googleアカウント)
+- **iFlow** - 8モデル無制限(無料OAuth)
+- **Qwen** - 3モデル無制限(無料OAuth)
+- **Kiro** - Claude Sonnet/Haiku(無料AWS Builder ID)
+
+**無料階層プロバイダーのみを使用して永久に無料でコーディングできます!**
+
+**オプションの有料プロバイダー:**
+- すでに持っている可能性のあるサブスクリプションサービス(Claude Code、Codex、Copilot)
+- 超低価格な代替手段(100万トークンあたり$0.20〜$0.60)
+
+---
+
+## どのプロバイダーがサポートされていますか?
+
+### サブスクリプションプロバイダー
+- **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex、GPT 5.1 Codex Max
+- **Gemini CLI** (無料) - Gemini 3 Flash/Pro、2.5 Pro/Flash
+- **GitHub Copilot** - GPT-5、Claude 4.5、Gemini 3
+- **Antigravity** (Google) - Gemini 3 Pro、Claude Sonnet 4.5
+
+### 低価格プロバイダー
+- **GLM** (Zhipu AI) - GLM 4.7、GLM 4.6V Vision
+- **MiniMax** - MiniMax M2.1
+- **Kimi** (Moonshot AI) - Kimi Latest
+- **OpenRouter** - 任意のOpenRouterモデルへのパススルー
+
+### 無料プロバイダー
+- **iFlow** - 8モデル(Kimi K2、Qwen3、GLM、MiniMax、DeepSeek...)
+- **Qwen** - 3モデル(Qwen3 Coder Plus/Flash、Vision)
+- **Kiro** - 2モデル(Claude Sonnet 4.5、Haiku 4.5)
+
+**合計: 15以上のプロバイダー、50以上のモデル**
+
+詳細は[プロバイダードキュメント](providers/subscription.md)を参照。
+
+---
+
+## 複数のプロバイダーを使用できますか?
+
+**はい! これは9Routerのコア機能です。**
+
+**コンボにより、複数のプロバイダーを自動フォールバック付きで連鎖させることができます:**
+
+```
+コンボ例: "premium-coding"
+1. cc/claude-opus-4-5 (サブスクリプション優先)
+2. glm/glm-4.7 (低価格バックアップ)
+3. if/kimi-k2 (無料緊急時)
+
+→ クォータ消費時に自動切替
+→ コーディングが止まらない
+→ 最小の追加コスト
+```
+
+**コンボの作成方法:**
+```
+Dashboard → Combos → Create New
+→ 優先順位順にモデルを追加
+→ CLIでコンボ名を使用: "premium-coding"
+```
+
+**利点:**
+- クォータ切れ時のダウンタイムゼロ
+- 自動コスト最適化
+- すべてのツール用の単一モデル名
+
+例については[コンボドキュメント](features/combos.md)を参照。
+
+---
+
+## クォータトラッキングはどのように機能しますか?
+
+**9Routerはすべてのプロバイダーのクォータをリアルタイムで追跡します:**
+
+**機能:**
+- **トークン消費** - リクエストごとの入出力トークン
+- **リセットカウントダウン** - クォータが更新されるまでの時間
+- **使用統計** - 日次/週次/月次レポート
+- **コスト見積もり** - 予測支出(有料階層)
+- **クォータアラート** - クォータが少ない時の通知
+
+**クォータタイプ:**
+- **5時間ローリング** - Claude Code、Codex、MiniMax
+- **日次リセット** - Gemini CLI(1K/日)、GLM(午前10時)
+- **週次リセット** - Claude Code、Codex(追加クォータ)
+- **月次リセット** - Gemini CLI(18万)、GitHub Copilot(1日)
+
+**クォータを表示:**
+```
+Dashboard → Providers → Quota Tracking
+→ リアルタイム使用量 + リセットカウントダウン
+```
+
+詳細は[クォータトラッキングドキュメント](features/quota-tracking.md)を参照。
+
+---
+
+## 9RouterはCursorで動作しますか?
+
+**はい、ただしCursorはクラウドエンドポイントが必要です。**
+
+**問題:** Cursor IDEはlocalhostエンドポイントをサポートしていません。
+
+**解決策:** 9Routerクラウドデプロイメントを使用:
+
+```
+Cursor Settings → Models → Advanced:
+ OpenAI API Base URL: https://9router.com/v1
+ OpenAI API Key: [ダッシュボードから取得]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+**代替案:** パブリックドメインでVPSにセルフホスト:
+```bash
+# VPSへデプロイ
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+npm start
+
+# Nginxリバースプロキシを設定
+# Cursorを向ける: https://your-domain.com/v1
+```
+
+**他のCLIツールはlocalhostで動作:**
+- Cline ✅
+- Claude Desktop ✅
+- Codex CLI ✅
+- Continue ✅
+- RooCode ✅
+
+詳細は[Cursor統合ガイド](integration/cursor.md)を参照。
+
+---
+
+## 9Routerをセルフホストできますか?
+
+**はい! 9Routerは複数のデプロイメントオプションをサポートします:**
+
+### Localhost(デフォルト)
+```bash
+npm install -g 9router
+9router
+→ Dashboard: http://localhost:3000
+→ API: http://localhost:20128/v1
+```
+
+### VPS/クラウド
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+npm start
+```
+
+### Docker
+```bash
+docker build -t 9router .
+docker run -d \
+ -p 3000:3000 \
+ -e JWT_SECRET="your-secret" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Cloudflare Workers
+```bash
+cd 9router/app
+npm run deploy:cloudflare
+```
+
+**環境変数:**
+- `JWT_SECRET` - **本番環境で必ず変更!**
+- `DATA_DIR` - データベース保存パス(デフォルト: `~/.9router`)
+- `INITIAL_PASSWORD` - ダッシュボードログイン(デフォルト: `123456`)
+- `NODE_ENV` - デプロイ時は`production`に設定
+
+詳細は[デプロイメントガイド](getting-started/installation.md#deployment)を参照。
+
+---
+
+## データは安全ですか?
+
+**はい、9Routerはセキュリティとプライバシーを優先します:**
+
+**ローカルストレージ:**
+- すべてのデータは`~/.9router`(またはカスタム`DATA_DIR`)にローカル保存
+- 9Routerサーバーへのデータ送信なし
+- OAuthトークンはJWTで暗号化
+
+**テレメトリなし:**
+- 使用状況追跡なし
+- アナリティクスなし
+- フォンホームなし
+
+**オープンソース:**
+- 完全なソースコードがGitHubで利用可能
+- 自分でセキュリティを監査可能
+- コミュニティレビュー済み
+
+**ベストプラクティス:**
+- 本番環境で`JWT_SECRET`を変更
+- 強力な`INITIAL_PASSWORD`を使用
+- クラウドデプロイでHTTPSを有効化
+- APIキーを定期的にローテーション
+
+**9Routerが保存するもの:**
+- プロバイダーOAuthトークン(暗号化)
+- APIキー(暗号化)
+- 使用統計(ローカルのみ)
+- コンボ設定
+
+**9Routerが保存しないもの:**
+- プロンプトやレスポンス
+- 生成したコード
+- 個人情報
+
+---
+
+## 9Routerを更新するには?
+
+**更新方法はインストールタイプによって異なります:**
+
+### グローバルNPMインストール
+```bash
+npm update -g 9router
+```
+
+### ローカルインストール
+```bash
+cd 9router/app
+git pull origin main
+npm install
+npm run build
+npm start
+```
+
+### Docker
+```bash
+docker pull 9router:latest
+docker stop 9router
+docker rm 9router
+docker run -d \
+ -p 3000:3000 \
+ -v 9router-data:/app/data \
+ 9router:latest
+```
+
+**バージョンを確認:**
+```bash
+9router --version
+```
+
+**破壊的変更:**
+- [CHANGELOG.md](https://github.com/decolua/9router/blob/main/CHANGELOG.md)を確認
+- メジャー更新前に`~/.9router`をバックアップ
+- メジャーバージョンの移行ガイドを確認
+
+---
+
+## どのように貢献できますか?
+
+**貢献を歓迎します!**
+
+### 貢献方法:
+
+1. **バグを報告:**
+ - [GitHub Issues](https://github.com/decolua/9router/issues)
+ - エラーログ、再現手順を含める
+
+2. **機能をリクエスト:**
+ - [GitHub Discussions](https://github.com/decolua/9router/discussions)
+ - ユースケースと利点を説明
+
+3. **コードを提出:**
+ ```bash
+ # リポジトリをフォーク
+ git clone https://github.com/YOUR_USERNAME/9router.git
+ cd 9router
+
+ # ブランチを作成
+ git checkout -b feature/your-feature
+
+ # 変更を加える
+ npm install
+ npm run dev
+
+ # テスト
+ npm test
+
+ # コミットしてプッシュ
+ git add .
+ git commit -m "Add your feature"
+ git push origin feature/your-feature
+
+ # GitHubでPull Requestを作成
+ ```
+
+4. **ドキュメントを改善:**
+ - 誤字の修正、例の追加
+ - 他言語への翻訳
+ - チュートリアルの執筆
+
+5. **プロバイダーを追加:**
+ - 新しいプロバイダーアダプターを実装
+ - 例については`app/lib/providers/`を参照
+
+**貢献ガイドライン:**
+- 既存のコードスタイルに従う
+- 新機能にはテストを追加
+- ドキュメントを更新
+- コミットは小さく、わかりやすく
+
+詳細は[CONTRIBUTING.md](https://github.com/decolua/9router/blob/main/CONTRIBUTING.md)を参照。
+
+---
+
+## さらにヘルプが必要?
+
+- **ドキュメント:** [9router.com/docs](https://9router.com/docs)
+- **GitHub:** [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **トラブルシューティング:** [troubleshooting.md](troubleshooting.md)
diff --git a/gitbook/content/ja/features/combos.md b/gitbook/content/ja/features/combos.md
new file mode 100644
index 0000000..e331a10
--- /dev/null
+++ b/gitbook/content/ja/features/combos.md
@@ -0,0 +1,537 @@
+# コンボ - カスタムフォールバックチェーン
+
+自動フォールバック付きのカスタムモデル組み合わせを作成。コンボを使って、コスト、品質、可用性に基づく独自のルーティング戦略を定義できます。
+
+---
+
+## コンボとは?
+
+コンボはダッシュボードで作成する**カスタムフォールバックチェーン**です。単一モデルを使う代わりに、9Routerが順番に試すモデルのシーケンスを定義します。
+
+**例:**
+```
+コンボ名: premium-coding
+モデル:
+ 1. cc/claude-opus-4-5-20251101 (最初に試行)
+ 2. glm/glm-4.7 (#1のクォータ消費時)
+ 3. minimax/MiniMax-M2.1 (#2のクォータ消費時)
+```
+
+**CLIでの使用:**
+```
+Model: premium-coding
+```
+
+9Routerは成功するまで各モデルを順番に自動的に試します。
+
+---
+
+## なぜコンボを使うのか?
+
+### 1. サブスクリプション価値を最大化
+```
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ サブスクリプション優先、低価格バックアップ、無料緊急時
+→ すでに支払っているサブスクリプションから完全な価値を得る
+```
+
+### 2. コストを最小化
+```
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+
+→ 最安の有料オプションから開始 (100万あたり$0.60)
+→ さらに安いものへフォールバック (100万あたり$0.20)
+→ 緊急時の無料階層
+→ 総コスト: 月$5〜10 vs ChatGPT APIの$2000
+```
+
+### 3. 24時間可用性を確保
+```
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ 最後に常に無料階層を含める
+→ クォータ切れにならない
+→ いつでもどこでもコーディング
+```
+
+### 4. 品質に最適化
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → gc/gemini-3-pro
+
+→ 最高のモデルが最初
+→ 他のプレミアムモデルへフォールバック
+→ フォールバックチェーン全体で高品質を維持
+```
+
+---
+
+## コンボの作成方法
+
+### ステップ1: ダッシュボードを開く
+
+```
+http://localhost:20128
+→ パスワードでログイン
+```
+
+### ステップ2: コンボへ移動
+
+```
+Dashboard → Combos → Create New Combo
+```
+
+### ステップ3: コンボを設定
+
+**コンボ名:**
+```
+premium-coding
+```
+
+**説明(任意):**
+```
+サブスクリプション優先、低価格バックアップ、無料緊急時
+```
+
+**モデルを選択:**
+```
+1. cc/claude-opus-4-5-20251101
+2. glm/glm-4.7
+3. minimax/MiniMax-M2.1
+```
+
+**ドラッグで並べ替え** - 上から下へ優先順位。
+
+### ステップ4: 保存
+
+```
+「Save Combo」をクリック
+→ コンボがモデルリストに表示
+```
+
+### ステップ5: CLIで使用
+
+```
+Cursor/Cline/任意のツール:
+ Model: premium-coding
+```
+
+---
+
+## コンボの例
+
+### 例1: プレミアムコーディング (サブスク → 低価格 → 無料)
+
+**目標**: サブスクリプション価値を最大化、追加コストを最小化。
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. glm/glm-4.7
+ 3. minimax/MiniMax-M2.1
+```
+
+**使用法:**
+```
+Cursor IDE:
+ Model: premium-coding
+```
+
+**動作:**
+```
+朝 (新鮮なクォータ):
+ Request → cc/claude-opus-4-5 ✅
+
+午後 (Claudeクォータ切れ):
+ Request → glm/glm-4.7 ✅ (自動切替)
+
+夕方 (GLMクォータ切れ):
+ Request → minimax/MiniMax-M2.1 ✅ (自動切替)
+```
+
+**月コスト (1億トークン):**
+```
+Claude Code経由で8000万: $0 (サブスクリプション)
+GLM経由で1500万: $9
+MiniMax経由で500万: $1
+合計: $10 + サブスクリプション
+```
+
+**節約**: ChatGPT API ($2000) に対して約99%。
+
+---
+
+### 例2: バジェットコンボ (低価格 → 無料)
+
+**目標**: コストを最小化、バックアップに無料階層を使用。
+
+```
+Dashboard → Combos → Create New
+
+Name: budget-combo
+Models:
+ 1. glm/glm-4.7
+ 2. minimax/MiniMax-M2.1
+ 3. if/kimi-k2-thinking
+```
+
+**使用法:**
+```
+Cline:
+ Provider: OpenAI Compatible
+ Base URL: http://localhost:20128/v1
+ Model: budget-combo
+```
+
+**動作:**
+```
+Request → glm/glm-4.7
+ ✅ 日次クォータ利用可 → GLMを使用 (100万あたり$0.60)
+ ❌ クォータ消費 → MiniMaxを試行 (100万あたり$0.20)
+ ❌ MiniMaxクォータ切れ → iFlowを使用 (無料)
+```
+
+**月コスト (1億トークン):**
+```
+GLM経由で7000万: $42
+MiniMax経由で2000万: $4
+iFlow経由で1000万: $0
+合計: $46 vs ChatGPT APIの$2000
+```
+
+**節約**: 97%。
+
+---
+
+### 例3: フリーコンボ (ゼロコスト)
+
+**目標**: 100%無料、コストはゼロ。
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking
+ 2. qw/qwen3-coder-plus
+ 3. kr/claude-sonnet-4.5
+```
+
+**使用法:**
+```
+Claude Desktop:
+ Model: free-combo
+```
+
+**動作:**
+```
+Request → if/kimi-k2-thinking
+ ✅ 利用可 → iFlowを使用
+ ❌ エラー → Qwenを試行
+ ❌ エラー → Kiroを試行
+```
+
+**月コスト:**
+```
+無料プロバイダー経由で1億トークン: $0
+合計: 永久に$0
+```
+
+**ユースケース**: 個人プロジェクト、学習、実験。
+
+---
+
+### 例4: 品質優先 (プレミアムモデルのみ)
+
+**目標**: 最高の品質、低価格フォールバックなし。
+
+```
+Dashboard → Combos → Create New
+
+Name: quality-first
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. cx/gpt-5.2-codex
+ 3. gc/gemini-3-pro-preview
+```
+
+**使用法:**
+```
+Codex CLI:
+ export OPENAI_BASE_URL="http://localhost:20128"
+ Model: quality-first
+```
+
+**動作:**
+```
+Request → cc/claude-opus-4-5
+ ❌ クォータ切れ → cx/gpt-5.2-codex
+ ❌ クォータ切れ → gc/gemini-3-pro-preview
+ ❌ すべて切れ → エラーを返す (低価格フォールバックなし)
+```
+
+**ユースケース**: クリティカルな本番コード、複雑なリファクタリング。
+
+---
+
+### 例5: マルチサブスクリプション (すべてを最大化)
+
+**目標**: 追加料金前にすべてのサブスクリプションを利用。
+
+```
+Dashboard → Combos → Create New
+
+Name: multi-sub
+Models:
+ 1. gc/gemini-3-flash-preview (月18万無料)
+ 2. cc/claude-opus-4-5-20251101 (Proサブスクリプション)
+ 3. cx/gpt-5.2-codex (Plusサブスクリプション)
+ 4. gh/gpt-5 (Copilotサブスクリプション)
+ 5. glm/glm-4.7 (低価格バックアップ)
+ 6. if/kimi-k2-thinking (無料緊急時)
+```
+
+**月コスト (2億トークン):**
+```
+Gemini CLI経由で5000万: $0 (無料プラン)
+Claude Code経由で8000万: $0 (サブスクリプション)
+Codex経由で4000万: $0 (サブスクリプション)
+Copilot経由で2000万: $0 (サブスクリプション)
+GLM経由で800万: $4.80
+iFlow経由で200万: $0
+合計: $4.80 + 既存サブスクリプション
+```
+
+**結果**: サブスクリプションから1.9億トークン使用、わずか$4.80の追加料金。
+
+---
+
+### 例6: クォータリセット最適化
+
+**目標**: リセット時間に基づいて使用量を分散。
+
+```
+Dashboard → Combos → Create New
+
+Name: reset-optimized
+Models:
+ 1. cc/claude-opus-4-5 (5時間リセット、朝に使用)
+ 2. gc/gemini-3-flash (1K/日、午後に使用)
+ 3. glm/glm-4.7 (毎日午前10時リセット、夕方に使用)
+ 4. minimax/MiniMax-M2.1 (5時間ローリング、夜に使用)
+ 5. if/kimi-k2-thinking (無制限、緊急時)
+```
+
+**日課:**
+```
+08:00 - 13:00: Claude Code (新鮮な5時間クォータ)
+13:00 - 18:00: Gemini CLI (1K/日クォータ)
+18:00 - 22:00: GLM (翌朝10時リセット)
+22:00 - 08:00: MiniMax (5時間ローリング) または iFlow
+```
+
+**結果**: 最小コストで24時間コーディング。
+
+---
+
+## CLIツールでコンボを使用
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [ダッシュボードから取得]
+ Model: premium-coding
+```
+
+### Claude Desktop
+
+`~/.claude/config.json`を編集:
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key",
+ "model": "budget-combo"
+}
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex --model quality-first "your prompt"
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [ダッシュボードから取得]
+Model: free-combo
+```
+
+### APIリクエスト
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "premium-coding",
+ "messages": [
+ {"role": "user", "content": "Write a function to..."}
+ ],
+ "stream": true
+ }'
+```
+
+---
+
+## ベストプラクティス
+
+### 1. 常に無料階層を含める
+
+```
+✅ 良い:
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+❌ 悪い:
+cc/claude-opus → glm/glm-4.7
+(無料フォールバックなし、クォータ切れの可能性)
+```
+
+**理由**: 24時間可用性を確保、クォータでブロックされない。
+
+### 2. コスト順に並べる (安価→高価)
+
+```
+✅ 良い:
+glm/glm-4.7 → minimax/MiniMax-M2.1 → cc/claude-opus
+
+❌ 悪い:
+cc/claude-opus → glm/glm-4.7
+(シンプルなタスクにサブスクリプションクォータを浪費)
+```
+
+**例外**: サブスクリプション価値を最大化したい場合は、サブスクリプションを最初に。
+
+### 3. 品質要件に合わせる
+
+```
+本番コードの場合:
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7
+
+クイックタスクの場合:
+glm/glm-4.7 → if/kimi-k2-thinking
+
+実験用:
+if/kimi-k2-thinking → qw/qwen3-coder-plus
+```
+
+### 4. クォータリセット時間を考慮
+
+```
+朝のコンボ (新鮮なクォータ):
+cc/claude-opus → cx/gpt-5.2-codex
+
+夕方のコンボ (クォータが消費されている可能性):
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+### 5. 異なるユースケース用に複数のコンボを作成
+
+```
+premium-coding: 複雑なタスク用
+budget-combo: シンプルなタスク用
+free-combo: 実験用
+quality-first: 本番コード用
+```
+
+**タスク要件に基づいてコンボを切り替え**ます。
+
+### 6. コンボパフォーマンスをモニター
+
+```
+Dashboard → Analytics → Combo Usage:
+ premium-coding:
+ 80% cc/claude-opus経由 (良好、サブスクリプション使用)
+ 15% glm/glm-4.7経由 (許容バックアップ)
+ 5% minimax経由 (まれなフォールバック)
+```
+
+**最適化**: フォールバック使用が多すぎる場合、プライマリクォータを増やすかモデルを並べ替え。
+
+---
+
+## 高度な設定
+
+### コンボごとに予算上限を設定
+
+```
+Dashboard → Combos → Edit → Budget:
+ Daily limit: $5
+ Monthly limit: $50
+```
+
+上限に達すると、9Routerは有料モデルをスキップして無料階層のみを使用。
+
+### コンボ内のモデルを有効/無効
+
+```
+Dashboard → Combos → Edit → Models:
+ ✅ cc/claude-opus-4-5 (有効)
+ ❌ glm/glm-4.7 (一時的に無効)
+ ✅ if/kimi-k2-thinking (有効)
+```
+
+**ユースケース**: コンボを削除せずに高価なモデルを一時的に無効化。
+
+### 既存のコンボを複製
+
+```
+Dashboard → Combos → Clone "premium-coding"
+→ "-copy" サフィックス付きのコピーを作成
+→ 変更して新しいコンボとして保存
+```
+
+**ユースケース**: 異なるシナリオ用のバリエーションを作成。
+
+---
+
+## トラブルシューティング
+
+**問題: コンボがモデルリストに表示されない**
+
+**解決策:**
+1. ダッシュボードを更新
+2. コンボが保存されていることを確認 (緑のチェック)
+3. CLIツールを再起動してモデルリストを更新
+
+**問題: コンボが常に最後のモデル (無料階層) を使用**
+
+**解決策:**
+1. プライマリモデルのクォータを確認 (Dashboard → Quota)
+2. APIキーが有効か確認 (Dashboard → Providers)
+3. 予算上限を超えていないか確認
+
+**問題: コンボのコストが予想より高い**
+
+**解決策:**
+1. Dashboard → Analytics → コンボ使用量を確認
+2. プライマリモデルがクォータ切れか確認
+3. モデルを並べ替え (安価を先に)
+4. 予算上限を設定
+
+---
+
+## 関連
+
+- [スマートルーティング](./smart-routing.md) - 自動フォールバックの仕組み
+- [クォータトラッキング](./quota-tracking.md) - 使用量とコストを監視
diff --git a/gitbook/content/ja/features/quota-tracking.md b/gitbook/content/ja/features/quota-tracking.md
new file mode 100644
index 0000000..719da66
--- /dev/null
+++ b/gitbook/content/ja/features/quota-tracking.md
@@ -0,0 +1,687 @@
+# クォータトラッキングと使用量モニタリング
+
+リアルタイムのトークン消費を追跡し、クォータ制限を監視し、コストを見積もり、不足前にアラートを取得。サブスクリプションクォータを無駄にしたり、予算上限を超えたりすることはありません。
+
+---
+
+## 概要
+
+9Routerはすべてのプロバイダーに対して包括的なクォータトラッキングを提供:
+
+- **リアルタイムトークン消費** - リクエストごとの使用トークンを表示
+- **クォータ上限と残量** - 使用量 vs 上限を追跡
+- **リセットカウントダウン** - クォータが更新されるタイミング
+- **コスト見積もり** - 有料階層の支出を計算
+- **月次レポート** - 使用パターンを分析
+- **アラートと通知** - 上限前に警告を取得
+
+---
+
+## ダッシュボード概要
+
+### クォータサマリー
+
+```
+Dashboard → Home → Quota Overview
+
+┌─────────────────────────────────────────────┐
+│ Claude Code (cc/) │
+│ ████████████░░░░░░░░ 2.5h / 5h (50%) │
+│ Resets in: 2h 30m │
+│ Cost: $0 (subscription) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ Gemini CLI (gc/) │
+│ ████████░░░░░░░░░░░░ 450 / 1000 (45%) │
+│ Daily reset in: 18h 30m │
+│ Monthly: 45K / 180K (25%) │
+│ Cost: $0 (free tier) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ GLM-4.7 (glm/) │
+│ ██████████████░░░░░░ 7M / 10M tokens (70%) │
+│ Resets: Daily 10:00 AM (in 5h 35m) │
+│ Cost today: $4.20 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ MiniMax M2.1 (minimax/) │
+│ ████████████████░░░░ 4M / 5M tokens (80%) │
+│ Rolling 5h window │
+│ Cost (5h): $0.80 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ iFlow (if/) │
+│ ████████████████████ Unlimited │
+│ Cost: $0 (free forever) │
+└─────────────────────────────────────────────┘
+```
+
+---
+
+## リアルタイムトークン消費
+
+### リクエストごとのトラッキング
+
+各リクエストに詳細なトークン使用量が表示されます:
+
+```
+Dashboard → Activity → Recent Requests
+
+Request #1234
+Model: cc/claude-opus-4-5-20251101
+Timestamp: 2026-02-04 04:15:32
+
+Tokens:
+ Input: 1,250 tokens
+ Output: 850 tokens
+ Total: 2,100 tokens
+
+Cost: $0 (subscription quota)
+Duration: 3.2s
+Status: ✅ Success
+```
+
+### ライブ使用量モニター
+
+```
+Dashboard → Live Monitor
+
+Current request:
+ Model: glm/glm-4.7
+ Tokens streamed: 450 / ~800 estimated
+ Cost so far: $0.0009
+ Duration: 1.8s
+```
+
+### モデル別のトークン内訳
+
+```
+Dashboard → Analytics → Token Usage
+
+Today (Feb 4, 2026):
+ cc/claude-opus-4-5: 15M tokens ($0, subscription)
+ glm/glm-4.7: 8M tokens ($4.80)
+ if/kimi-k2-thinking: 3M tokens ($0, free)
+
+Total: 26M tokens
+Cost: $4.80
+```
+
+---
+
+## クォータ上限とリセット時間
+
+### サブスクリプションプロバイダー
+
+**Claude Code (Pro/Max)**
+```
+クォータタイプ: 時間ベース (5時間ローリング)
+上限: 5時間の使用
+リセット: 5時間ローリングウィンドウ + 週次更新
+追跡: モデルごとの使用時間
+
+ダッシュボード表示:
+ Opus: 2.5h / 5h 使用
+ Sonnet: 1.2h / 5h 使用
+ Haiku: 0.8h / 5h 使用
+
+週次リセット: 毎週月曜00:00 UTC
+```
+
+**OpenAI Codex (Plus/Pro)**
+```
+クォータタイプ: 時間ベース (5時間ローリング)
+上限: 5時間 (Plus) / 10時間 (Pro)
+リセット: 5時間ローリングウィンドウ + 週次更新
+
+ダッシュボード表示:
+ GPT-5.2 Codex: 3.5h / 5h 使用
+ Resets in: 1h 30m
+```
+
+**Gemini CLI (無料)**
+```
+クォータタイプ: リクエスト数 + 月次トークン
+日次上限: 1,000 リクエスト
+月次上限: 180,000 コンプリーション
+リセット: 日次 00:00 UTC + 月次 1日
+
+ダッシュボード表示:
+ Today: 450 / 1,000 requests (45%)
+ This month: 45K / 180K completions (25%)
+ Daily reset in: 18h 30m
+ Monthly reset in: 26 days
+```
+
+**GitHub Copilot**
+```
+クォータタイプ: 月次使用量
+上限: プランによる
+リセット: 各月1日
+
+ダッシュボード表示:
+ Usage: 60% of monthly quota
+ Resets: March 1, 2026 (in 25 days)
+```
+
+### 低価格プロバイダー
+
+**GLM-4.7**
+```
+クォータタイプ: 日次トークン上限
+上限: 10Mトークン/日 (Coding Plan)
+リセット: 毎日午前10時 北京時間 (UTC+8)
+
+ダッシュボード表示:
+ Used: 7M / 10M tokens (70%)
+ Remaining: 3M tokens
+ Resets in: 5h 35m
+ Cost today: $4.20
+```
+
+**MiniMax M2.1**
+```
+クォータタイプ: 5時間ローリングウィンドウ
+上限: 5時間あたり5Mトークン
+リセット: 連続ローリングウィンドウ
+
+ダッシュボード表示:
+ Used (5h): 4M / 5M tokens (80%)
+ Oldest usage expires in: 45m
+ Cost (5h): $0.80
+```
+
+**Kimi K2**
+```
+クォータタイプ: 月次サブスクリプション
+上限: 10Mトークン/月 ($9固定)
+リセット: サブスクリプション日に月次
+
+ダッシュボード表示:
+ Used: 6M / 10M tokens (60%)
+ Resets: Feb 15, 2026 (in 11 days)
+ Cost: $9/month (prepaid)
+```
+
+### 無料プロバイダー
+
+**iFlow / Qwen / Kiro**
+```
+クォータタイプ: 無制限 (レート制限)
+上限: ハード制限なし
+リセット: なし
+
+ダッシュボード表示:
+ Used today: 5M tokens
+ Cost: $0 (free forever)
+ Status: ✅ Available
+```
+
+---
+
+## コスト見積もり
+
+### リアルタイムコストトラッキング
+
+```
+Dashboard → Costs → Today
+
+Subscription providers: $0
+ Claude Code: 15M tokens ($0, included)
+ Gemini CLI: 3M tokens ($0, free tier)
+
+Paid providers: $4.80
+ GLM-4.7: 8M tokens ($4.80)
+ Input: 6M × $0.60/1M = $3.60
+ Output: 2M × $2.20/1M = $4.40
+ Total: $4.80
+
+Free providers: $0
+ iFlow: 3M tokens ($0)
+
+Total today: $4.80
+```
+
+### 月次支出レポート
+
+```
+Dashboard → Costs → This Month (February 2026)
+
+Week 1 (Feb 1-7):
+ Subscription: $0 (80M tokens)
+ Paid: $15.20 (25M tokens)
+ Free: $0 (10M tokens)
+ Total: $15.20
+
+Week 2 (Feb 8-14):
+ Subscription: $0 (75M tokens)
+ Paid: $12.80 (20M tokens)
+ Free: $0 (8M tokens)
+ Total: $12.80
+
+Month to date: $28.00
+Projected (30 days): ~$120
+
+Breakdown by provider:
+ GLM-4.7: $22.00 (78%)
+ MiniMax M2.1: $6.00 (22%)
+
+Average cost per 1M tokens: $0.62
+Savings vs ChatGPT API: 97% ($4,000 → $120)
+```
+
+### コスト予測
+
+```
+Dashboard → Costs → Projections
+
+Based on last 7 days usage:
+ Daily average: 50M tokens
+ Daily cost: $4.50
+
+Monthly projection:
+ Tokens: 1,500M (1.5B)
+ Cost: $135
+
+Breakdown:
+ Subscription: 900M tokens ($0)
+ GLM-4.7: 450M tokens ($90)
+ MiniMax: 120M tokens ($24)
+ Free: 30M tokens ($0)
+
+Budget status:
+ Daily limit: $5 → 90% used today
+ Monthly limit: $150 → 90% projected
+ ⚠️ Warning: May exceed monthly budget
+```
+
+---
+
+## 使用量ダッシュボード
+
+### 概要統計
+
+```
+Dashboard → Analytics → Overview
+
+Today (Feb 4, 2026):
+ Requests: 1,234
+ Tokens: 26M
+ Cost: $4.80
+ Avg response time: 2.1s
+
+This week:
+ Requests: 8,456
+ Tokens: 180M
+ Cost: $28.00
+ Success rate: 99.2%
+
+This month:
+ Requests: 15,234
+ Tokens: 320M
+ Cost: $52.00
+ Top model: cc/claude-opus-4-5 (45%)
+```
+
+### モデル別使用量
+
+```
+Dashboard → Analytics → Models
+
+Top models (this month):
+1. cc/claude-opus-4-5: 145M tokens (45%)
+2. glm/glm-4.7: 95M tokens (30%)
+3. if/kimi-k2-thinking: 50M tokens (16%)
+4. minimax/MiniMax-M2.1: 20M tokens (6%)
+5. gc/gemini-3-flash: 10M tokens (3%)
+
+Cost breakdown:
+ cc/claude-opus: $0 (subscription)
+ glm/glm-4.7: $45.00
+ if/kimi-k2-thinking: $0 (free)
+ minimax/MiniMax-M2.1: $7.00
+ gc/gemini-3-flash: $0 (free)
+```
+
+### 時間別使用量
+
+```
+Dashboard → Analytics → Timeline
+
+Hourly usage (today):
+00:00 - 01:00: 0.5M tokens
+01:00 - 02:00: 0.2M tokens
+...
+08:00 - 09:00: 3.2M tokens (peak)
+09:00 - 10:00: 2.8M tokens
+...
+23:00 - 00:00: 0.8M tokens
+
+Peak hours: 08:00 - 12:00 (morning coding)
+Low hours: 00:00 - 06:00 (night)
+```
+
+### コンボ別使用量
+
+```
+Dashboard → Analytics → Combos
+
+premium-coding:
+ Requests: 456
+ Tokens: 12M
+ Cost: $2.40
+
+ Breakdown:
+ cc/claude-opus: 8M tokens (67%, $0)
+ glm/glm-4.7: 3M tokens (25%, $1.80)
+ minimax/MiniMax-M2.1: 1M tokens (8%, $0.20)
+
+budget-combo:
+ Requests: 234
+ Tokens: 6M
+ Cost: $1.20
+
+ Breakdown:
+ glm/glm-4.7: 4M tokens (67%, $2.40)
+ if/kimi-k2-thinking: 2M tokens (33%, $0)
+```
+
+---
+
+## アラートと通知
+
+### クォータアラート
+
+```
+Dashboard → Settings → Alerts
+
+Quota warnings:
+ ✅ Alert at 80% quota used
+ ✅ Alert at 90% quota used
+ ✅ Alert when quota exhausted
+ ✅ Notify when quota resets
+
+Delivery:
+ ✅ Dashboard notification
+ ✅ Email (optional)
+ ✅ Webhook (optional)
+```
+
+**通知例:**
+```
+⚠️ Claude Code quota 80% used
+ 2.5h remaining (resets in 1h 30m)
+
+⚠️ GLM-4.7 quota 90% used
+ 1M tokens remaining (resets in 5h)
+
+✅ Gemini CLI quota reset
+ 1,000 requests available (daily limit)
+```
+
+### 予算アラート
+
+```
+Dashboard → Settings → Budget Alerts
+
+Daily budget: $5
+ ✅ Alert at 80% ($4)
+ ✅ Alert at 100% ($5)
+ ✅ Auto-switch to free tier when exceeded
+
+Monthly budget: $150
+ ✅ Alert at 50% ($75)
+ ✅ Alert at 80% ($120)
+ ✅ Alert at 100% ($150)
+```
+
+**通知例:**
+```
+⚠️ Daily budget 80% used
+ $4.00 / $5.00 spent today
+
+⚠️ Monthly budget 50% reached
+ $75 / $150 spent this month
+ Projected: $135 (within budget)
+
+🚨 Daily budget exceeded
+ $5.20 / $5.00 spent today
+ Auto-switched to free tier
+```
+
+### コスト異常検知
+
+```
+Dashboard → Settings → Anomaly Detection
+
+✅ Detect unusual spending patterns
+✅ Alert on cost spikes (>2× daily average)
+✅ Warn on quota exhaustion patterns
+
+Example alert:
+⚠️ Cost spike detected
+ Today: $12.50 (2.5× daily average)
+ Reason: High GLM-4.7 usage (20M tokens)
+ Suggestion: Check if primary models quota-exhausted
+```
+
+---
+
+## ベストプラクティス
+
+### 1. クォータを毎日モニター
+
+```
+日課:
+1. ダッシュボードクォータ概要を確認 (30秒)
+2. リセット時間を確認
+3. クォータ可用性に合わせて使用量を計画
+```
+
+**例:**
+```
+朝の確認:
+ ✅ Claude Code: 5時間利用可 (新鮮なリセット)
+ ✅ Gemini CLI: 1Kリクエスト利用可
+ ⚠️ GLM-4.7: 2Mトークン残 (午前10時リセット)
+
+アクション: 朝の作業にClaude Codeを使用
+```
+
+### 2. 予算上限を設定
+
+```
+Dashboard → Settings → Budget:
+ Daily: $5 (使いすぎ防止)
+ Monthly: $150 (予算に整合)
+```
+
+**結果**: 上限到達時に自動的に無料階層へ切替。
+
+### 3. コンボ使用を最適化
+
+```
+Dashboard → Analytics → Combos:
+ どのモデルが最もよく使われているか確認
+ コストを最小化するためにコンボ順序を調整
+```
+
+**例:**
+```
+現在: cc/claude-opus → glm/glm-4.7
+ 80% Claude経由 (良好)
+ 20% GLM経由 ($12/月)
+
+最適化後: gc/gemini-3-flash → cc/claude-opus → glm/glm-4.7
+ 50% Gemini経由 (無料)
+ 40% Claude経由 (サブスクリプション)
+ 10% GLM経由 ($6/月)
+
+節約: $6/月
+```
+
+### 4. リセット時間を追跡
+
+```
+Dashboard → Quota → Reset Schedule:
+ Claude Code: 5時間ローリング + 週次月曜
+ Gemini CLI: 日次 00:00 UTC + 月次 1日
+ GLM-4.7: 毎日午前10時 北京時間
+ MiniMax: 5時間ローリングウィンドウ
+```
+
+**戦略**: クォータが新鮮な時にプロバイダーを使用。
+
+### 5. 月次レポートを確認
+
+```
+Dashboard → Analytics → Monthly Report:
+ Total tokens: 1.5B
+ Total cost: $120
+ Savings: 97% vs ChatGPT API
+
+インサイト:
+ - 60% サブスクリプション経由の使用 ($0)
+ - 30% GLM経由 ($90)
+ - 10% 無料階層経由 ($0)
+
+最適化:
+ - Gemini CLI使用を増やす (無料)
+ - GLM使用を減らす (高価)
+```
+
+---
+
+## APIアクセス
+
+### クォータステータスを取得
+
+```bash
+GET http://localhost:20128/api/quota
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "providers": [
+ {
+ "id": "cc",
+ "name": "Claude Code",
+ "quota": {
+ "used": 2.5,
+ "limit": 5,
+ "unit": "hours",
+ "percentage": 50
+ },
+ "reset": {
+ "type": "rolling",
+ "window": "5h",
+ "nextReset": "2026-02-04T06:45:00Z"
+ },
+ "cost": {
+ "today": 0,
+ "month": 0,
+ "currency": "USD"
+ }
+ },
+ {
+ "id": "glm",
+ "name": "GLM-4.7",
+ "quota": {
+ "used": 7000000,
+ "limit": 10000000,
+ "unit": "tokens",
+ "percentage": 70
+ },
+ "reset": {
+ "type": "daily",
+ "time": "10:00 AM UTC+8",
+ "nextReset": "2026-02-04T10:00:00+08:00"
+ },
+ "cost": {
+ "today": 4.20,
+ "month": 52.00,
+ "currency": "USD"
+ }
+ }
+ ]
+}
+```
+
+### 使用統計を取得
+
+```bash
+GET http://localhost:20128/api/usage?period=today
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "period": "today",
+ "date": "2026-02-04",
+ "summary": {
+ "requests": 1234,
+ "tokens": 26000000,
+ "cost": 4.80
+ },
+ "byModel": [
+ {
+ "model": "cc/claude-opus-4-5",
+ "requests": 456,
+ "tokens": 15000000,
+ "cost": 0
+ },
+ {
+ "model": "glm/glm-4.7",
+ "requests": 234,
+ "tokens": 8000000,
+ "cost": 4.80
+ }
+ ]
+}
+```
+
+---
+
+## トラブルシューティング
+
+**問題: クォータが0%を表示するがリクエストが失敗**
+
+**解決策:**
+1. プロバイダー接続を確認 (Dashboard → Providers)
+2. APIキーが有効か確認
+3. プロバイダーがダウンしているか確認 (ステータスページ)
+4. OAuthプロバイダーを再接続してみる
+
+**問題: コスト見積もりが正しくない**
+
+**解決策:**
+1. Dashboard → Settings → Pricing
+2. プロバイダーごとの料金が現在のレートと一致するか確認
+3. プロバイダーがレートを変更した場合は料金を更新
+4. 不一致が続く場合はサポートに連絡
+
+**問題: リセット時間が更新されない**
+
+**解決策:**
+1. ダッシュボードを更新 (F5)
+2. システム時刻が正しいか確認
+3. タイムゾーン設定を確認
+4. 問題が続く場合は9Routerを再起動
+
+**問題: アラートが受信されない**
+
+**解決策:**
+1. Dashboard → Settings → Alerts
+2. メールアドレスが正しいか確認
+3. スパムフォルダを確認
+4. 通知をテスト (Send Testボタン)
+
+---
+
+## 関連
+
+- [スマートルーティング](./smart-routing.md) - クォータに基づく自動フォールバック
+- [コンボ](./combos.md) - カスタムフォールバックチェーンを作成
diff --git a/gitbook/content/ja/features/smart-routing.md b/gitbook/content/ja/features/smart-routing.md
new file mode 100644
index 0000000..d7a3444
--- /dev/null
+++ b/gitbook/content/ja/features/smart-routing.md
@@ -0,0 +1,407 @@
+# スマートルーティングと自動フォールバック
+
+9Routerは3階層フォールバックシステムを使用して、最適な利用可能なプロバイダーへリクエストを自動的にルーティングします。クォータ制限やレート制限でコーディングが止まることはありません。
+
+---
+
+## 動作の仕組み
+
+9Routerは、既存のサブスクリプションを最大化し、コストを最小化し、24時間可用性を確保するため、インテリジェントなルーティングを使用します:
+
+```
+Request → 9Router → Tier 1を確認 (サブスクリプション)
+ ↓ クォータ消費
+ Tier 2を確認 (低価格)
+ ↓ 予算上限
+ Tier 3を確認 (無料)
+ ↓
+ Response
+```
+
+### 3階層フォールバックシステム
+
+**Tier 1: サブスクリプション (プライマリ)**
+- Claude Code (Pro/Max)
+- OpenAI Codex (Plus/Pro)
+- Gemini CLI (月18万無料)
+- GitHub Copilot
+- Antigravity (Google)
+
+**目標**: すでに支払っているサブスクリプションから価値を最大化。
+
+**Tier 2: 低価格 (バックアップ)**
+- GLM-4.7 (入力100万あたり$0.60)
+- MiniMax M2.1 (入力100万あたり$0.20)
+- Kimi K2 (月$9固定)
+
+**目標**: サブスクリプションクォータ切れ時の超低価格バックアップ (ChatGPT APIより約90%安い)。
+
+**Tier 3: 無料 (緊急時)**
+- iFlow (8モデル)
+- Qwen (3モデル)
+- Kiro (Claude無料)
+
+**目標**: 無制限コーディング用のゼロコストフォールバック。
+
+---
+
+## 自動切替
+
+9Routerはクォータをリアルタイムでモニターし、プロバイダーを自動的に切り替えます:
+
+### シナリオ1: サブスクリプションクォータ消費
+
+```
+ユーザーリクエスト → cc/claude-opus-4-5
+ ↓ クォータ消費 (5時間制限到達)
+ 自動切替 → glm/glm-4.7
+ ↓ 日次クォータ消費
+ 自動切替 → minimax/MiniMax-M2.1
+ ↓ 5時間クォータ消費
+ 自動切替 → if/kimi-k2-thinking (無料)
+ ↓
+ レスポンス配信 ✅
+```
+
+**結果**: ダウンタイムゼロ、シームレスな体験。
+
+### シナリオ2: レート制限
+
+```
+ユーザーリクエスト → cx/gpt-5.2-codex
+ ↓ レート制限 (リクエストが多すぎ)
+ 自動切替 → glm/glm-4.7
+ ↓
+ レスポンス配信 ✅
+```
+
+### シナリオ3: プロバイダー利用不可
+
+```
+ユーザーリクエスト → cc/claude-opus-4-5
+ ↓ プロバイダーエラー (503)
+ 自動切替 → 次の利用可能なモデル
+ ↓
+ レスポンス配信 ✅
+```
+
+---
+
+## モデル選択ロジック
+
+9Routerは以下に基づいて最適なモデルを選択します:
+
+1. **クォータ可用性** - プロバイダーに残量があるか確認
+2. **コスト階層** - サブスクリプション → 低価格 → 無料を優先
+3. **リセットタイミング** - クォータリセット時を考慮
+4. **プロバイダー健全性** - エラーのあるプロバイダーをスキップ
+
+### 優先順位の例
+
+`cc/claude-opus-4-5` へのリクエストの場合:
+
+```
+1. Claude Codeクォータを確認
+ ✅ 利用可 → cc/claude-opus-4-5を使用
+ ❌ 消費 → ステップ2へ
+
+2. フォールバック階層を確認 (設定されている場合)
+ ✅ GLMクォータ利用可 → glm/glm-4.7を使用
+ ❌ 消費 → ステップ3へ
+
+3. 無料階層を確認
+ ✅ iFlow利用可 → if/kimi-k2-thinkingを使用
+ ❌ すべて消費 → クォータエラーを返す
+```
+
+---
+
+## 設定オプション
+
+### ダッシュボード設定
+
+**1. 自動フォールバックを有効/無効化**
+
+```
+Dashboard → Settings → Smart Routing
+→ 「Auto Fallback」をオン/オフに切替
+```
+
+- **オン** (デフォルト): 自動階層切替
+- **オフ**: 厳格モード、プライマリモデル利用不可時にエラーを返す
+
+**2. 予算上限を設定**
+
+```
+Dashboard → Settings → Budget Control
+→ 日次上限: $5
+→ 月次上限: $50
+```
+
+予算到達時、9Routerは自動的に無料階層へ切替。
+
+**3. フォールバック順序を設定**
+
+```
+Dashboard → Settings → Fallback Priority
+→ 各階層内でプロバイダーをドラッグして並べ替え
+```
+
+カスタム順序の例:
+```
+Tier 1: Gemini CLI → Claude Code → Codex
+Tier 2: MiniMax → GLM → Kimi
+Tier 3: iFlow → Kiro → Qwen
+```
+
+**4. クォータリセット通知**
+
+```
+Dashboard → Settings → Notifications
+→ クォータリセット時にメール
+→ 80%クォータ使用時にアラート
+```
+
+---
+
+## 例
+
+### 例1: 基本的な自動フォールバック
+
+**セットアップ:**
+```
+Model: cc/claude-opus-4-5-20251101
+Fallback: 自動 (デフォルト3階層)
+```
+
+**動作:**
+```
+朝 (新鮮なクォータ):
+ Request → cc/claude-opus-4-5 ✅
+
+午後 (クォータ消費):
+ Request → glm/glm-4.7 ✅ (自動切替)
+
+夕方 (GLMクォータ切れ):
+ Request → minimax/MiniMax-M2.1 ✅ (自動切替)
+
+深夜 (すべての有料クォータ切れ):
+ Request → if/kimi-k2-thinking ✅ (無料階層)
+```
+
+**コスト**: 月$5〜10の追加料金 (主にサブスクリプションでカバー)。
+
+### 例2: 予算意識のルーティング
+
+**セットアップ:**
+```
+Dashboard → Settings:
+ Daily budget: $2
+ Monthly budget: $20
+ Fallback: 有効
+```
+
+**動作:**
+```
+1〜15日 (予算内):
+ Requests → glm/glm-4.7 (低価格階層)
+ コスト: $1.50/日
+
+16日 (予算到達):
+ Requests → if/kimi-k2-thinking (無料階層)
+ コスト: $0
+
+翌月 (予算リセット):
+ Requests → 再びglm/glm-4.7
+```
+
+**結果**: 月$20を超えない、常に利用可能。
+
+### 例3: サブスクリプションのみモード
+
+**セットアップ:**
+```
+Dashboard → Settings:
+ Auto Fallback: オフ
+ Strict mode: オン
+```
+
+**動作:**
+```
+Request → cc/claude-opus-4-5
+ ✅ クォータ利用可 → 成功
+ ❌ クォータ消費 → エラーを返す (フォールバックなし)
+```
+
+**ユースケース**: 有料サブスクリプションのみを使用したい場合、追加コストなし。
+
+### 例4: 無料のみモード
+
+**セットアップ:**
+```
+Model: if/kimi-k2-thinking
+Fallback: qw/qwen3-coder-plus → kr/claude-sonnet-4.5
+```
+
+**動作:**
+```
+すべてのリクエスト → 無料階層のみ
+コスト: 永久に$0
+```
+
+**ユースケース**: 個人プロジェクト、学習、実験。
+
+---
+
+## ベストプラクティス
+
+### 1. サブスクリプション価値を最大化
+
+```
+戦略:
+- サブスクリプションモデルをTier 1に設定
+- ダッシュボードでクォータ使用量をモニター
+- サブスクリプション消費時のみ低価格階層を使用
+```
+
+**コンボ例:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 2. コストに最適化
+
+```
+戦略:
+- Gemini CLI無料階層を最初に使用 (月18万)
+- GLM/MiniMaxへフォールバック (超低価格)
+- 緊急時: iFlow (無料)
+```
+
+**コンボ例:**
+```
+gc/gemini-3-flash-preview → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 3. 品質に最適化
+
+```
+戦略:
+- 最高のモデルを使用 (Claude Opus、GPT-5.2)
+- 良質な低価格モデルへフォールバック (GLM-4.7)
+- 最後の手段: 無料階層
+```
+
+**コンボ例:**
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → glm/glm-4.7
+```
+
+### 4. 24時間可用性
+
+```
+戦略:
+- フォールバックに常に無料階層を含める
+- クォータリセット時間をモニター
+- プロバイダー間で使用量を分散
+```
+
+**コンボ例:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+**結果**: クォータ切れにならない、いつでもコーディング。
+
+---
+
+## クォータリセット戦略
+
+クォータリセット時間に合わせて使用量を計画:
+
+| プロバイダー | クォータリセット | 戦略 |
+|----------|-------------|----------|
+| **Claude Code** | 5時間 + 週次 | 朝、新鮮なクォータを使用 |
+| **Codex** | 5時間 + 週次 | Claudeクォータ切れ後に使用 |
+| **Gemini CLI** | 日次 (1K) + 月次 (18万) | 一日中使用 |
+| **GLM-4.7** | 毎日午前10時 | 夕方使用、翌朝リセット |
+| **MiniMax M2.1** | 5時間ローリング | いつでも使用、ローリングウィンドウを追跡 |
+| **iFlow/Qwen/Kiro** | 制限なし | 緊急時バックアップ |
+
+**日課の例:**
+```
+08:00 - 13:00: Claude Code (新鮮な5時間クォータ)
+13:00 - 18:00: Gemini CLI (1K/日クォータ)
+18:00 - 22:00: GLM-4.7 (低価格、午前10時リセット)
+22:00 - 08:00: MiniMaxまたはiFlow (5時間ローリングまたは無料)
+```
+
+---
+
+## モニタリングとアラート
+
+### ダッシュボードクォータトラッカー
+
+```
+Dashboard → Quota Overview:
+ Claude Code: 2.5h / 5h 残 (50%)
+ Gemini CLI: 今日 450 / 1000 リクエスト
+ GLM-4.7: 5M / 10M トークン (8時間後リセット)
+ MiniMax: 3M / 5M トークン (5時間ローリング)
+```
+
+### リアルタイム通知
+
+```
+Dashboard → Notifications:
+ ⚠️ Claude Codeクォータ80%使用 (1時間残)
+ ✅ GLM-4.7クォータリセット (10Mトークン利用可)
+ 💰 日次予算50%使用 ($2.50 / $5)
+```
+
+### 使用統計
+
+```
+Dashboard → Analytics:
+ 今日: 5000万トークン
+ - 3000万 Claude Code経由 (サブスクリプション)
+ - 1500万 GLM-4.7経由 ($9)
+ - 500万 iFlow経由 (無料)
+
+ コスト: $9 (vs ChatGPT APIの$1000)
+ 節約: 99%
+```
+
+---
+
+## トラブルシューティング
+
+**問題: "All providers quota exhausted"**
+
+**解決策:**
+1. ダッシュボードクォータトラッカーを確認
+2. クォータリセットを待つ (カウントダウン参照)
+3. フォールバックチェーンに無料階層を追加
+4. または予算上限を増やす
+
+**問題: "Too many fallback switches"**
+
+**解決策:**
+1. プライマリプロバイダーがダウンしているか確認
+2. クォータ上限を増やす (サブスクリプションをアップグレード)
+3. より安いプライマリモデルを使用 (Claudeの代わりにGLM)
+
+**問題: "Unexpected costs"**
+
+**解決策:**
+1. Dashboard → Analytics → 使用量を確認
+2. 日次/月次予算上限を設定
+3. クリティカルでないタスクは無料階層へ切替
+4. 無料フォールバック付きのコンボを使用
+
+---
+
+## 関連
+
+- [コンボ](./combos.md) - カスタムフォールバックチェーンを作成
+- [クォータトラッキング](./quota-tracking.md) - 使用量とコストをモニター
diff --git a/gitbook/content/ja/getting-started/installation.md b/gitbook/content/ja/getting-started/installation.md
new file mode 100644
index 0000000..9da1d96
--- /dev/null
+++ b/gitbook/content/ja/getting-started/installation.md
@@ -0,0 +1,478 @@
+# インストール
+
+トラブルシューティングのヒント付きの9Router詳細インストールガイド。
+
+---
+
+## 要件
+
+### システム要件
+
+- **Node.js**: バージョン 20.0.0以上
+- **npm**: バージョン 10.0.0以上 (Node.jsに付属)
+- **OS**: macOS、Linux、Windows (WSL推奨)
+- **ディスク容量**: インストールに約200MB
+
+### バージョンを確認
+
+```bash
+node --version
+# v20.x.x以上が表示されるはず
+
+npm --version
+# 10.x.x以上が表示されるはず
+```
+
+**Node.jsがない場合?** [nodejs.org](https://nodejs.org/)からインストール
+
+---
+
+## インストール方法
+
+### 方法1: グローバルインストール (推奨)
+
+どこからでも使用できるように9Routerをグローバルインストール:
+
+```bash
+npm install -g 9router
+```
+
+**9Routerを起動:**
+
+```bash
+9router
+```
+
+**利点:**
+- ✅ どのディレクトリからでも実行
+- ✅ シンプルなコマンド: `9router`
+- ✅ `npm update -g 9router` で自動更新
+
+### 方法2: ローカルインストール
+
+特定のプロジェクトにインストール:
+
+```bash
+mkdir my-9router
+cd my-9router
+npm install 9router
+```
+
+**9Routerを起動:**
+
+```bash
+npx 9router
+```
+
+**利点:**
+- ✅ プロジェクトごとに分離
+- ✅ プロジェクトごとのバージョン管理
+- ✅ グローバル名前空間の汚染なし
+
+### 方法3: ソースから (開発)
+
+GitHubからクローンしてビルド:
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install
+npm run build
+npm start
+```
+
+**利点:**
+- ✅ 最新の開発機能
+- ✅ 開発に貢献可能
+- ✅ カスタム変更
+
+---
+
+## 初回実行
+
+### サーバーを起動
+
+```bash
+9router
+```
+
+**何が起こるか:**
+1. サーバーが `http://localhost:20128` で起動
+2. ダッシュボードが自動的にブラウザで開く
+3. `~/.9router` にデータディレクトリが作成される
+4. APIキーが自動生成される
+
+### ダッシュボードログイン
+
+**デフォルト認証情報:**
+- パスワード: `123456`
+
+**⚠️ パスワードをすぐに変更:**
+1. ダッシュボードにログイン
+2. Settings → Change Password
+3. 強力なパスワードを使用
+
+### APIキーを取得
+
+```
+Dashboard → Settings → API Keys
+→ APIキーをコピー
+→ CLIツールで使用
+```
+
+**APIキー形式の例:**
+```
+9r_1234567890abcdef1234567890abcdef
+```
+
+---
+
+## インストールを確認
+
+### サーバーステータスを確認
+
+```bash
+curl http://localhost:20128/health
+```
+
+**期待されるレスポンス:**
+```json
+{
+ "status": "ok",
+ "version": "1.0.0"
+}
+```
+
+### 利用可能なモデルを一覧表示
+
+```bash
+curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+```
+
+**期待されるレスポンス:**
+```json
+{
+ "object": "list",
+ "data": [
+ {
+ "id": "cc/claude-opus-4-5-20251101",
+ "object": "model",
+ "created": 1234567890,
+ "owned_by": "claude-code"
+ }
+ ]
+}
+```
+
+### チャットコンプリーションをテスト
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "cc/claude-opus-4-5-20251101",
+ "messages": [
+ {"role": "user", "content": "Hello!"}
+ ]
+ }'
+```
+
+---
+
+## 設定
+
+### 環境変数
+
+`.env` ファイルを作成するか、環境変数を設定:
+
+```bash
+# セキュリティ (本番環境では必須)
+export JWT_SECRET="your-secure-secret-change-this"
+export INITIAL_PASSWORD="your-password"
+
+# ストレージ
+export DATA_DIR="~/.9router"
+
+# サーバー
+export PORT="20128"
+export NODE_ENV="production"
+
+# ロギング
+export ENABLE_REQUEST_LOGS="false"
+```
+
+### データディレクトリ
+
+**デフォルトの場所:** `~/.9router`
+
+**内容:**
+```
+~/.9router/
+ ├── db.json # データベース (プロバイダー、コンボ、使用量)
+ ├── api-keys.json # APIキー
+ └── logs/ # リクエストログ (有効化されている場合)
+```
+
+**場所を変更:**
+
+```bash
+export DATA_DIR="/custom/path"
+9router
+```
+
+### ポート設定
+
+**デフォルトポート:** `20128`
+
+**ポートを変更:**
+
+```bash
+export PORT="3000"
+9router
+```
+
+**またはコマンドラインで:**
+
+```bash
+9router --port 3000
+```
+
+---
+
+## トラブルシューティング
+
+### ポートがすでに使用されている
+
+**エラー:**
+```
+Error: listen EADDRINUSE: address already in use :::20128
+```
+
+**解決策1: 既存のプロセスを終了**
+
+```bash
+# ポート20128を使用しているプロセスを検索
+lsof -i :20128
+
+# プロセスを終了
+kill -9
+```
+
+**解決策2: 別のポートを使用**
+
+```bash
+9router --port 3000
+```
+
+### Permission Denied
+
+**エラー:**
+```
+Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/9router'
+```
+
+**解決策: sudoを使用 (非推奨) またはnpm権限を修正**
+
+```bash
+# npm権限を修正 (推奨)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+
+# 再度インストール
+npm install -g 9router
+```
+
+### Node.jsバージョンが古すぎる
+
+**エラー:**
+```
+Error: The engine "node" is incompatible with this module
+```
+
+**解決策: Node.jsを更新**
+
+```bash
+# nvmを使用 (推奨)
+nvm install 20
+nvm use 20
+
+# またはnodejs.orgからダウンロード
+```
+
+### ダッシュボードが開かない
+
+**問題:** ダッシュボードが自動的に開かない
+
+**解決策1: 手動で開く**
+
+```
+http://localhost:20128
+```
+
+**解決策2: ファイアウォールを確認**
+
+```bash
+# macOS: システム環境設定 → セキュリティでNode.jsを許可
+# Linux: iptablesを確認
+# Windows: Windowsファイアウォールを確認
+```
+
+### プロバイダーに接続できない
+
+**問題:** OAuthログインが失敗、またはAPIキーが無効
+
+**解決策1: インターネット接続を確認**
+
+```bash
+ping google.com
+```
+
+**解決策2: プロバイダーのステータスを確認**
+
+- Claude Code: [status.anthropic.com](https://status.anthropic.com)
+- OpenAI: [status.openai.com](https://status.openai.com)
+- Gemini: [status.cloud.google.com](https://status.cloud.google.com)
+
+**解決策3: APIキーを再生成**
+
+```
+Dashboard → Provider → Disconnect → Reconnect
+```
+
+### 高メモリ使用量
+
+**問題:** 9RouterがRAMを使いすぎている
+
+**解決策: サーバーを再起動**
+
+```bash
+# 停止
+pkill -f 9router
+
+# 起動
+9router
+```
+
+**または自動再起動にPM2を使用:**
+
+```bash
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+```
+
+---
+
+## デプロイメントオプション
+
+### ローカル開発
+
+```bash
+npm install -g 9router
+9router
+```
+
+**ユースケース:** 個人コーディング、テスト
+
+### VPS/クラウドサーバー
+
+```bash
+# インストール
+npm install -g 9router
+
+# 設定
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+# PM2で起動
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+pm2 startup
+```
+
+**ユースケース:** チームアクセス、リモートコーディング
+
+### Docker
+
+```bash
+docker pull 9router/9router:latest
+
+docker run -d \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret" \
+ -e INITIAL_PASSWORD="your-password" \
+ -v 9router-data:/root/.9router \
+ --name 9router \
+ 9router/9router:latest
+```
+
+**ユースケース:** コンテナデプロイ、Kubernetes
+
+### リバースプロキシ (Nginx)
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ location / {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+
+ # SSE support for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+**ユースケース:** HTTPS、カスタムドメイン、ロードバランシング
+
+---
+
+## アンインストール
+
+### グローバルインストールを削除
+
+```bash
+npm uninstall -g 9router
+```
+
+### データディレクトリを削除
+
+```bash
+rm -rf ~/.9router
+```
+
+### 設定を削除
+
+```bash
+# シェル設定から環境変数を削除
+nano ~/.bashrc # または ~/.zshrc
+# 9router関連のエクスポートを削除
+```
+
+---
+
+## 次のステップ
+
+- [スタートガイド](../getting-started.md) - プロバイダーを接続してコーディング開始
+- [機能](../features/) - クォータトラッキング、コンボ、デプロイを確認
+- [トラブルシューティング](../troubleshooting.md) - 一般的な問題の修正
+
+---
+
+## ヘルプが必要?
+
+- **ウェブサイト**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/ja/getting-started/quick-start.md b/gitbook/content/ja/getting-started/quick-start.md
new file mode 100644
index 0000000..cea02bf
--- /dev/null
+++ b/gitbook/content/ja/getting-started/quick-start.md
@@ -0,0 +1,247 @@
+# はじめに
+
+9Routerを5分で起動し、AIリクエストをインテリジェントにルーティングし始めましょう。
+
+---
+
+## クイックスタート
+
+### 1. インストール
+
+```bash
+npm install -g 9router
+```
+
+**要件:** Node.js 20+ ([インストール詳細](getting-started/installation.md))
+
+### 2. 起動
+
+```bash
+9router
+```
+
+🎉 **ダッシュボードが自動的に開きます** (`http://localhost:20128`)
+
+- デフォルトパスワード: `123456` (ダッシュボードで変更)
+- APIキーは自動生成
+- プロバイダー接続の準備完了
+
+### 3. プロバイダーを接続
+
+プロバイダーを接続する方法は3つあります:
+
+#### オプションA: OAuth(サブスクリプションプロバイダー)
+
+**最適:** Claude Code、Codex、Gemini CLI、GitHub Copilot
+
+```
+Dashboard → Providers → Connect [Provider]
+→ OAuthログイン → トークン自動更新
+→ クォータトラッキング有効化
+```
+
+**例: Claude Code**
+1. 「Connect Claude Code」をクリック
+2. Claudeアカウントでログイン
+3. 9Routerを認可
+4. ✅ 完了! モデルを使用: `cc/claude-opus-4-5-20251101`
+
+#### オプションB: APIキー(低価格プロバイダー)
+
+**最適:** GLM、MiniMax、Kimi、OpenRouter
+
+```
+Dashboard → Providers → Add API Key
+→ プロバイダーを選択
+→ APIキーを貼り付け
+→ 保存
+```
+
+**例: GLM-4.7**
+1. [Zhipu AI](https://open.bigmodel.cn/)でサインアップ
+2. Coding PlanからAPIキーを取得
+3. Dashboard → Add API Key → Provider: `glm` → キーを貼り付け
+4. ✅ 完了! モデルを使用: `glm/glm-4.7`
+
+#### オプションC: 無料プロバイダー(コストなし)
+
+**最適:** iFlow、Qwen、Kiro
+
+```
+Dashboard → Providers → Connect [Free Provider]
+→ デバイスコードまたはOAuth
+→ 無制限利用
+```
+
+**例: iFlow**
+1. 「Connect iFlow」をクリック
+2. iFlowアカウントでログイン
+3. 認可
+4. ✅ 完了! 8モデルを使用: `if/kimi-k2-thinking`、`if/qwen3-coder-plus`など
+
+---
+
+## 4. CLIツールで使用
+
+コーディングツールを9Routerに向けます:
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [9routerダッシュボードから取得]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Claude Desktop
+
+`~/.claude/config.json`を編集:
+
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key"
+}
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [ダッシュボードから取得]
+Model: cc/claude-opus-4-5-20251101
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex "your prompt"
+```
+
+---
+
+## 5. スマートコンボを作成(オプション)
+
+コンボはモデル間の自動フォールバックを可能にします:
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101 (サブスクリプション優先)
+ 2. glm/glm-4.7 (低価格バックアップ、100万あたり$0.6)
+ 3. if/kimi-k2-thinking (無料フォールバック)
+
+CLIで使用: premium-coding
+```
+
+**動作:**
+1. 最初にClaude Opusを試行(サブスクリプション)
+2. クォータ消費時 → GLM-4.7(超低価格)
+3. 予算上限時 → iFlow(無料)
+4. ダウンタイムゼロ、自動切替!
+
+---
+
+## 利用可能なモデル
+
+### サブスクリプションモデル(最初に最大化)
+
+**Claude Code (`cc/`)** - Pro/Maxサブスクリプション:
+- `cc/claude-opus-4-5-20251101` - Claude 4.5 Opus
+- `cc/claude-sonnet-4-5-20250929` - Claude 4.5 Sonnet
+- `cc/claude-haiku-4-5-20251001` - Claude 4.5 Haiku
+
+**Codex (`cx/`)** - Plus/Proサブスクリプション:
+- `cx/gpt-5.2-codex` - GPT 5.2 Codex
+- `cx/gpt-5.1-codex-max` - GPT 5.1 Codex Max
+
+**Gemini CLI (`gc/`)** - 月18万無料:
+- `gc/gemini-3-flash-preview` - Gemini 3 Flash Preview
+- `gc/gemini-2.5-pro` - Gemini 2.5 Pro
+
+**GitHub Copilot (`gh/`)** - サブスクリプション:
+- `gh/gpt-5` - GPT-5
+- `gh/claude-4.5-sonnet` - Claude 4.5 Sonnet
+
+### 低価格モデル(バックアップ)
+
+**GLM (`glm/`)** - 100万あたり$0.6/$2.2:
+- `glm/glm-4.7` - GLM 4.7(毎日午前10時リセット)
+
+**MiniMax (`minimax/`)** - 100万あたり$0.20/$1.00:
+- `minimax/MiniMax-M2.1` - MiniMax M2.1(5時間リセット)
+
+**Kimi (`kimi/`)** - 月$9(1000万トークン):
+- `kimi/kimi-latest` - Kimi Latest
+
+### 無料モデル(緊急時)
+
+**iFlow (`if/`)** - 8モデル無料:
+- `if/kimi-k2-thinking` - Kimi K2 Thinking
+- `if/qwen3-coder-plus` - Qwen3 Coder Plus
+- `if/glm-4.7` - GLM 4.7
+- `if/deepseek-r1` - DeepSeek R1
+
+**Qwen (`qw/`)** - 3モデル無料:
+- `qw/qwen3-coder-plus` - Qwen3 Coder Plus
+- `qw/qwen3-coder-flash` - Qwen3 Coder Flash
+
+**Kiro (`kr/`)** - 2モデル無料:
+- `kr/claude-sonnet-4.5` - Claude Sonnet 4.5
+- `kr/claude-haiku-4.5` - Claude Haiku 4.5
+
+---
+
+## コスト最適化戦略
+
+### 月予算: $10〜20/月
+
+```
+1. クイックタスクにGemini CLI無料プラン(月18万)を使用
+2. Claude Codeサブスクリプションのクォータを完全利用(すでに支払い済み)
+3. クォータ切れ時はGLM(100万あたり$0.6)へフォールバック
+4. 緊急時: MiniMax M2.1(100万あたり$0.20)またはiFlow(無料)
+
+実例(月1億トークン):
+ Gemini CLI経由で6000万: $0(無料プラン)
+ Claude Code経由で3000万: $0(既存サブスクリプション)
+ GLM経由で800万: $4.80
+ MiniMax経由で200万: $0.40
+ 合計: 月$5.20 + 既存サブスクリプション
+```
+
+### クォータリセット戦略
+
+```
+日課:
+1. 朝: Claude Codeの新しいクォータ(5時間リセット)
+2. 午後: Gemini CLIへ切替(1K/日)
+3. 夕方: GLM日次クォータ(翌朝10時リセット)
+4. 深夜: MiniMax(5時間ローリング)またはiFlow(無料)
+
+→ 最小の追加コストで24時間コーディング!
+```
+
+---
+
+## 次のステップ
+
+- [インストール詳細](getting-started/installation.md) - 要件、トラブルシューティング
+- [機能](features/) - クォータトラッキング、コンボ、デプロイを確認
+- [FAQ](faq.md) - よくある質問と回答
+- [トラブルシューティング](troubleshooting.md) - 一般的な問題の修正
+
+---
+
+## ヘルプが必要?
+
+- **ウェブサイト**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/ja/index.md b/gitbook/content/ja/index.md
new file mode 100644
index 0000000..d3cbdcf
--- /dev/null
+++ b/gitbook/content/ja/index.md
@@ -0,0 +1,164 @@
+# 9Routerへようこそ
+
+**Claude、Codex、Geminiを無料で利用 • 100万トークンあたり$0.20からの超低価格な代替手段**
+
+9Routerは、インテリジェントなルーティングと自動フォールバックを通じて、サブスクリプションの価値を最大化し、コストを最小限に抑えるAIモデルルーターです。
+
+---
+
+## 9Routerとは?
+
+9Routerは、コーディングツール(Cursor、Cline、Claude Desktop)とAIプロバイダーの間に位置するスマートプロキシです。クォータ、コスト、可用性に基づいて、リクエストを最適なモデルへ自動的にルーティングします。
+
+**お金を無駄にしないために:**
+- ❌ サブスクリプションのクォータが毎月未使用のまま失効
+- ❌ レート制限でコーディングが中断
+- ❌ 高額なAPI(プロバイダーあたり月$20〜50)
+- ❌ プロバイダー間の手動切り替え
+
+**価値を最大化するために:**
+- ✅ **サブスクリプションを最大限活用** - Claude Code、Codex、Geminiのクォータを余すことなく追跡・利用
+- ✅ **無料で利用可能** - CLI経由でiFlow、Qwen、Kiroモデルにアクセス
+- ✅ **超低価格バックアップ** - GLM(100万あたり$0.6)、MiniMax M2.1(100万あたり$0.20)
+- ✅ **スマートフォールバック** - サブスクリプション → 低価格 → 無料へ自動切替
+
+---
+
+## 主な機能
+
+### 🔄 スマート3階層フォールバック
+
+```
+一度セットアップすれば、コーディングが止まらない:
+
+Tier 1 (サブスクリプション): Claude Code → Codex → Gemini
+ ↓ クォータ消費
+Tier 2 (低価格): GLM-4.7 → MiniMax M2.1 → Kimi
+ ↓ 予算上限
+Tier 3 (無料): iFlow → Qwen → Kiro
+
+→ 自動切替、ダウンタイムゼロ!
+```
+
+### 📊 クォータトラッキング
+
+- プロバイダーごとのリアルタイムトークン消費
+- リセットカウントダウン(5時間、毎日、毎週、毎月)
+- 有料プランのコスト見積もり
+- 月次支出レポート
+
+### 🎯 ユニバーサルCLIサポート
+
+カスタムOpenAIエンドポイントをサポートするあらゆるツールで動作:
+
+✅ **Cursor** • **Cline** • **Claude Desktop** • **Codex** • **RooCode** • **Continue** • **OpenAI互換ツール全般**
+
+### 💰 コスト最適化
+
+**実例(月1億トークン):**
+```
+Gemini CLI経由で6000万: $0(無料プラン)
+Claude Code経由で3000万: $0(既存サブスクリプション)
+GLM経由で800万: $4.80
+MiniMax経由で200万: $0.40
+合計: 月$5.20 vs ChatGPT APIの$2000!
+```
+
+---
+
+## なぜ9Routerを選ぶのか?
+
+### サブスクリプションを最大化
+
+すでにClaude Code(月$20〜100)やCodex(月$20〜200)に支払っていますか? 完全な価値を引き出しましょう:
+
+- クォータ使用量をリアルタイムで追跡
+- クォータリセット(5時間、週次)時に自動切替
+- 失効前にすべてのトークンを使い切る
+- Gemini CLI: 月18万コンプリーション**無料**
+
+### 超低価格バックアップ
+
+サブスクリプションのクォータが切れたら、わずかな金額で:
+
+| プロバイダー | 100万トークンあたりのコスト | リセット |
+|----------|-------------------|-------|
+| **GLM-4.7** | 入力$0.60 / 出力$2.20 | 毎日午前10時 |
+| **MiniMax M2.1** | 入力$0.20 / 出力$1.00 | 5時間ローリング |
+| **Kimi K2** | 月$9(1000万トークン) | 月次 |
+
+**ChatGPT API(100万あたり$20)より約90%安い!**
+
+### 永久無料フォールバック
+
+他がすべてクォータ制限に達した時の緊急バックアップ:
+
+- **iFlow**: 8モデル(Kimi K2、Qwen3 Coder Plus、GLM 4.7、MiniMax M2)
+- **Qwen**: 3モデル(Qwen3 Coder Plus/Flash、Vision)
+- **Kiro**: Claude Sonnet 4.5、Haiku 4.5(AWS Builder ID)
+
+---
+
+## クイックスタート
+
+2分で始められます:
+
+```bash
+# グローバルインストール
+npm install -g 9router
+
+# 起動(ダッシュボードが自動で開きます)
+9router
+```
+
+🎉 **ダッシュボードが開く** → プロバイダーを接続 → コーディング開始!
+
+**CLIツールで使う:**
+
+```
+Endpoint: http://localhost:20128/v1
+API Key: [ダッシュボードから取得]
+Model: cc/claude-opus-4-5-20251101
+```
+
+[→ 完全なスタートガイド](getting-started.md)
+
+---
+
+## ユースケース
+
+### 個人開発者向け
+
+- Claude Code/Codexサブスクリプションを最大限活用
+- Gemini CLI無料プラン(月18万)を活用
+- 超低価格モデル(100万あたり$0.20)へフォールバック
+- レート制限なしで24時間コーディング
+
+### チーム向け
+
+- VPS/クラウドにデプロイして共有アクセス
+- チームの支出をリアルタイムで追跡
+- 階層ごとに予算上限を設定
+- 集中型のプロバイダー管理
+
+### モバイル/リモートコーディング向け
+
+- クラウドデプロイ(https://9router.com)を使用
+- iPad、スマホ、どこからでもアクセス
+- localhost制限なし
+- Cloudflareエッジネットワーク(300以上のロケーション)
+
+---
+
+## 次は?
+
+- [スタートガイド](getting-started.md) - 5分でインストールと設定
+- [インストールガイド](getting-started/installation.md) - 詳細なセットアップ手順
+- [機能](features/) - すべての機能を確認
+- [FAQ](faq.md) - よくある質問
+
+---
+
+
+ AIの価値を最大化する開発者のために ❤️ で構築
+
diff --git a/gitbook/content/ja/integration/claude-code.md b/gitbook/content/ja/integration/claude-code.md
new file mode 100644
index 0000000..7c3e814
--- /dev/null
+++ b/gitbook/content/ja/integration/claude-code.md
@@ -0,0 +1,109 @@
+# Claude Code統合
+
+9RouterをClaude Code CLIと統合し、AnthropicのAPIリクエストを9Routerのインテリジェントルーティングシステム経由でルーティングします。
+
+## 前提条件
+
+- Claude Code CLIがインストール済み
+- 9Routerがローカルで動作中、またはクラウドエンドポイントが設定済み
+- 9RouterダッシュボードからのAPIキー
+
+## セットアップ
+
+### 1. 環境変数を設定
+
+シェル設定ファイル (`~/.bashrc`、`~/.zshrc`、または `~/.bash_profile`) で以下の環境変数を設定:
+
+```bash
+# 9Router用Base URL
+export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
+
+# オプション: エイリアス用のデフォルトモデルを設定
+export ANTHROPIC_DEFAULT_OPUS_MODEL="cc/claude-opus-4-5-20251101"
+export ANTHROPIC_DEFAULT_SONNET_MODEL="cc/claude-sonnet-4-5-20250929"
+export ANTHROPIC_DEFAULT_HAIKU_MODEL="cc/claude-haiku-4-5-20251001"
+```
+
+### 2. シェル設定をリロード
+
+```bash
+source ~/.zshrc # または ~/.bashrc
+```
+
+### 3. 設定を確認
+
+環境変数が正しく設定されているか確認:
+
+```bash
+echo $ANTHROPIC_BASE_URL
+```
+
+## モデルエイリアス
+
+Claude Codeは9Routerモデルにマッピングされる以下のモデルエイリアスをサポート:
+
+| エイリアス | モデル | 環境変数 |
+|-------|-------|---------------------|
+| `opus` | Claude Opus 4.5 | `ANTHROPIC_DEFAULT_OPUS_MODEL` |
+| `sonnet` | Claude Sonnet 4.5 | `ANTHROPIC_DEFAULT_SONNET_MODEL` |
+| `haiku` | Claude Haiku 4.5 | `ANTHROPIC_DEFAULT_HAIKU_MODEL` |
+
+## 使用例
+
+### モデルエイリアスを使用
+
+```bash
+# Opusモデルを使用
+claude --model opus "Explain quantum computing"
+
+# Sonnetモデルを使用
+claude --model sonnet "Write a Python function"
+
+# Haikuモデルを使用
+claude --model haiku "Quick code review"
+```
+
+### フルモデル名を使用
+
+```bash
+claude --model cc/claude-opus-4-5-20251101 "Your prompt here"
+```
+
+## 設定ファイル
+
+Claude Codeは設定を `~/.claude/settings.json` に保存します。必要に応じてこのファイルを手動で編集できます:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "defaultModel": "sonnet"
+}
+```
+
+## トラブルシューティング
+
+### 接続の問題
+
+接続エラーが発生した場合:
+
+1. 9Routerが動作中か確認: `curl http://localhost:20128/health`
+2. 環境変数が正しく設定されているか確認
+3. ファイアウォールがポート20128をブロックしていないか確認
+
+### モデルが見つからない
+
+「model not found」エラーが発生した場合:
+
+1. モデル名が9Routerの設定と一致しているか確認
+2. 9Routerダッシュボードでプロバイダー接続がアクティブか確認
+3. 接続されたプロバイダーでモデルが利用可能か確認
+
+## クラウドエンドポイント
+
+localhostの代わりに9Routerクラウドエンドポイントを使用するには:
+
+```bash
+export ANTHROPIC_BASE_URL="https://9router.com"
+```
+
+9RouterクラウドダッシュボードでAPIキーが設定されていることを確認してください。
diff --git a/gitbook/content/ja/integration/cline.md b/gitbook/content/ja/integration/cline.md
new file mode 100644
index 0000000..3ef951d
--- /dev/null
+++ b/gitbook/content/ja/integration/cline.md
@@ -0,0 +1,201 @@
+# Cline統合
+
+9RouterをCline VSCode拡張機能と統合し、AIリクエストを9Routerのインテリジェントルーティングシステム経由でルーティングします。
+
+## 前提条件
+
+- Visual Studio Codeがインストール済み
+- VSCodeマーケットプレイスからCline拡張機能がインストール済み
+- 9Routerがローカルで動作中、またはクラウドエンドポイントが設定済み
+- 9RouterダッシュボードからのAPIキー
+
+## セットアップ
+
+### 1. Cline設定を開く
+
+1. Visual Studio Codeを開く
+2. Cline拡張機能パネルを開く (サイドバーのClineアイコンをクリック)
+3. Clineパネルの **Settings** アイコン (歯車アイコン) をクリック
+
+### 2. APIプロバイダーを選択
+
+1. Cline設定で **API Provider** ドロップダウンを見つける
+2. リストから **Ollama** を選択
+ - 注: OpenAIスタイルAPIと互換性があるためOllamaプロバイダータイプを使用します
+
+### 3. Base URLを設定
+
+Base URLを9Routerエンドポイントに設定:
+
+**ローカル9Router用:**
+```
+http://localhost:20128/v1
+```
+
+**クラウド9Router用:**
+```
+https://9router.com
+```
+
+**手順:**
+1. **Base URL** フィールドに9Routerエンドポイントを入力
+2. 末尾に `/v1` を必ず含める
+
+### 4. APIキーを追加
+
+1. **API Key** フィールドに9Router APIキーを入力
+2. APIキーは9Routerダッシュボードの **Settings → API Keys** で確認できます
+3. キーは `sk-9router-` で始まります
+
+### 5. モデルを選択
+
+1. **Model** ドロップダウンで、次のいずれかを実行:
+ - 利用可能なモデルから選択 (Clineが自動検出した場合)
+ - 9Router設定からモデル名を手動で入力
+
+2. 一般的なモデル名:
+ - `gpt-4`
+ - `gpt-4o`
+ - `claude-opus-4-5`
+ - `claude-sonnet-4-5`
+ - `gemini-2.0-flash`
+
+### 6. 設定を保存
+
+**Save** をクリックするか、設定パネルを閉じます。Clineは設定を自動的に保存します。
+
+## 設定例
+
+Cline設定は次のようになります:
+
+```
+API Provider: Ollama
+Base URL: http://localhost:20128/v1
+API Key: sk-9router-xxxxxxxxxxxxx
+Model: gpt-4
+```
+
+## 利用可能なモデル
+
+9Routerダッシュボードで設定されたモデルを使用できます。一般的な例:
+
+| モデル名 | プロバイダー | 説明 |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## 使用法
+
+### AIとチャット
+
+1. VSCodeでClineパネルを開く
+2. チャット入力にメッセージを入力
+3. Enterを押して送信
+4. Clineは9Routerを使用してリクエストを処理
+
+### コード生成
+
+1. Clineにコード生成を依頼: 「Create a React component for a login form」
+2. Clineは9Routerを使用してコードを生成
+3. 生成されたコードを確認して受け入れる
+
+### コード説明
+
+1. エディタでコードを選択
+2. Clineに質問: 「Explain this code」
+3. 9Router経由でAIによる説明を取得
+
+### ファイル操作
+
+1. Clineにファイルの作成、変更、削除を依頼
+2. Clineは9Routerを使用してコンテキストを理解し変更を加える
+3. 受け入れる前に変更を確認
+
+## トラブルシューティング
+
+### 「Connection Failed」エラー
+
+1. 9Routerが動作中か確認: `curl http://localhost:20128/health`
+2. Base URLが正しく、`/v1` を含むことを確認
+3. ファイアウォールがポート20128をブロックしていないか確認
+4. VSCodeを再起動してみる
+
+### 「Invalid API Key」エラー
+
+1. 9RouterダッシュボードでAPIキーを確認
+2. `sk-9router-` プレフィックスを含むキー全体をコピーしたか確認
+3. APIキーが期限切れでないか確認
+4. 新しいAPIキーを再生成してみる
+
+### 「Model Not Found」エラー
+
+1. モデル名が9Router設定と正確に一致するか確認
+2. 9Routerダッシュボードでプロバイダー接続がアクティブか確認
+3. 接続されたプロバイダーでモデルが利用可能か確認
+4. フルモデル名を使用してみる (例: `gpt-4` の代わりに `openai/gpt-4`)
+
+### Clineが応答しない
+
+1. エラーメッセージについてCline出力パネルを確認
+2. 9Routerインスタンスが動作中で正常か確認
+3. VSCodeウィンドウをリロードしてみる (Cmd/Ctrl + Shift + P → 「Reload Window」)
+4. エラーについて9Routerログを確認
+
+## 高度な設定
+
+### クラウドエンドポイントを使用
+
+localhostの代わりに9Routerクラウドエンドポイントを使用:
+
+1. Cline設定で、Base URLを設定: `https://9router.com`
+2. 9RouterクラウドダッシュボードでAPIキーが設定されていることを確認
+3. クラウドエンドポイントがアクティブでアクセス可能か確認
+
+### 複数のモデル
+
+モデルをすばやく切り替えることができます:
+
+1. Cline設定を開く
+2. **Model** フィールドを別のモデルに変更
+3. 保存して新しいモデルでチャットを続行
+
+### カスタムタイムアウト
+
+大きなリクエストでタイムアウトの問題が発生した場合:
+
+1. VSCode設定を開く (Cmd/Ctrl + ,)
+2. 「Cline timeout」を検索
+3. タイムアウト値を増やす (デフォルトは通常30秒)
+
+## ベストプラクティス
+
+1. **適切なモデルを使用**: シンプルなタスクには高速モデル (HaikuやFlash) を、複雑なタスクには強力なモデル (OpusやGPT-4) を選択
+2. **使用量をモニター**: 9Routerダッシュボードで使用統計とコストを確認
+3. **コンテキスト管理**: トークン使用量を減らすため、会話を焦点を絞ったものに保つ
+4. **モデル切替**: タスクの複雑さに基づいてモデルを切り替え、コストとパフォーマンスを最適化
+5. **APIキーセキュリティ**: APIキーをバージョン管理にコミットしない
+
+## 9Router機能との統合
+
+### モデルルーティング
+
+9Routerは以下に基づいて最適な利用可能なプロバイダーにリクエストを自動的にルーティング:
+- モデル可用性
+- プロバイダーヘルスステータス
+- コスト最適化
+- ロードバランシング
+
+### フォールバックサポート
+
+プロバイダーが失敗した場合、9Routerは自動的にダッシュボードで設定された代替プロバイダーにフォールバックします。
+
+### 使用量トラッキング
+
+9Routerダッシュボード経由でCline使用量をモニター:
+- 総リクエスト数
+- トークン使用量
+- モデルごとのコスト
+- プロバイダー分布
diff --git a/gitbook/content/ja/integration/codex.md b/gitbook/content/ja/integration/codex.md
new file mode 100644
index 0000000..61c9d66
--- /dev/null
+++ b/gitbook/content/ja/integration/codex.md
@@ -0,0 +1,136 @@
+# OpenAI Codex CLI統合
+
+9RouterをOpenAI Codex CLIと統合し、OpenAI APIリクエストを9Routerのインテリジェントルーティングシステム経由でルーティングします。
+
+## 前提条件
+
+- OpenAI Codex CLIがインストール済み
+- 9Routerがローカルで動作中、またはクラウドエンドポイントが設定済み
+- 9RouterダッシュボードからのAPIキー
+
+## セットアップ
+
+### 1. 環境変数を設定
+
+シェル設定ファイル (`~/.bashrc`、`~/.zshrc`、または `~/.bash_profile`) で以下の環境変数を設定:
+
+```bash
+# 9Router用Base URL
+export OPENAI_BASE_URL="http://localhost:20128/v1"
+
+# 9RouterダッシュボードからのAPIキー
+export OPENAI_API_KEY="your-9router-api-key"
+```
+
+### 2. シェル設定をリロード
+
+```bash
+source ~/.zshrc # または ~/.bashrc
+```
+
+### 3. 設定を確認
+
+環境変数が正しく設定されているか確認:
+
+```bash
+echo $OPENAI_BASE_URL
+echo $OPENAI_API_KEY
+```
+
+## 利用可能なモデル
+
+9Routerは以下のCodexモデルを提供します:
+
+| モデルID | 説明 |
+|----------|-------------|
+| `cx/gpt-5.2-codex` | GPT-5.2 Codex - 最新バージョン |
+| `cx/gpt-5.1-codex-max` | GPT-5.1 Codex Max - 拡張コンテキスト |
+
+## 使用例
+
+### 基本的な使用法
+
+```bash
+# GPT-5.2 Codexを使用
+codex --model cx/gpt-5.2-codex "Write a function to sort an array"
+
+# GPT-5.1 Codex Maxを使用
+codex --model cx/gpt-5.1-codex-max "Explain this complex algorithm"
+```
+
+### コード生成
+
+```bash
+codex --model cx/gpt-5.2-codex "Create a REST API endpoint for user authentication"
+```
+
+### コード説明
+
+```bash
+codex --model cx/gpt-5.1-codex-max "Explain what this code does: $(cat myfile.js)"
+```
+
+## 設定ファイル
+
+設定ファイルを使ってCodex CLIを設定することもできます。`~/.codex/config.json` を作成または編集:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "apiKey": "your-9router-api-key",
+ "defaultModel": "cx/gpt-5.2-codex"
+}
+```
+
+## トラブルシューティング
+
+### 認証エラー
+
+認証エラーが発生した場合:
+
+1. 9RouterダッシュボードでAPIキーが正しいか確認
+2. `OPENAI_API_KEY` 環境変数が設定されているか確認
+3. APIキーが期限切れでないか確認
+
+### 接続の問題
+
+接続エラーが発生した場合:
+
+1. 9Routerが動作中か確認: `curl http://localhost:20128/health`
+2. 環境変数が正しく設定されているか確認
+3. ファイアウォールがポート20128をブロックしていないか確認
+
+### モデルが利用不可
+
+「model not available」エラーが発生した場合:
+
+1. モデル名が9Router設定と一致するか確認
+2. 9RouterダッシュボードでOpenAIプロバイダー接続がアクティブか確認
+3. 接続されたプロバイダーでモデルが利用可能か確認
+
+## クラウドエンドポイント
+
+localhostの代わりに9Routerクラウドエンドポイントを使用するには:
+
+```bash
+export OPENAI_BASE_URL="https://9router.com"
+```
+
+9RouterクラウドダッシュボードでAPIキーが設定されていることを確認してください。
+
+## 高度な設定
+
+### カスタムタイムアウト
+
+```bash
+export OPENAI_TIMEOUT=60 # 秒
+```
+
+### デバッグモード
+
+詳細なリクエスト/レスポンスログを表示するため、デバッグモードを有効化:
+
+```bash
+export CODEX_DEBUG=true
+codex --model cx/gpt-5.2-codex "Your prompt"
+```
diff --git a/gitbook/content/ja/integration/continue.md b/gitbook/content/ja/integration/continue.md
new file mode 100644
index 0000000..0b37d59
--- /dev/null
+++ b/gitbook/content/ja/integration/continue.md
@@ -0,0 +1,249 @@
+# Continue VSCode拡張機能統合
+
+9RouterをContinue拡張機能と統合し、Visual Studio Codeに直接AIアシスタンスを導入します。
+
+## 前提条件
+
+- Visual Studio Codeがインストール済み
+- VSCodeマーケットプレイスからContinue拡張機能がインストール済み
+- [ダッシュボード](https://9router.com/dashboard)からの9Router APIキー
+- 9Routerが動作中 (ローカルまたはクラウド)
+
+## 設定手順
+
+### 1. Continue設定を開く
+
+1. VSCodeを開く
+2. `Cmd+Shift+P` (Mac) または `Ctrl+Shift+P` (Windows/Linux) を押す
+3. 「Continue: Open Config」と入力して選択
+4. `~/.continue/config.json` が開きます
+
+### 2. 9Routerモデル設定を追加
+
+以下の設定を `config.json` に追加:
+
+**単一モデルセットアップ:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**複数モデルセットアップ:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus (Best)",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Sonnet (Balanced)",
+ "provider": "openai",
+ "model": "cc/claude-sonnet-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - DeepSeek Chat (Code)",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Haiku (Fast)",
+ "provider": "openai",
+ "model": "cc/claude-haiku-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**クラウド9Router用:**
+`apiBase` を以下に置き換え:
+```json
+"apiBase": "https://9router.com/v1"
+```
+
+### 3. 保存してリロード
+
+1. 設定ファイルを保存
+2. VSCodeウィンドウをリロード: `Cmd+Shift+P` → 「Developer: Reload Window」
+3. Continue拡張機能が新しい設定を読み込みます
+
+### 4. モデルを選択
+
+1. Continueサイドバーを開く (左パネルのContinueアイコンをクリック)
+2. 上部のモデルセレクタードロップダウンをクリック
+3. お好みの9Routerモデルを選択
+
+## 利用可能なモデル
+
+### Claudeモデル (Anthropic)
+- `cc/claude-opus-4-5-20251101` - 最も高性能、複雑なタスクに最適
+- `cc/claude-sonnet-4-20250514` - パフォーマンスと速度のバランス
+- `cc/claude-haiku-4-20250514` - 最速、シンプルなタスクに適している
+
+### DeepSeekモデル
+- `cx/deepseek-chat` - コード生成に優れている
+- `cx/deepseek-reasoner` - 複雑な問題解決に最適
+
+### GLMモデル (Zhipu AI)
+- `glm/glm-4-plus` - 高度な中国語と英語
+- `glm/glm-4-flash` - 高速応答
+
+## 使用例
+
+### コード説明
+1. エディタでコードを選択
+2. Continueサイドバーを開く
+3. 入力: 「Explain this code」
+4. Model: `cc/claude-sonnet-4-20250514`
+
+### コード生成
+1. Continueサイドバーを開く
+2. 入力: 「Create a React component for user profile card」
+3. Model: `cx/deepseek-chat`
+
+### リファクタリング
+1. リファクタリングするコードを選択
+2. 入力: 「Refactor this to use async/await」
+3. Model: `cc/claude-sonnet-4-20250514`
+
+### バグ修正
+1. 問題のあるコードを選択
+2. 入力: 「Find and fix the bug in this code」
+3. Model: `cx/deepseek-reasoner`
+
+## 高度な設定
+
+### カスタムシステムプロンプト
+
+特定の動作のためのカスタムシステムプロンプトを追加:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Code Expert",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "systemMessage": "You are an expert programmer. Always provide clean, well-documented code with best practices."
+ }
+ ]
+}
+```
+
+### Temperatureとパラメータ
+
+パラメータでモデルの動作を調整:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Creative Writer",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "temperature": 0.9,
+ "topP": 0.95
+ }
+ ]
+}
+```
+
+### コンテキストプロバイダー
+
+Continueがモデルに送信するコンテキストを設定:
+
+```json
+{
+ "contextProviders": [
+ {
+ "name": "code",
+ "params": {
+ "maxLines": 100
+ }
+ },
+ {
+ "name": "diff",
+ "params": {}
+ },
+ {
+ "name": "terminal",
+ "params": {}
+ }
+ ]
+}
+```
+
+## キーボードショートカット
+
+- `Cmd+L` (Mac) / `Ctrl+L` (Windows/Linux) - Continueチャットを開く
+- `Cmd+I` (Mac) / `Ctrl+I` (Windows/Linux) - インライン編集
+- `Cmd+Shift+R` (Mac) / `Ctrl+Shift+R` (Windows/Linux) - 応答を再生成
+
+## トラブルシューティング
+
+### モデルが応答しない
+- 9Routerが動作中か確認: `curl http://localhost:20128/health`
+- config.jsonのAPIキーを確認
+- エラーについてVSCode開発者コンソールを確認: `Help` → `Toggle Developer Tools`
+
+### 間違ったモデルが選択されている
+- Continueサイドバーのモデルドロップダウンをクリック
+- 正しい9Routerモデルを選択
+- モデル名は正確に一致する必要があります (大文字小文字を区別)
+
+### 設定が読み込まれない
+- JSON構文が有効であることを確認 (JSONバリデータを使用)
+- ファイルの場所を確認: `~/.continue/config.json`
+- 変更後にVSCodeウィンドウをリロード
+
+### パフォーマンスが遅い
+- より高速なモデルへ切替 (haiku、flash)
+- contextProvidersでコンテキストサイズを削減
+- 9Routerへのネットワークレイテンシを確認
+
+## ベストプラクティス
+
+### モデル選択戦略
+- **クイック編集**: `cc/claude-haiku-4-20250514` を使用
+- **コード生成**: `cx/deepseek-chat` を使用
+- **複雑なリファクタリング**: `cc/claude-opus-4-5-20251101` を使用
+- **問題解決**: `cx/deepseek-reasoner` を使用
+
+### コンテキスト管理
+- 質問する前に関連コードのみを選択
+- 具体的で明確なプロンプトを使用
+- 複雑なタスクを小さなステップに分解
+
+### コスト最適化
+- シンプルなタスクには高速/安価なモデルを使用
+- 可能な場合はコンテキストサイズを制限
+- 頻繁に使用される応答をキャッシュ
+
+## 次のステップ
+
+- [Cursorを設定](cursor.md) IDE統合を強化
+- [Rooをセットアップ](roo.md) AIアシスタント用
+- [CLI使用法を確認](../cli/basic-usage.md)
+- [モデル選択について学ぶ](../models/overview.md)
diff --git a/gitbook/content/ja/integration/cursor.md b/gitbook/content/ja/integration/cursor.md
new file mode 100644
index 0000000..e30ebd5
--- /dev/null
+++ b/gitbook/content/ja/integration/cursor.md
@@ -0,0 +1,149 @@
+# Cursor統合
+
+9RouterをCursor IDEと統合し、AIリクエストを9Routerのインテリジェントルーティングシステム経由でルーティングします。
+
+## 前提条件
+
+- Cursor IDEがインストール済み
+- Cursor Proアカウント (カスタムAPIエンドポイントに必要)
+- 9Routerクラウドエンドポイントが設定済み
+- 9RouterダッシュボードからのAPIキー
+
+## ⚠️ 重要な注意点
+
+> **クラウドエンドポイントが必要**: Cursorは独自のサーバー経由でリクエストをルーティングし、localhostエンドポイントをサポートしません。9Routerクラウドエンドポイント `https://9router.com` を使用する必要があります。
+
+> **Cursor Proが必要**: この機能はカスタムAPIエンドポイントを使用するためにCursor Proアカウントが必要です。
+
+## セットアップ
+
+### 1. Cursor設定を開く
+
+1. Cursor IDEを開く
+2. **Settings** へ移動 (Cmd/Ctrl + ,)
+3. **Models** セクションへ移動
+
+### 2. OpenAI APIを有効化
+
+1. **OpenAI API key** オプションを見つける
+2. トグルを有効にしてカスタムAPI設定を有効化
+
+### 3. Base URLを設定
+
+Base URLを9Routerクラウドエンドポイントに設定:
+
+```
+https://9router.com
+```
+
+**手順:**
+1. Models設定で **Base URL** フィールドを見つける
+2. 入力: `https://9router.com`
+3. **Save** をクリック
+
+### 4. APIキーを追加
+
+1. **API Key** フィールドに9Router APIキーを入力
+2. APIキーは9Routerダッシュボードの **Settings → API Keys** で確認できます
+3. **Save** をクリック
+
+### 5. カスタムモデルを追加
+
+1. **View All Models** ボタンをクリック
+2. **Add Custom Model** をクリック
+3. 9Router設定からモデル名を入力 (例: `gpt-4`、`claude-opus-4-5` など)
+4. **Add** をクリック
+
+### 6. モデルを選択
+
+1. Cursorチャットインターフェイスでモデルセレクタードロップダウンをクリック
+2. リストからカスタムモデルを選択
+3. Cursorで9Routerを使い始める!
+
+## 設定例
+
+Cursor設定は次のようになります:
+
+```
+OpenAI API: ✓ Enabled
+Base URL: https://9router.com
+API Key: sk-9router-xxxxxxxxxxxxx
+Custom Models: gpt-4, claude-opus-4-5, gemini-2.0-flash
+```
+
+## 利用可能なモデル
+
+9Routerダッシュボードで設定されたモデルを使用できます。一般的な例:
+
+| モデル名 | プロバイダー | 説明 |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## 使用法
+
+### チャットインターフェイス
+
+1. Cursorチャットを開く (Cmd/Ctrl + L)
+2. ドロップダウンからモデルを選択
+3. 9Router経由でAIとチャット開始
+
+### インラインコード生成
+
+1. エディタでコードを選択
+2. Cmd/Ctrl + Kを押す
+3. プロンプトを入力
+4. Cursorは9Routerを使用してコードを生成
+
+### コード説明
+
+1. エディタでコードを選択
+2. Cmd/Ctrl + Lを押す
+3. 「Explain this code」と質問
+4. 9Router経由でAIによる説明を取得
+
+## トラブルシューティング
+
+### 「Invalid API Key」エラー
+
+1. 9RouterダッシュボードでAPIキーを確認
+2. `sk-9router-` プレフィックスを含むキー全体をコピーしたか確認
+3. APIキーが期限切れでないか確認
+4. 新しいAPIキーを再生成してみる
+
+### 「Model Not Found」エラー
+
+1. モデル名が9Router設定と正確に一致するか確認
+2. 9Routerダッシュボードでプロバイダー接続がアクティブか確認
+3. 接続されたプロバイダーでモデルが利用可能か確認
+4. フルモデル名を使用してみる (例: `gpt-4` の代わりに `openai/gpt-4`)
+
+### 接続の問題
+
+1. クラウドエンドポイントを使用しているか確認: `https://9router.com`
+2. インターネット接続を確認
+3. 9Routerクラウドサービスが運用中か確認
+4. VPNまたはプロキシが有効な場合は無効化してみる
+
+### Localhostが動作しない
+
+> **覚えておいてください**: Cursorはlocalhostエンドポイントをサポートしません。クラウドエンドポイント `https://9router.com` を使用する必要があります。ローカル9Routerインスタンスを使用したい場合は、ngrokなどのトンネリングサービスを検討してローカルエンドポイントを公開してください。
+
+## クラウドエンドポイントのセットアップ
+
+ローカルで9Routerを実行し、Cursorで使用したい場合:
+
+1. 9Router設定でクラウドエンドポイントを有効化
+2. 9RouterダッシュボードでクラウドエンドポイントURLを設定
+3. Cursor設定でクラウドURLを使用
+4. ローカル9Routerインスタンスがインターネットからアクセス可能か確認
+
+## ベストプラクティス
+
+1. **モデルエイリアスを使用**: 9Routerで頻繁に使うモデル用のショートエイリアスを作成
+2. **使用量をモニター**: 9Routerダッシュボードで使用統計とコストを確認
+3. **APIキーをローテーション**: セキュリティのためAPIキーを定期的にローテーション
+4. **モデルをテスト**: ユースケースに最適なモデルを見つけるため、異なるモデルを試す
diff --git a/gitbook/content/ja/integration/other-tools.md b/gitbook/content/ja/integration/other-tools.md
new file mode 100644
index 0000000..654cfdb
--- /dev/null
+++ b/gitbook/content/ja/integration/other-tools.md
@@ -0,0 +1,416 @@
+# その他ツール統合
+
+9RouterはOpenAI API形式をサポートする任意のツールと互換性があります。このガイドでは、様々なツールやカスタムアプリケーション向けの汎用統合パターンを説明します。
+
+## 概要
+
+9RouterはOpenAI互換APIエンドポイントを提供し、以下と動作します:
+- カスタムスクリプトとアプリケーション
+- APIクライアントとテストツール
+- CLIツールとユーティリティ
+- サードパーティ統合
+- 開発フレームワーク
+
+## 汎用セットアップパターン
+
+任意のOpenAI互換ツールは以下の設定で9Routerに接続できます:
+
+**ローカル9Router:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+Model: 任意の9Routerモデル (cc/*, cx/*, glm/*など)
+```
+
+**クラウド9Router:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+Model: 任意の9Routerモデル (cc/*, cx/*, glm/*など)
+```
+
+## 利用可能なモデル
+
+### Claudeモデル (Anthropic)
+- `cc/claude-opus-4-5-20251101`
+- `cc/claude-sonnet-4-20250514`
+- `cc/claude-haiku-4-20250514`
+
+### DeepSeekモデル
+- `cx/deepseek-chat`
+- `cx/deepseek-reasoner`
+
+### GLMモデル (Zhipu AI)
+- `glm/glm-4-plus`
+- `glm/glm-4-flash`
+
+## 統合例
+
+### PythonとOpenAI SDK
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+)
+
+print(response.choices[0].message.content)
+```
+
+### Node.jsとOpenAI SDK
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+const response = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [
+ { role: "user", content: "Hello, how are you?" }
+ ]
+});
+
+console.log(response.choices[0].message.content);
+```
+
+### cURLコマンド
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer your-api-key-from-dashboard" \
+ -d '{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+ }'
+```
+
+### HTTPクライアント (Postman、Insomnia)
+
+**Request:**
+```
+POST http://localhost:20128/v1/chat/completions
+```
+
+**Headers:**
+```
+Content-Type: application/json
+Authorization: Bearer your-api-key-from-dashboard
+```
+
+**Body:**
+```json
+{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ],
+ "temperature": 0.7,
+ "max_tokens": 1000
+}
+```
+
+### LangChain統合
+
+```python
+from langchain.chat_models import ChatOpenAI
+from langchain.schema import HumanMessage
+
+llm = ChatOpenAI(
+ model_name="cc/claude-sonnet-4-20250514",
+ openai_api_key="your-api-key-from-dashboard",
+ openai_api_base="http://localhost:20128/v1",
+ temperature=0.7
+)
+
+messages = [HumanMessage(content="Explain quantum computing")]
+response = llm(messages)
+print(response.content)
+```
+
+### LlamaIndex統合
+
+```python
+from llama_index.llms import OpenAI
+
+llm = OpenAI(
+ model="cc/claude-sonnet-4-20250514",
+ api_key="your-api-key-from-dashboard",
+ api_base="http://localhost:20128/v1"
+)
+
+response = llm.complete("What is machine learning?")
+print(response.text)
+```
+
+## カスタムスクリプトの例
+
+### バッチ処理スクリプト
+
+```python
+import openai
+import json
+
+openai.api_key = "your-api-key-from-dashboard"
+openai.api_base = "http://localhost:20128/v1"
+
+def process_batch(prompts, model="cx/deepseek-chat"):
+ results = []
+ for prompt in prompts:
+ response = openai.ChatCompletion.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ results.append({
+ "prompt": prompt,
+ "response": response.choices[0].message.content
+ })
+ return results
+
+prompts = [
+ "Explain AI in one sentence",
+ "What is machine learning?",
+ "Define neural networks"
+]
+
+results = process_batch(prompts)
+print(json.dumps(results, indent=2))
+```
+
+### ストリーミングレスポンスハンドラ
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+async function streamResponse(prompt) {
+ const stream = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [{ role: "user", content: prompt }],
+ stream: true
+ });
+
+ for await (const chunk of stream) {
+ const content = chunk.choices[0]?.delta?.content || "";
+ process.stdout.write(content);
+ }
+}
+
+streamResponse("Write a short story about AI");
+```
+
+### マルチモデル比較
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+models = [
+ "cc/claude-sonnet-4-20250514",
+ "cx/deepseek-chat",
+ "glm/glm-4-plus"
+]
+
+prompt = "Explain quantum computing in simple terms"
+
+for model in models:
+ response = client.chat.completions.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ print(f"\n=== {model} ===")
+ print(response.choices[0].message.content)
+```
+
+## 一般的な統合パターン
+
+### 環境変数
+
+認証情報を安全に保存:
+
+```bash
+# .envファイル
+ROUTER_API_KEY=your-api-key-from-dashboard
+ROUTER_BASE_URL=http://localhost:20128/v1
+ROUTER_MODEL=cc/claude-sonnet-4-20250514
+```
+
+```python
+import os
+from openai import OpenAI
+
+client = OpenAI(
+ api_key=os.getenv("ROUTER_API_KEY"),
+ base_url=os.getenv("ROUTER_BASE_URL")
+)
+```
+
+### エラーハンドリング
+
+```python
+from openai import OpenAI, OpenAIError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": "Hello"}]
+ )
+ print(response.choices[0].message.content)
+except OpenAIError as e:
+ print(f"Error: {e}")
+```
+
+### リトライロジック
+
+```python
+import time
+from openai import OpenAI, RateLimitError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+def chat_with_retry(prompt, max_retries=3):
+ for attempt in range(max_retries):
+ try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": prompt}]
+ )
+ return response.choices[0].message.content
+ except RateLimitError:
+ if attempt < max_retries - 1:
+ time.sleep(2 ** attempt) # Exponential backoff
+ else:
+ raise
+```
+
+## トラブルシューティング
+
+### 接続の問題
+
+**問題:** 9Routerに接続できない
+```bash
+# 9Routerが動作中か確認
+curl http://localhost:20128/health
+
+# 期待されるレスポンス:
+{"status": "ok"}
+```
+
+**解決策:**
+- 9Routerが動作中か確認
+- ポート20128がブロックされていないか確認
+- 正しいbase URLを確認 (`/v1`を含む)
+
+### 認証エラー
+
+**問題:** 401 Unauthorized
+```
+Error: Invalid API key
+```
+
+**解決策:**
+- ダッシュボードからのAPIキーを確認
+- AuthorizationヘッダーフォーマットがBearer your-api-keyであることを確認
+- APIキーに余分なスペースや改行がないことを確認
+
+### モデルが見つからない
+
+**問題:** 404 Model not found
+```
+Error: Model 'cc/claude-opus' not found
+```
+
+**解決策:**
+- 正確なモデル名を使用 (大文字小文字を区別)
+- 利用可能なモデルを確認: `curl http://localhost:20128/v1/models`
+- プランでモデルが有効になっていることを確認
+
+### タイムアウトの問題
+
+**問題:** リクエストタイムアウト
+```
+Error: Request timed out after 30s
+```
+
+**解決策:**
+- クライアント設定でタイムアウトを増やす
+- 時間制約のあるタスクには高速モデルを使用
+- 9Routerへのネットワーク接続を確認
+
+### レート制限
+
+**問題:** 429 Too Many Requests
+```
+Error: Rate limit exceeded
+```
+
+**解決策:**
+- 指数バックオフを実装
+- リクエスト頻度を減らす
+- ダッシュボードでレート制限を確認
+- プランのアップグレードを検討
+
+## ベストプラクティス
+
+### セキュリティ
+- APIキーを環境変数に保存
+- APIキーをバージョン管理にコミットしない
+- クラウドデプロイにはHTTPSを使用
+- APIキーを定期的にローテーション
+
+### パフォーマンス
+- タスクの複雑さに応じて適切なモデルを使用
+- 繰り返しクエリにキャッシュを実装
+- 長い応答にはストリーミングを使用
+- 可能な場合はリクエストをバッチ処理
+
+### エラーハンドリング
+- 常にtry-catchブロックを実装
+- 指数バックオフでリトライロジックを追加
+- デバッグのためエラーをログ
+- フォールバックメカニズムを提供
+
+### コスト最適化
+- シンプルなタスクには費用対効果の高いモデルを選択
+- 適切な場合は応答をキャッシュ
+- ダッシュボードで使用量をモニター
+- コードでリクエスト制限を設定
+
+## 次のステップ
+
+- [Cursorを設定](cursor.md) IDE統合用
+- [Continueをセットアップ](continue.md) VSCode用
+- [CLI使用法を確認](../cli/basic-usage.md)
+- [モデル選択について学ぶ](../models/overview.md)
+- [APIリファレンス](../api/reference.md)
diff --git a/gitbook/content/ja/integration/roo.md b/gitbook/content/ja/integration/roo.md
new file mode 100644
index 0000000..0d5ca6e
--- /dev/null
+++ b/gitbook/content/ja/integration/roo.md
@@ -0,0 +1,127 @@
+# Roo AIアシスタント統合
+
+9RouterをRoo AIアシスタントと統合し、統一インターフェイスから複数のAIモデルにアクセスします。
+
+## 前提条件
+
+- Roo AIアシスタントがインストール済み
+- [ダッシュボード](https://9router.com/dashboard)からの9Router APIキー
+- 9Routerが動作中 (ローカルまたはクラウド)
+
+## 設定手順
+
+### 1. Roo設定を開く
+
+Roo AIアシスタントを起動し、設定パネルを開きます。
+
+### 2. APIプロバイダーを設定
+
+1. **API Provider** 設定へ移動
+2. プロバイダータイプとして **Ollama** を選択
+3. 以下の設定を行う:
+
+**ローカル9Router用:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+```
+
+**クラウド9Router用:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+```
+
+### 3. モデルを選択
+
+利用可能な9Routerモデルから選択:
+
+**Claudeモデル:**
+- `cc/claude-opus-4-5-20251101` - 最も高性能
+- `cc/claude-sonnet-4-20250514` - バランス
+- `cc/claude-haiku-4-20250514` - 高速
+
+**DeepSeekモデル:**
+- `cx/deepseek-chat` - 汎用
+- `cx/deepseek-reasoner` - 複雑な推論
+
+**GLMモデル:**
+- `glm/glm-4-plus` - 高度
+- `glm/glm-4-flash` - 高速応答
+
+### 4. 接続をテスト
+
+統合を確認するためにテストメッセージを送信:
+
+```
+Hello! Can you confirm you're connected through 9Router?
+```
+
+## 使用例
+
+### 基本チャット
+```
+Rooに質問: "Explain quantum computing in simple terms"
+Model: cc/claude-sonnet-4-20250514
+```
+
+### コード生成
+```
+Rooに質問: "Write a Python function to calculate Fibonacci numbers"
+Model: cx/deepseek-chat
+```
+
+### 複雑な推論
+```
+Rooに質問: "Analyze the trade-offs between microservices and monolithic architecture"
+Model: cx/deepseek-reasoner
+```
+
+## モデル選択のヒント
+
+- **クイックタスク**: `cc/claude-haiku-4-20250514` または `glm/glm-4-flash` を使用
+- **バランスのとれたパフォーマンス**: `cc/claude-sonnet-4-20250514` または `cx/deepseek-chat` を使用
+- **複雑な推論**: `cc/claude-opus-4-5-20251101` または `cx/deepseek-reasoner` を使用
+- **コスト最適化**: DeepSeekまたはGLMモデルを使用
+
+## トラブルシューティング
+
+### 接続失敗
+- 9Routerが動作中か確認: `curl http://localhost:20128/health`
+- APIキーが正しいか確認
+- Base URLに `/v1` サフィックスが含まれていることを確認
+
+### モデルが利用不可
+- モデル名が正確に一致するか確認 (大文字小文字を区別)
+- 9Routerプランでモデルが有効か確認
+- リストから別のモデルを試す
+
+### 応答が遅い
+- より高速なモデルへ切替 (haiku、flash)
+- ネットワーク接続を確認
+- 問題について9Routerログをモニター
+
+## 高度な設定
+
+### カスタムモデルエイリアス
+
+Roo設定で頻繁に使うモデルのショートカットを作成:
+
+```
+エイリアス: "fast" → cc/claude-haiku-4-20250514
+エイリアス: "smart" → cc/claude-opus-4-5-20251101
+エイリアス: "code" → cx/deepseek-chat
+```
+
+### 複数のプロファイル
+
+異なるユースケース用の異なるプロファイルをセットアップ:
+- **開発**: コード用のDeepSeekモデル
+- **執筆**: コンテンツ用のClaudeモデル
+- **リサーチ**: 分析用のReasonerモデル
+
+## 次のステップ
+
+- [Cursorを設定](cursor.md) IDE統合用
+- [Continueをセットアップ](continue.md) VSCode用
+- [CLI使用法を確認](../cli/basic-usage.md)
diff --git a/gitbook/content/ja/providers/cheap.md b/gitbook/content/ja/providers/cheap.md
new file mode 100644
index 0000000..27c92de
--- /dev/null
+++ b/gitbook/content/ja/providers/cheap.md
@@ -0,0 +1,462 @@
+# 低価格プロバイダー - 超低価格バックアップ
+
+サブスクリプションクォータが切れたら、ドルではなくセント単位で支払い。ChatGPT APIより約90%安い!
+
+---
+
+## 概要
+
+低価格階層プロバイダーは、サブスクリプションクォータが消費された時の**バックアップ**:
+
+- 💰 **GLM-4.7** - 100万トークンあたり$0.6/$2.2 (日次リセット)
+- 💰 **MiniMax M2.1** - 100万トークンあたり$0.2/$1.0 (5時間リセット)
+- 💰 **Kimi K2** - 月$9固定 (1000万トークン)
+
+**戦略:** サブスクリプションクォータ切れ後、無料階層前に使用。ChatGPT API (100万あたり$20) に対して大幅なコスト削減。
+
+---
+
+## GLM-4.7 (日次リセット)
+
+### 料金
+
+| 階層 | 入力 | 出力 | リセット |
+|------|-------|--------|-------|
+| Standard | $0.60/1M | $2.20/1M | 毎日午前10時 |
+| Coding Plan | $0.60/1M | $2.20/1M | 毎日午前10時 (3×クォータ) |
+
+**コスト例 (1000万トークン):**
+- 入力: 1000万 × $0.60 = $6
+- 出力: 1000万 × $2.20 = $22
+- **合計: $6〜22** vs ChatGPT APIの$200!
+
+### セットアップ
+
+**ステップ1: サインアップ**
+
+1. [Zhipu AI](https://open.bigmodel.cn/) を訪問
+2. アカウント作成 (電話認証)
+3. 同じ価格で3×クォータの **Coding Plan** を選択
+
+**ステップ2: APIキーを取得**
+
+```bash
+Dashboard → API Keys → Create New
+→ APIキーをコピー ("zhipu-"で始まる)
+```
+
+**ステップ3: 9Routerに追加**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: glm
+API Key: zhipu-your-api-key-here
+```
+
+**ステップ4: CLIで使用**
+
+```
+Model: glm/glm-4.7
+ glm/glm-4.6v (vision)
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | コンテキスト | 最適用途 |
+|----------|-------------|---------|----------|
+| `glm/glm-4.7` | GLM 4.7 | 128K | コーディング、汎用タスク |
+| `glm/glm-4.6v` | GLM 4.6V Vision | 128K | 画像分析 |
+
+### プロのヒント
+
+- **Coding Plan** - 同じ価格で3×クォータ ($0.6/$2.2)
+- **日次リセット** - 北京時間午前10時に新鮮なクォータ
+- **コーディングに最適** - コード生成用に最適化
+- **128Kコンテキスト** - 大きなファイルを処理
+
+### クォータリセット
+
+```
+日次リセット: 北京時間午前10時 (UTC+8)
+→ UTC午前2時
+→ PST午後6時 (前日)
+→ EST午後9時 (前日)
+
+リセット時間に合わせて重いタスクを計画!
+```
+
+---
+
+## MiniMax M2.1 (5時間リセット)
+
+### 料金
+
+| 階層 | 入力 | 出力 | リセット |
+|------|-------|--------|-------|
+| Standard | $0.20/1M | $1.00/1M | 5時間ローリング |
+
+**コスト例 (1000万トークン):**
+- 入力: 1000万 × $0.20 = $2
+- 出力: 1000万 × $1.00 = $10
+- **合計: $2〜10** - 最安オプション!
+
+### セットアップ
+
+**ステップ1: サインアップ**
+
+1. [MiniMax](https://www.minimax.io/) を訪問
+2. アカウント作成
+3. メール/電話を認証
+
+**ステップ2: APIキーを取得**
+
+```bash
+Dashboard → API Management → Create Key
+→ APIキーをコピー
+```
+
+**ステップ3: 9Routerに追加**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: minimax
+API Key: your-minimax-api-key
+```
+
+**ステップ4: CLIで使用**
+
+```
+Model: minimax/MiniMax-M2.1
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | コンテキスト | 最適用途 |
+|----------|-------------|---------|----------|
+| `minimax/MiniMax-M2.1` | MiniMax M2.1 | 1Mトークン | 長いコンテキスト、コーディング |
+
+### プロのヒント
+
+- **最安オプション** - 入力100万あたり$0.20 (ChatGPTより90%安い)
+- **5時間ローリング** - 5時間ごとにクォータリセット
+- **1Mコンテキスト** - 巨大なコンテキストウィンドウ
+- **長いファイルに最適** - コードベース全体を処理
+
+### クォータリセット
+
+```
+5時間ローリングウィンドウ:
+→ クォータ使用 → 5時間待つ → 新鮮なクォータ
+
+例:
+午前10時 - 500万トークン使用
+午後3時 - 新鮮なクォータ利用可
+午後8時 - 新鮮なクォータ利用可
+
+最小コストで24時間コーディング!
+```
+
+---
+
+## Kimi K2 (月$9固定)
+
+### 料金
+
+| プラン | 月額コスト | 含まれるトークン | 実効コスト |
+|------|--------------|-----------------|----------------|
+| Subscription | $9 | 1000万トークン | 100万あたり$0.90 |
+
+**コスト例:**
+- 月$9固定
+- 1000万トークン含む
+- **実効: 100万あたり$0.90** - 一貫した使用に最適の価値!
+
+### セットアップ
+
+**ステップ1: 購読**
+
+1. [Moonshot AI](https://platform.moonshot.ai/) を訪問
+2. アカウント作成
+3. 月$9プランに購読
+
+**ステップ2: APIキーを取得**
+
+```bash
+Dashboard → API Keys → Create New
+→ APIキーをコピー
+```
+
+**ステップ3: 9Routerに追加**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: kimi
+API Key: your-kimi-api-key
+```
+
+**ステップ4: CLIで使用**
+
+```
+Model: kimi/kimi-latest
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | コンテキスト | 最適用途 |
+|----------|-------------|---------|----------|
+| `kimi/kimi-latest` | Kimi Latest | 200K | 汎用コーディング |
+
+### プロのヒント
+
+- **固定コスト** - 使用量に関わらず月$9 (1000万まで)
+- **一貫した使用に最適** - 月1000万使用なら100万あたりわずか$0.90
+- **月次リセット** - 1000万トークンが月次リセット
+- **予測可能な請求** - 予期しないコストなし
+
+### クォータリセット
+
+```
+月次リセット: 各月1日
+→ 1000万トークンが更新
+
+月次使用例:
+週1: 300万トークン
+週2: 200万トークン
+週3: 300万トークン
+週4: 200万トークン
+合計: 1000万トークン = $9固定
+```
+
+---
+
+## 料金比較
+
+| プロバイダー | 入力/1M | 出力/1M | リセット | 1000万コスト | 最適用途 |
+|----------|----------|-----------|-------|----------|----------|
+| **GLM-4.7** | $0.60 | $2.20 | 毎日午前10時 | $6〜22 | 日次クォータユーザー |
+| **MiniMax M2.1** | $0.20 | $1.00 | 5時間 | $2〜10 | **最安!** |
+| **Kimi K2** | $0.90 | $0.90 | 月次 | **$9固定** | 一貫した使用 |
+| ChatGPT API | $20.00 | $20.00 | なし | $200 | ❌ 高価 |
+
+**節約:** ChatGPT APIより90〜95%安い!
+
+---
+
+## 使用例
+
+### Cursor IDEセットアップ
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [9routerダッシュボードから取得]
+ Model: glm/glm-4.7
+```
+
+### コンボを作成 (推奨)
+
+```
+Dashboard → Combos → Create New
+
+Name: cheap-backup
+Models:
+ 1. cc/claude-opus-4-5 (サブスクリプション優先)
+ 2. glm/glm-4.7 (低価格バックアップ、日次リセット)
+ 3. minimax/MiniMax-M2.1 (最安フォールバック)
+ 4. if/kimi-k2-thinking (無料緊急時)
+
+CLIで使用: cheap-backup
+```
+
+**結果:** サブスクリプション → 低価格 → 最安 → 無料
+
+---
+
+## コスト最適化
+
+### 戦略1: 日次リセットルーチン
+
+```
+朝 (午前10時): 新鮮なGLMクォータ
+→ 重いタスクにGLMを使用
+→ サブスクリプションクォータを節約
+
+午後: サブスクリプションクォータ
+→ 複雑なタスクにClaude/Codexを使用
+
+夕方: MiniMax (5時間リセット)
+→ 遅い作業の低価格フォールバック
+
+夜: 無料階層 (iFlow)
+→ ゼロコスト緊急バックアップ
+```
+
+### 戦略2: 予算優先
+
+```
+月次予算設定: $20
+
+割り当て:
+- $9 Kimi K2 (1000万トークン固定)
+- $6 GLM日次クォータ (1000万トークン)
+- $5 MiniMaxオーバーフロー (2500万トークン)
+
+合計: $20で4500万トークン
+vs ChatGPT APIでは$20で100万トークン!
+```
+
+### 戦略3: サブスクリプションを最初に最大化
+
+```
+優先順位:
+1. Gemini CLI (月18万無料)
+2. Claude Code (すでに支払っているサブスクリプション)
+3. GLM-4.7 (低価格バックアップ、100万あたり$0.6)
+4. MiniMax M2.1 (最安、100万あたり$0.2)
+5. iFlow (無料緊急時)
+
+月次コスト例 (1億トークン):
+- Gemini CLI経由で6000万: $0 (無料)
+- Claude Code経由で3000万: $0 (サブスクリプション)
+- GLM経由で800万: $4.80
+- MiniMax経由で200万: $0.40
+合計: 月$5.20!
+```
+
+---
+
+## 実例
+
+### 例1: 重いコーディング月 (1億トークン)
+
+```
+内訳:
+- サブスクリプション (Claude/Codex) 経由で6000万: $0追加
+- GLM-4.7経由で3000万: $18
+- MiniMax M2.1経由で1000万: $2
+
+合計: 月$20
+vs ChatGPT APIの$2000!
+
+節約: 99%安い!
+```
+
+### 例2: バジェットコーダー ($10/月)
+
+```
+戦略:
+- $9 Kimi K2 (1000万トークン)
+- $1 MiniMaxオーバーフロー (500万トークン)
+
+合計: $10で1500万トークン
+vs ChatGPT APIでは$10で50万トークン!
+
+30倍多くのトークン!
+```
+
+### 例3: フリーランサー (変動使用量)
+
+```
+軽い月 (2000万トークン):
+- サブスクリプション経由で1500万: $0
+- GLM経由で500万: $3
+合計: $3
+
+重い月 (1.5億トークン):
+- サブスクリプション経由で6000万: $0
+- GLM経由で6000万: $36
+- MiniMax経由で3000万: $6
+合計: $42
+
+平均: 月$22.50
+vs ChatGPT APIの$3400!
+```
+
+---
+
+## ベストプラクティス
+
+### 1. 日次クォータを追跡
+
+```
+ダッシュボード表示:
+- GLMクォータ: 75%使用 (6時間後リセット)
+- MiniMaxクォータ: 50%使用 (2時間後リセット)
+- Kimiクォータ: 800万/1000万使用 (15日後リセット)
+
+リセット時間に合わせて重いタスクを計画!
+```
+
+### 2. Coding Planを使用 (GLM)
+
+```
+Standard: 1×クォータ
+Coding Plan: 3×クォータ (同じ価格!)
+
+→ 常にCoding Planを選択
+```
+
+### 3. 無料階層と組み合わせる
+
+```
+コンボ:
+1. gc/gemini-3-flash (無料プライマリ)
+2. glm/glm-4.7 (低価格バックアップ)
+3. minimax/MiniMax-M2.1 (最安)
+4. if/kimi-k2-thinking (無料緊急時)
+
+結果: コストを最小化、アップタイムを最大化
+```
+
+### 4. 予算アラートを設定
+
+```
+Dashboard → Settings → Budget Alerts
+
+日次: $2上限
+週次: $10上限
+月次: $30上限
+
+→ 上限到達時に自動的に無料階層へ切替
+```
+
+---
+
+## トラブルシューティング
+
+### 「クォータ消費」
+
+**解決策:**
+- GLM: 北京時間午前10時まで待つ
+- MiniMax: 最初の使用から5時間待つ
+- Kimi: 翌月1日まで待つ
+- 無料階層へのコンボフォールバックを使用
+
+### 「APIキー無効」
+
+**解決策:**
+- APIキーが正しくコピーされたか確認
+- アカウントにクレジットがあるか確認
+- 必要に応じてAPIキーを再生成
+
+### 「高コスト」
+
+**解決策:**
+- ダッシュボードで使用統計を確認
+- 予算アラートを設定
+- MiniMax (100万あたり$0.2最安) へ切替
+- クリティカルでないタスクに無料階層を使用
+
+---
+
+## 次のステップ
+
+- **無料フォールバックを追加:** [無料プロバイダー](./free.md)
+- **サブスクリプションをセットアップ:** [サブスクリプションプロバイダー](./subscription.md)
+- **コンボを作成:** Dashboard → Combos → Create New
diff --git a/gitbook/content/ja/providers/free.md b/gitbook/content/ja/providers/free.md
new file mode 100644
index 0000000..807858b
--- /dev/null
+++ b/gitbook/content/ja/providers/free.md
@@ -0,0 +1,442 @@
+# 無料プロバイダー - ゼロコストフォールバック
+
+他のすべてがクォータ制限に達した時の緊急バックアップ。ゼロコストで24時間コーディング!
+
+---
+
+## 概要
+
+無料階層プロバイダーは、サブスクリプションと低価格クォータが消費された時の**フォールバック**:
+
+- 🆓 **iFlow** - 8モデル無料 (Kimi K2、Qwen3、GLM 4.7、MiniMax M2...)
+- 🆓 **Qwen** - 3モデル無料 (Qwen3 Coder Plus/Flash、Vision)
+- 🆓 **Kiro** - 2モデル無料 (Claude Sonnet 4.5、Haiku 4.5)
+
+**戦略:** 緊急バックアップとして使用。無制限利用、永久ゼロコスト!
+
+---
+
+## iFlow (8つの無料モデル)
+
+### 料金
+
+| プラン | 月額コスト | モデル | クォータ |
+|------|--------------|--------|-------|
+| FREE | $0 | 8モデル | 無制限 |
+
+**最高の価値:** 無料階層で最も多くのモデル! Kimi K2、Qwen3、GLM、MiniMax、DeepSeek。
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard → Providers → Connect iFlow
+```
+
+**ステップ2: iFlow OAuthログイン**
+
+- 「Connect iFlow」をクリック
+- ブラウザが開く → iFlowログインページ
+- アカウント作成またはログイン
+- 権限を付与
+- 自動トークン更新有効化
+
+**ステップ3: CLIで使用**
+
+```
+Model: if/kimi-k2-thinking
+ if/kimi-k2
+ if/qwen3-coder-plus
+ if/glm-4.7
+ if/minimax-m2
+ if/deepseek-r1
+ if/deepseek-v3.2-chat
+ if/deepseek-v3.2-reasoner
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `if/kimi-k2-thinking` | Kimi K2 Thinking | 複雑な推論 |
+| `if/kimi-k2` | Kimi K2 | 汎用コーディング |
+| `if/qwen3-coder-plus` | Qwen3 Coder Plus | コード生成 |
+| `if/glm-4.7` | GLM 4.7 | 中国語 + 英語 |
+| `if/minimax-m2` | MiniMax M2 | 長いコンテキスト |
+| `if/deepseek-r1` | DeepSeek R1 | 推論タスク |
+| `if/deepseek-v3.2-chat` | DeepSeek V3.2 Chat | 会話 |
+| `if/deepseek-v3.2-reasoner` | DeepSeek V3.2 Reasoner | 複雑なロジック |
+
+### プロのヒント
+
+- **8モデル無料** - 無料階層で最多種類
+- **無制限利用** - クォータ制限なし
+- **Kimi K2 Thinking** - 複雑な推論に最適
+- **DeepSeek R1** - 強力な推論能力
+
+---
+
+## Qwen (3つの無料モデル)
+
+### 料金
+
+| プラン | 月額コスト | モデル | クォータ |
+|------|--------------|--------|-------|
+| FREE | $0 | 3モデル | 無制限 |
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard → Providers → Connect Qwen
+```
+
+**ステップ2: デバイスコード認可**
+
+- 「Connect Qwen」をクリック
+- ダッシュボードがデバイスコードを表示
+- 認可URLを訪問
+- デバイスコードを入力
+- Qwenアカウントにログイン
+- 自動トークン更新有効化
+
+**ステップ3: CLIで使用**
+
+```
+Model: qw/qwen3-coder-plus
+ qw/qwen3-coder-flash
+ qw/vision-model
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `qw/qwen3-coder-plus` | Qwen3 Coder Plus | 高度なコーディング |
+| `qw/qwen3-coder-flash` | Qwen3 Coder Flash | 高速応答 |
+| `qw/vision-model` | Qwen3 Vision | 画像分析 |
+
+### プロのヒント
+
+- **Qwen3 Coder Plus** - 強力なコーディング能力
+- **Qwen3 Coder Flash** - クイックタスク用に高速
+- **Visionモデル** - 無料画像分析
+- **無制限利用** - クォータ制限なし
+
+---
+
+## Kiro (Claude無料)
+
+### 料金
+
+| プラン | 月額コスト | モデル | クォータ |
+|------|--------------|--------|-------|
+| FREE | $0 | Claude Sonnet 4.5、Haiku 4.5 | 無制限 |
+
+**最高の価値:** 無料Claude! 有料Claude Codeと同じ品質。
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard → Providers → Connect Kiro
+```
+
+**ステップ2: AWS Builder IDまたはOAuth**
+
+- 「Connect Kiro」をクリック
+- ログイン方法を選択:
+ - AWS Builder ID (推奨)
+ - Googleアカウント
+ - GitHubアカウント
+- 権限を付与
+- 自動トークン更新有効化
+
+**ステップ3: CLIで使用**
+
+```
+Model: kr/claude-sonnet-4.5
+ kr/claude-haiku-4.5
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `kr/claude-sonnet-4.5` | Claude Sonnet 4.5 | バランスのとれた品質/速度 |
+| `kr/claude-haiku-4.5` | Claude Haiku 4.5 | 高速応答 |
+
+### プロのヒント
+
+- **無料Claude** - 有料階層と同じ品質
+- **AWS Builder ID** - AWSアカウントで簡単セットアップ
+- **無制限利用** - クォータ制限なし
+- **最高品質** - Claude 4.5を無料で!
+
+---
+
+## 機能比較
+
+| プロバイダー | モデル | 最高のモデル | セットアップ | クォータ |
+|----------|--------|------------|-------|-------|
+| **iFlow** | 8 | Kimi K2 Thinking | OAuth | 無制限 |
+| **Qwen** | 3 | Qwen3 Coder Plus | デバイスコード | 無制限 |
+| **Kiro** | 2 | Claude Sonnet 4.5 | AWS Builder ID | 無制限 |
+
+**勝者:** 種類はiFlow、品質はKiro!
+
+---
+
+## 使用例
+
+### Cursor IDEセットアップ
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [9routerダッシュボードから取得]
+ Model: if/kimi-k2-thinking
+```
+
+### コンボを作成 (推奨)
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking (iFlowプライマリ)
+ 2. qw/qwen3-coder-plus (Qwenバックアップ)
+ 3. kr/claude-sonnet-4.5 (Kiro品質)
+
+CLIで使用: free-combo
+```
+
+**結果:** ゼロコスト、最大アップタイム!
+
+---
+
+## 完全なフォールバック戦略
+
+### 完全な3階層コンボ
+
+```
+Dashboard → Combos → Create New
+
+Name: complete-fallback
+Models:
+ 1. gc/gemini-3-flash-preview (無料サブスクリプション)
+ 2. cc/claude-opus-4-5 (有料サブスクリプション)
+ 3. glm/glm-4.7 (低価格バックアップ、100万あたり$0.6)
+ 4. minimax/MiniMax-M2.1 (最安、100万あたり$0.2)
+ 5. if/kimi-k2-thinking (無料フォールバック)
+ 6. kr/claude-sonnet-4.5 (無料品質)
+
+CLIで使用: complete-fallback
+```
+
+**結果:**
+- Tier 1: 無料サブスクリプション (Gemini CLI)
+- Tier 2: 有料サブスクリプション (Claude Code)
+- Tier 3: 低価格バックアップ (GLM、MiniMax)
+- Tier 4: 無料フォールバック (iFlow、Kiro)
+
+**コーディングが止まらない!**
+
+---
+
+## ベストプラクティス
+
+### 1. 緊急バックアップとして使用
+
+```
+優先順位:
+1. サブスクリプション階層 (有料クォータを最大化)
+2. 低価格階層 (100万トークンあたりセント)
+3. 無料階層 (無制限、ゼロコスト)
+
+以下の時のみ無料階層を使用:
+- サブスクリプションクォータ消費
+- 予算上限到達
+- テスト/クリティカルでないタスク
+```
+
+### 2. 適切なモデルを選択
+
+```
+複雑な推論: if/kimi-k2-thinking
+高速コーディング: qw/qwen3-coder-flash
+最高品質: kr/claude-sonnet-4.5
+長いコンテキスト: if/minimax-m2
+Visionタスク: qw/vision-model
+```
+
+### 3. 無料のみのコンボを作成
+
+```
+ゼロコストコーディング用:
+
+Name: zero-cost
+Models:
+ 1. kr/claude-sonnet-4.5 (最高品質)
+ 2. if/kimi-k2-thinking (複雑なタスク)
+ 3. qw/qwen3-coder-plus (高速コーディング)
+
+コスト: 永久に$0!
+```
+
+### 4. 本番前にテスト
+
+```
+無料階層を使用して:
+- プロンプトをテスト
+- 機能のプロトタイプを作成
+- 新しいフレームワークを学ぶ
+- クリティカルでないタスク
+
+有料クォータを以下に節約:
+- 本番コード
+- 複雑なリファクタリング
+- クリティカルな機能
+```
+
+---
+
+## 実例
+
+### 例1: 学生/学習者 (ゼロ予算)
+
+```
+セットアップ:
+1. kr/claude-sonnet-4.5 (最高品質)
+2. if/kimi-k2-thinking (複雑な推論)
+3. qw/qwen3-coder-plus (高速コーディング)
+
+月次コスト: $0
+利用: 無制限
+
+最適:
+- コーディング学習
+- 個人プロジェクト
+- 宿題/課題
+```
+
+### 例2: フリーランサー (予算意識)
+
+```
+セットアップ:
+1. gc/gemini-3-flash-preview (月18万無料)
+2. glm/glm-4.7 (低価格バックアップ、100万あたり$0.6)
+3. if/kimi-k2-thinking (無料フォールバック)
+
+月次コスト: $5〜10
+利用: 1億以上のトークン
+
+最適:
+- クライアントプロジェクト (有料階層)
+- テスト (無料階層)
+- 緊急バックアップ
+```
+
+### 例3: ヘビーユーザー (すべてを最大化)
+
+```
+セットアップ:
+1. gc/gemini-3-flash-preview (月18万無料)
+2. cc/claude-opus-4-5 (サブスクリプション$20〜100)
+3. cx/gpt-5.2-codex (サブスクリプション$20〜200)
+4. glm/glm-4.7 (低価格 100万あたり$0.6)
+5. minimax/MiniMax-M2.1 (最安 100万あたり$0.2)
+6. if/kimi-k2-thinking (無料無制限)
+7. kr/claude-sonnet-4.5 (無料品質)
+
+月次コスト: $40〜320 (サブスクリプション) + $10〜20 (低価格階層)
+利用: 5億以上のトークン
+
+最適:
+- プロフェッショナル開発
+- チームプロジェクト
+- 24時間コーディング
+```
+
+---
+
+## コスト比較
+
+### シナリオ: 月1億トークン
+
+**オプション1: ChatGPT APIのみ**
+```
+1億 × $20/1M = 月$2,000
+```
+
+**オプション2: 9Router無料階層のみ**
+```
+無料階層経由で1億 = 月$0
+節約: 月$2,000 (100%)
+```
+
+**オプション3: 9Router完全戦略**
+```
+Gemini CLI経由で6000万 (無料): $0
+Claude Code経由で3000万 (サブスクリプション): $0追加
+GLM経由で800万 (低価格): $4.80
+iFlow経由で200万 (無料): $0
+合計: 月$4.80 + すでに持っているサブスクリプション
+節約: 月$1,995 (99.76%)
+```
+
+---
+
+## トラブルシューティング
+
+### "OAuth failed"
+
+**解決策:**
+- インターネット接続を確認
+- 別のブラウザを試す
+- ブラウザキャッシュをクリア
+- ダッシュボードで再接続
+
+### "モデルが利用不可"
+
+**解決策:**
+- ダッシュボードでプロバイダーが接続されているか確認
+- OAuthトークンが有効か確認
+- 必要に応じてプロバイダーを再接続
+
+### "応答が遅い"
+
+**解決策:**
+- 無料階層は優先度が低い可能性
+- ピーク外時間に使用
+- 別の無料プロバイダーへ切替
+- 速度のため低価格階層へアップグレード
+
+---
+
+## 制限事項
+
+### 無料階層の考慮事項
+
+- **速度** - 有料階層より遅い可能性
+- **優先度** - ピーク時間中は優先度が低い
+- **レート制限** - レート制限の可能性 (ただしクォータは無制限)
+- **可用性** - 時折ダウンタイムがある可能性
+
+**解決策:** 信頼性のため3階層フォールバック戦略を使用!
+
+---
+
+## 次のステップ
+
+- **サブスクリプションをセットアップ:** [サブスクリプションプロバイダー](./subscription.md)
+- **低価格バックアップを追加:** [低価格プロバイダー](./cheap.md)
+- **コンボを作成:** Dashboard → Combos → Create New
+- **コーディング開始:** 最大の信頼性のため `complete-fallback` コンボを使用
diff --git a/gitbook/content/ja/providers/subscription.md b/gitbook/content/ja/providers/subscription.md
new file mode 100644
index 0000000..49ecf36
--- /dev/null
+++ b/gitbook/content/ja/providers/subscription.md
@@ -0,0 +1,404 @@
+# サブスクリプションプロバイダー - 価値を最大化
+
+スマートクォータトラッキングと自動フォールバックで既存のAIサブスクリプションを最大化。リセット前にサブスクリプションを余すことなく使用しましょう!
+
+---
+
+## 概要
+
+サブスクリプション階層プロバイダーは**プライマリ**選択です - すでに支払っているので、完全な価値を引き出しましょう:
+
+- ✅ **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- ✅ **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex、GPT 5.1 Codex Max
+- ✅ **Gemini CLI** (無料階層!) - 月18万コンプリーション
+- ✅ **GitHub Copilot** - GPT-5、Claude 4.5、Gemini 3
+- ✅ **Antigravity** (Google) - Gemini 3 Pro、Claude Sonnet 4.5
+
+**戦略:** これらを最初に使用、クォータをリアルタイムで追跡、消費時に低価格/無料へフォールバック。
+
+---
+
+## Claude Code (Pro/Max)
+
+### 料金
+
+| プラン | 月額コスト | クォータリセット | モデル |
+|------|--------------|-------------|--------|
+| Pro | $20 | 5時間 + 週次 | Opus、Sonnet、Haiku |
+| Max | $100 | 5時間 + 週次 | Opus、Sonnet、Haiku |
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard開く → Providers → Connect Claude Code
+```
+
+**ステップ2: OAuthログイン**
+
+- 「Connect Claude Code」をクリック
+- ブラウザが開く → Claude.aiにログイン
+- 自動トークン更新有効化
+- クォータトラッキング開始
+
+**ステップ3: CLIで使用**
+
+```
+Model: cc/claude-opus-4-5-20251101
+ cc/claude-sonnet-4-5-20250929
+ cc/claude-haiku-4-5-20251001
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `cc/claude-opus-4-5-20251101` | Claude 4.5 Opus | 複雑なタスク、アーキテクチャ |
+| `cc/claude-sonnet-4-5-20250929` | Claude 4.5 Sonnet | バランスのとれた速度/品質 |
+| `cc/claude-haiku-4-5-20251001` | Claude 4.5 Haiku | 高速応答 |
+
+### プロのヒント
+
+- **複雑なタスクにOpusを使用** - アーキテクチャ決定、リファクタリング
+- **速度にSonnetを使用** - クイック編集、コード生成
+- **モデルごとのクォータを追跡** - ダッシュボードがモデルごとの使用量を表示
+- **5時間リセット** - 5時間ごとの新鮮なクォータ + 週次リセット
+
+---
+
+## OpenAI Codex (Plus/Pro)
+
+### 料金
+
+| プラン | 月額コスト | クォータリセット | モデル |
+|------|--------------|-------------|--------|
+| Plus | $20 | 5時間 + 週次 | GPT 5.2、GPT 5.1 |
+| Pro | $200 | 5時間 + 週次 | GPT 5.2 Codex、GPT 5.1 Max |
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard → Providers → Connect Codex
+```
+
+**ステップ2: OAuthログイン**
+
+- 「Connect Codex」をクリック
+- ブラウザが `http://localhost:1455` を開く
+- OpenAIアカウントにログイン
+- 自動トークン更新有効化
+
+**ステップ3: CLIで使用**
+
+```
+Model: cx/gpt-5.2-codex
+ cx/gpt-5.1-codex-max
+ cx/gpt-5.2
+ cx/gpt-5.1-codex
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `cx/gpt-5.2-codex` | GPT 5.2 Codex | 最新コーディングモデル |
+| `cx/gpt-5.1-codex-max` | GPT 5.1 Codex Max | 最大コンテキスト |
+| `cx/gpt-5.2` | GPT 5.2 | 汎用タスク |
+| `cx/gpt-5.1-codex` | GPT 5.1 Codex | 安定したコーディング |
+
+### プロのヒント
+
+- **5時間ローリングクォータ** - 5時間ごとに新鮮なクォータ
+- **週次リセット** - 週次フルクォータリセット
+- **Pro階層** - Plusの10倍のクォータ
+
+---
+
+## Gemini CLI (月18万無料!)
+
+### 料金
+
+| プラン | 月額コスト | クォータ | リセット |
+|------|--------------|-------|-------|
+| FREE | $0 | 月18万コンプリーション + 1K/日 | 日次 + 月次 |
+
+**最高の価値:** 巨大な無料階層! 有料階層の前にこれを使用。
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard → Providers → Connect Gemini CLI
+```
+
+**ステップ2: Google OAuth**
+
+- 「Connect Gemini CLI」をクリック
+- ブラウザが開く → Googleアカウントにログイン
+- 権限を付与
+- 自動トークン更新有効化
+
+**ステップ3: CLIで使用**
+
+```
+Model: gc/gemini-3-flash-preview
+ gc/gemini-3-pro-preview
+ gc/gemini-2.5-pro
+ gc/gemini-2.5-flash
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `gc/gemini-3-flash-preview` | Gemini 3 Flash Preview | 高速応答 |
+| `gc/gemini-3-pro-preview` | Gemini 3 Pro Preview | 複雑なタスク |
+| `gc/gemini-2.5-pro` | Gemini 2.5 Pro | 安定した本番 |
+| `gc/gemini-2.5-flash` | Gemini 2.5 Flash | クイックタスク |
+
+### プロのヒント
+
+- **月18万コンプリーション** - 巨大な無料階層
+- **1K/日制限** - 日次クォータは深夜にリセット
+- **最初に使用** - 無料階層、有料サブスクリプションの前に使用
+- **クレジットカード不要** - Googleアカウントで完全無料
+
+---
+
+## GitHub Copilot
+
+### 料金
+
+| プラン | 月額コスト | クォータリセット | モデル |
+|------|--------------|-------------|--------|
+| Individual | $10 | 月次 (1日) | GPT-5、Claude 4.5、Gemini 3 |
+| Business | $19 | 月次 (1日) | GPT-5、Claude 4.5、Gemini 3 |
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard → Providers → Connect GitHub
+```
+
+**ステップ2: GitHub経由のOAuth**
+
+- 「Connect GitHub」をクリック
+- ブラウザが開く → GitHubにログイン
+- GitHub Copilotを認可
+- 自動トークン更新有効化
+
+**ステップ3: CLIで使用**
+
+```
+Model: gh/gpt-5
+ gh/gpt-5.1-codex-max
+ gh/claude-4.5-sonnet
+ gh/gemini-3-pro
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `gh/gpt-5` | GPT-5 | 最新OpenAIモデル |
+| `gh/gpt-5.1-codex-max` | GPT-5.1 Codex Max | 最大コンテキスト |
+| `gh/claude-4.5-sonnet` | Claude 4.5 Sonnet | Anthropic品質 |
+| `gh/gemini-3-pro` | Gemini 3 Pro | Google品質 |
+
+### プロのヒント
+
+- **月次リセット** - 月1日にフルクォータリセット
+- **複数モデル** - 一つのサブスクリプションでGPT、Claude、Geminiにアクセス
+- **Business階層** - チーム用の高クォータ
+
+---
+
+## Antigravity (Googleアカウント)
+
+### 料金
+
+| プラン | 月額コスト | クォータ | モデル |
+|------|--------------|-------|--------|
+| FREE | $0 | Gemini CLIと同様 | Gemini 3 Pro、Claude Sonnet 4.5 |
+
+### セットアップ
+
+**ステップ1: ダッシュボード経由で接続**
+
+```bash
+9router
+# Dashboard → Providers → Connect Antigravity
+```
+
+**ステップ2: Google OAuth**
+
+- 「Connect Antigravity」をクリック
+- ブラウザが開く → Googleアカウントにログイン
+- 権限を付与
+- 自動トークン更新有効化
+
+**ステップ3: CLIで使用**
+
+```
+Model: ag/gemini-3-pro-high
+ ag/claude-sonnet-4-5
+ ag/claude-opus-4-5-thinking
+```
+
+### 利用可能なモデル
+
+| モデルID | 説明 | 最適用途 |
+|----------|-------------|----------|
+| `ag/gemini-3-pro-high` | Gemini 3 Pro High | 高品質応答 |
+| `ag/claude-sonnet-4-5` | Claude Sonnet 4.5 | Anthropic品質 |
+| `ag/claude-opus-4-5-thinking` | Claude Opus 4.5 Thinking | 複雑な推論 |
+
+### プロのヒント
+
+- **無料階層** - Googleアカウントでコストなし
+- **Claudeアクセス** - 無料Claude Sonnet/Opus
+- **Gemini CLIと同様のクォータ** - 日次/月次制限
+
+---
+
+## 料金比較
+
+| プロバイダー | 月額コスト | クォータリセット | 価値 |
+|----------|--------------|-------------|-------|
+| **Claude Code Pro** | $20 | 5時間 + 週次 | ⭐⭐⭐⭐⭐ 最高品質 |
+| **Claude Code Max** | $100 | 5時間 + 週次 | ⭐⭐⭐⭐⭐ 最高クォータ |
+| **Codex Plus** | $20 | 5時間 + 週次 | ⭐⭐⭐⭐ 良い価値 |
+| **Codex Pro** | $200 | 5時間 + 週次 | ⭐⭐⭐⭐⭐ 10×クォータ |
+| **Gemini CLI** | **$0** | 日次 + 月次 | ⭐⭐⭐⭐⭐ 月18万無料! |
+| **GitHub Copilot** | $10〜19 | 月次 (1日) | ⭐⭐⭐⭐ マルチモデル |
+| **Antigravity** | **$0** | 日次 + 月次 | ⭐⭐⭐⭐ 無料Claude! |
+
+---
+
+## 使用例
+
+### Cursor IDEセットアップ
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [9routerダッシュボードから取得]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### コンボを作成 (推奨)
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. gc/gemini-3-flash-preview (無料、最初に使用)
+ 2. cc/claude-opus-4-5-20251101 (サブスクリプション)
+ 3. cx/gpt-5.2-codex (サブスクリプションバックアップ)
+
+CLIで使用: premium-coding
+```
+
+**結果:** 無料階層を最大化 → サブスクリプションを使用 → 自動フォールバック
+
+---
+
+## クォータトラッキング
+
+9Routerはクォータをリアルタイムで追跡:
+
+- **トークン消費** - リクエストごとの入出力トークン
+- **リセットカウントダウン** - 次のクォータリセットまでの時間
+- **使用量パーセンテージ** - クォータの使用量
+- **自動フォールバック** - 消費時に次の階層へ切替
+
+**ダッシュボード表示:**
+
+```
+Claude Code Pro
+├─ Quota: 75% used
+├─ Reset: 2h 15m (5-hour)
+├─ Weekly reset: 3 days
+└─ Fallback: glm/glm-4.7 (cheap tier)
+```
+
+---
+
+## ベストプラクティス
+
+### 1. 無料階層を最初に使用
+
+```
+優先順位:
+1. Gemini CLI (月18万無料)
+2. Antigravity (無料Claude)
+3. Claude Code/Codex (有料サブスクリプション)
+```
+
+### 2. クォータを毎日追跡
+
+- 毎朝ダッシュボードを確認
+- クォータリセットに合わせて重いタスクを計画
+- クリティカルでないタスクには低価格/無料階層を使用
+
+### 3. スマートコンボを作成
+
+```
+コンボ例:
+1. gc/gemini-3-flash-preview (無料プライマリ)
+2. cc/claude-opus-4-5 (複雑なタスク)
+3. glm/glm-4.7 (低価格バックアップ)
+4. if/kimi-k2-thinking (無料フォールバック)
+```
+
+### 4. 時間別に最適化
+
+```
+朝: 新鮮な5時間クォータ (Claude/Codex)
+午後: Gemini CLI (1K/日)
+夕方: サブスクリプションクォータ
+夜: 低価格/無料階層
+```
+
+---
+
+## トラブルシューティング
+
+### 「クォータ消費」
+
+**解決策:**
+- ダッシュボードクォータトラッカーを確認
+- リセットを待つ (5時間または日次)
+- 低価格/無料階層へのコンボフォールバックを使用
+
+### 「OAuthトークン期限切れ」
+
+**解決策:**
+- 9Routerにより自動更新
+- 問題がある場合: Dashboard → Provider → Reconnect
+
+### 「レート制限」
+
+**解決策:**
+- サブスクリプションクォータ切れ
+- フォールバックを追加: `cc/claude-opus → glm/glm-4.7`
+- 無料階層を使用: `if/kimi-k2-thinking`
+
+---
+
+## 次のステップ
+
+- **低価格バックアップをセットアップ:** [低価格プロバイダー](./cheap.md)
+- **無料フォールバックを追加:** [無料プロバイダー](./free.md)
+- **コンボを作成:** Dashboard → Combos → Create New
diff --git a/gitbook/content/ja/troubleshooting.md b/gitbook/content/ja/troubleshooting.md
new file mode 100644
index 0000000..201fac2
--- /dev/null
+++ b/gitbook/content/ja/troubleshooting.md
@@ -0,0 +1,351 @@
+# トラブルシューティング
+
+9Router利用時の一般的な問題と解決策。
+
+---
+
+## "Language model did not provide messages"
+
+**問題:** リクエストが空のレスポンスまたはエラーメッセージで失敗。
+
+**原因:**
+- プロバイダーのクォータが消費された
+- APIキーが無効または期限切れ
+- モデルが利用不可
+
+**解決策:**
+
+1. **クォータ状況を確認:**
+ ```
+ Dashboard → Providers → クォータトラッカーを表示
+ ```
+ クォータが消費されている場合、リセットを待つかプロバイダーを切替。
+
+2. **コンボフォールバックを使用:**
+ ```
+ Dashboard → Combos → フォールバックチェーンを作成
+ 例: cc/claude-opus → glm/glm-4.7 → if/kimi-k2
+ ```
+
+3. **プロバイダー接続を確認:**
+ ```
+ Dashboard → Providers → 必要に応じて再接続
+ ```
+
+---
+
+## レート制限
+
+**問題:** 「Rate limit exceeded」または「Too many requests」エラー。
+
+**原因:**
+- サブスクリプションのクォータが枯渇(5時間/日次/週次の制限)
+- APIレート制限に達した
+- 同時リクエストが多すぎる
+
+**解決策:**
+
+1. **リセット時間を確認:**
+ ```
+ Dashboard → Quota Tracking → リセットカウントダウンを表示
+ ```
+
+2. **低価格階層へ切替:**
+ ```
+ 使用: glm/glm-4.7 (100万トークンあたり$0.6)
+ minimax/MiniMax-M2.1 (100万トークンあたり$0.20)
+ ```
+
+3. **フォールバックコンボを追加:**
+ ```
+ Dashboard → Combos → バックアップモデルを追加
+ 優先: cc/claude-opus (サブスクリプション)
+ バックアップ: glm/glm-4.7 (低価格)
+ 緊急時: if/kimi-k2 (無料)
+ ```
+
+---
+
+## OAuthトークン期限切れ
+
+**問題:** 「Unauthorized」または「Token expired」エラー。
+
+**原因:**
+- OAuthトークンが期限切れ(自動更新失敗)
+- プロバイダーセッションが無効化された
+- 更新中のネットワーク問題
+
+**解決策:**
+
+1. **自動更新(デフォルト):**
+ 9Routerは自動的にトークンを更新します。30秒待ってから再試行。
+
+2. **手動で再接続:**
+ ```
+ Dashboard → Providers → [プロバイダー名] → Reconnect
+ → OAuthフローを再度完了
+ ```
+
+3. **プロバイダーステータスを確認:**
+ プロバイダーサービスがオンラインであることを確認(Claude Code、Codexなど)
+
+---
+
+## 高コスト
+
+**問題:** 予期しない高使用量またはコスト。
+
+**原因:**
+- 不必要に高価なモデルを使用
+- 低価格階層へのフォールバックがない
+- 大きなコンテキストウィンドウ
+
+**解決策:**
+
+1. **使用統計を確認:**
+ ```
+ Dashboard → Usage Stats → トークン消費量を表示
+ → 高コストモデルを特定
+ ```
+
+2. **より安いモデルへ切替:**
+ ```
+ 置換: cc/claude-opus (月$20〜100サブスクリプション)
+ へ: glm/glm-4.7 (100万トークンあたり$0.6)
+ minimax/MiniMax-M2.1 (100万トークンあたり$0.20)
+ ```
+
+3. **無料階層を使用:**
+ ```
+ if/kimi-k2-thinking (無料)
+ qw/qwen3-coder-plus (無料)
+ kr/claude-sonnet-4.5 (無料)
+ gc/gemini-3-flash-preview (月18万無料)
+ ```
+
+4. **プロンプトを最適化:**
+ - コンテキストサイズを削減
+ - 長い応答にストリーミングを使用
+ - 一般的なプロンプトをキャッシュ
+
+---
+
+## Connection Refused
+
+**問題:** 「ECONNREFUSED」または「Cannot connect to localhost:20128」。
+
+**原因:**
+- 9Routerが起動していない
+- ポート20128がブロックされている
+- ファイアウォールが接続をブロック
+
+**解決策:**
+
+1. **9Routerを起動:**
+ ```bash
+ 9router
+ ```
+ ダッシュボードがhttp://localhost:3000で開くはず
+
+2. **ポート20128を確認:**
+ ```bash
+ # ポートがリッスンしているか確認
+ lsof -i :20128
+
+ # またはWindowsで
+ netstat -ano | findstr :20128
+ ```
+
+3. **ファイアウォールを確認:**
+ - macOS: システム設定 → ネットワーク → ファイアウォール
+ - Windows: Windows Defenderファイアウォール → アプリを許可
+ - Linux: `sudo ufw allow 20128`
+
+4. **クラウドエンドポイントを使用:**
+ localhostが動作しない場合(例: Cursor IDE):
+ ```
+ Endpoint: https://9router.com/v1
+ ```
+
+---
+
+## ダッシュボードが開かない
+
+**問題:** ダッシュボードがhttp://localhost:3000で読み込まれない。
+
+**原因:**
+- ポート3000がすでに使用中
+- 9Routerがクラッシュした
+- ブラウザキャッシュの問題
+
+**解決策:**
+
+1. **9Routerが実行中か確認:**
+ ```bash
+ # プロセスを確認
+ ps aux | grep 9router
+
+ # ポート3000を確認
+ lsof -i :3000
+ ```
+
+2. **競合するプロセスを終了:**
+ ```bash
+ # macOS/Linux
+ lsof -ti:3000 | xargs kill -9
+
+ # Windows
+ netstat -ano | findstr :3000
+ taskkill /PID /F
+ ```
+
+3. **9Routerを再起動:**
+ ```bash
+ # 停止
+ pkill -f 9router
+
+ # 起動
+ 9router
+ ```
+
+4. **ブラウザキャッシュをクリア:**
+ - Chrome: Ctrl+Shift+Delete → キャッシュをクリア
+ - シークレットモードを試す
+
+5. **ファイアウォール設定を確認:**
+ ポート3000がブロックされていないことを確認。
+
+---
+
+## モデルが見つからない
+
+**問題:** 「Model not found」または「Invalid model」エラー。
+
+**原因:**
+- プロバイダーが接続されていない
+- モデルIDのタイポ
+- プロバイダーが非アクティブ
+
+**解決策:**
+
+1. **プロバイダー接続を確認:**
+ ```
+ Dashboard → Providers → ステータスを確認(緑 = アクティブ)
+ ```
+
+2. **モデルID形式を確認:**
+ ```
+ 正しい: cc/claude-opus-4-5-20251101
+ 誤り: claude-opus-4-5-20251101
+
+ 形式: [provider-prefix]/[model-name]
+ ```
+
+3. **利用可能なモデルを一覧表示:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+ ```
+
+4. **プロバイダーを再接続:**
+ ```
+ Dashboard → Providers → [Provider] → Reconnect
+ ```
+
+---
+
+## 応答が遅い
+
+**問題:** リクエストに時間がかかりすぎる、またはタイムアウト。
+
+**原因:**
+- プロバイダーのレイテンシ
+- ネットワーク問題
+- 大きなコンテキスト/応答
+- プロバイダーのレート制限
+
+**解決策:**
+
+1. **プロバイダーステータスを確認:**
+ ```
+ Dashboard → Providers → レイテンシ統計を表示
+ ```
+
+2. **高速モデルへ切替:**
+ ```
+ 高速: cc/claude-haiku-4-5 (HaikuはOpusより高速)
+ gc/gemini-3-flash-preview
+ qw/qwen3-coder-flash
+ ```
+
+3. **ストリーミングを使用:**
+ ```json
+ {
+ "model": "cc/claude-opus-4-5",
+ "messages": [...],
+ "stream": true
+ }
+ ```
+
+4. **ネットワークを確認:**
+ ```bash
+ # レイテンシをテスト
+ ping api.anthropic.com
+ ping api.openai.com
+ ```
+
+5. **コンテキストサイズを削減:**
+ - メッセージ履歴をトリミング
+ - 短いプロンプトを使用
+ - CLIツールでコンテキストの剪定を有効化
+
+---
+
+## APIキー無効
+
+**問題:** 「Invalid API key」または「Authentication failed」エラー。
+
+**原因:**
+- 間違ったAPIキーをコピー
+- APIキーが期限切れ
+- APIキーが生成されていない
+
+**解決策:**
+
+1. **APIキーを再生成:**
+ ```
+ Dashboard → Settings → API Keys → Generate New Key
+ → 新しいキーをコピーして使用
+ ```
+
+2. **キー形式を確認:**
+ ```
+ 正しい: 9r_xxxxxxxxxxxxxxxxxxxxxxxx
+ 誤り: 9r_プレフィックスがない
+ ```
+
+3. **CLI設定でキーを確認:**
+ ```bash
+ # Cursor
+ Settings → Models → OpenAI API Key
+
+ # Cline
+ Settings → API Key
+
+ # 環境変数
+ export OPENAI_API_KEY="9r_your_key"
+ ```
+
+4. **APIキーをテスト:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer 9r_your_key"
+ ```
+
+---
+
+## さらにヘルプが必要?
+
+- **GitHub Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **ドキュメント:** [9router.com/docs](https://9router.com/docs)
+- **FAQ:** [faq.md](faq.md)
diff --git a/gitbook/content/vi/deployment/cloud.md b/gitbook/content/vi/deployment/cloud.md
new file mode 100644
index 0000000..06ba271
--- /dev/null
+++ b/gitbook/content/vi/deployment/cloud.md
@@ -0,0 +1,473 @@
+# ☁️ Triển khai Cloud
+
+Triển khai 9Router trên VPS hoặc Docker để truy cập từ xa và dùng trong production.
+
+---
+
+## 🖥️ Triển khai VPS
+
+### Yêu cầu
+
+- Ubuntu 20.04+ hoặc distro Linux tương tự
+- Node.js 20+
+- Git
+- Quyền root hoặc sudo
+
+### Bước 1: Clone Repository
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+```
+
+### Bước 2: Cài đặt Dependencies
+
+```bash
+npm install
+```
+
+### Bước 3: Build Application
+
+```bash
+npm run build
+```
+
+### Bước 4: Cấu hình biến môi trường
+
+Tạo file `.env` hoặc export biến:
+
+```bash
+export JWT_SECRET="your-secure-secret-change-this-to-random-string"
+export INITIAL_PASSWORD="your-secure-password"
+export DATA_DIR="/var/lib/9router"
+export NODE_ENV="production"
+```
+
+**Biến môi trường:**
+
+| Biến | Mặc định | Mô tả |
+|----------|---------|-------------|
+| `JWT_SECRET` | Auto-generated | **PHẢI đổi trong production!** Dùng để ký JWT token |
+| `INITIAL_PASSWORD` | `123456` | Mật khẩu đăng nhập Dashboard |
+| `DATA_DIR` | `~/.9router` | Đường dẫn lưu database và data |
+| `NODE_ENV` | `development` | Đặt `production` cho deployment |
+| `ENABLE_REQUEST_LOGS` | `false` | Bật debug request/response logs |
+
+### Bước 5: Tạo Data Directory
+
+```bash
+sudo mkdir -p /var/lib/9router
+sudo chown $USER:$USER /var/lib/9router
+```
+
+### Bước 6: Khởi động Application
+
+```bash
+npm run start
+```
+
+### Bước 7: Setup PM2 cho Production
+
+PM2 giữ application chạy và tự khởi động lại khi crash:
+
+```bash
+# Install PM2 globally
+npm install -g pm2
+
+# Start 9Router with PM2
+pm2 start npm --name 9router -- start
+
+# Save PM2 configuration
+pm2 save
+
+# Setup PM2 to start on system boot
+pm2 startup
+# Follow the instructions printed by the command above
+```
+
+**Lệnh quản lý PM2:**
+
+```bash
+# View logs
+pm2 logs 9router
+
+# Restart application
+pm2 restart 9router
+
+# Stop application
+pm2 stop 9router
+
+# View status
+pm2 status
+
+# Monitor resources
+pm2 monit
+```
+
+---
+
+## 🐳 Triển khai Docker
+
+### Cách 1: Dùng Dockerfile
+
+Tạo `Dockerfile` trong thư mục `app`:
+
+```dockerfile
+FROM node:20-alpine
+
+WORKDIR /app
+
+# Copy package files
+COPY package*.json ./
+
+# Install dependencies
+RUN npm ci --only=production
+
+# Copy application files
+COPY . .
+
+# Build application
+RUN npm run build
+
+# Expose ports
+EXPOSE 3000 20128
+
+# Set environment variables
+ENV NODE_ENV=production
+ENV DATA_DIR=/app/data
+
+# Create data directory
+RUN mkdir -p /app/data
+
+# Start application
+CMD ["npm", "run", "start"]
+```
+
+**Build và Run:**
+
+```bash
+# Build image
+docker build -t 9router .
+
+# Run container
+docker run -d \
+ --name 9router \
+ -p 3000:3000 \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret-change-this" \
+ -e INITIAL_PASSWORD="your-secure-password" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Cách 2: Docker Compose
+
+Tạo `docker-compose.yml`:
+
+```yaml
+version: '3.8'
+
+services:
+ 9router:
+ build: .
+ container_name: 9router
+ ports:
+ - "3000:3000"
+ - "20128:20128"
+ environment:
+ - NODE_ENV=production
+ - JWT_SECRET=your-secure-secret-change-this
+ - INITIAL_PASSWORD=your-secure-password
+ - DATA_DIR=/app/data
+ volumes:
+ - 9router-data:/app/data
+ restart: unless-stopped
+
+volumes:
+ 9router-data:
+```
+
+**Chạy với Docker Compose:**
+
+```bash
+# Start services
+docker-compose up -d
+
+# View logs
+docker-compose logs -f
+
+# Stop services
+docker-compose down
+
+# Rebuild and restart
+docker-compose up -d --build
+```
+
+---
+
+## 🌐 Reverse Proxy với Nginx
+
+### Tại sao dùng Nginx?
+
+- Terminate SSL/TLS
+- Map domain
+- Load balancing
+- Bảo mật tốt hơn
+
+### Bước 1: Cài đặt Nginx
+
+```bash
+sudo apt update
+sudo apt install nginx
+```
+
+### Bước 2: Cấu hình Nginx
+
+Tạo `/etc/nginx/sites-available/9router`:
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ # Redirect HTTP to HTTPS
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl http2;
+ server_name your-domain.com;
+
+ # SSL certificates (use certbot to generate)
+ ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
+
+ # SSL configuration
+ ssl_protocols TLSv1.2 TLSv1.3;
+ ssl_ciphers HIGH:!aNULL:!MD5;
+ ssl_prefer_server_ciphers on;
+
+ # Proxy to 9Router
+ location / {
+ proxy_pass http://localhost:3000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+
+ # API endpoint
+ location /v1 {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+### Bước 3: Enable Site
+
+```bash
+# Create symbolic link
+sudo ln -s /etc/nginx/sites-available/9router /etc/nginx/sites-enabled/
+
+# Test configuration
+sudo nginx -t
+
+# Reload Nginx
+sudo systemctl reload nginx
+```
+
+### Bước 4: Setup SSL với Let's Encrypt
+
+```bash
+# Install certbot
+sudo apt install certbot python3-certbot-nginx
+
+# Obtain SSL certificate
+sudo certbot --nginx -d your-domain.com
+
+# Auto-renewal is configured automatically
+# Test renewal
+sudo certbot renew --dry-run
+```
+
+---
+
+## 🔒 Cân nhắc về Bảo mật
+
+### 1. Đổi credentials mặc định
+
+**QUAN TRỌNG:** Đổi `JWT_SECRET` và `INITIAL_PASSWORD` trước khi deploy:
+
+```bash
+# Generate secure JWT secret
+openssl rand -base64 32
+
+# Use this value for JWT_SECRET
+export JWT_SECRET="generated-secret-here"
+```
+
+### 2. Cấu hình Firewall
+
+```bash
+# Allow SSH
+sudo ufw allow 22/tcp
+
+# Allow HTTP/HTTPS (if using Nginx)
+sudo ufw allow 80/tcp
+sudo ufw allow 443/tcp
+
+# If NOT using reverse proxy, allow 9Router ports
+sudo ufw allow 3000/tcp
+sudo ufw allow 20128/tcp
+
+# Enable firewall
+sudo ufw enable
+```
+
+### 3. Giới hạn truy cập Dashboard
+
+Nếu chỉ cần truy cập API, giới hạn port dashboard:
+
+```bash
+# Only allow localhost access to dashboard
+sudo ufw deny 3000/tcp
+```
+
+Truy cập dashboard qua SSH tunnel:
+
+```bash
+ssh -L 3000:localhost:3000 user@your-server.com
+# Then open http://localhost:3000 in your browser
+```
+
+### 4. Cập nhật định kỳ
+
+```bash
+# Update system packages
+sudo apt update && sudo apt upgrade -y
+
+# Update 9Router
+cd /path/to/9router/app
+git pull
+npm install
+npm run build
+pm2 restart 9router
+```
+
+### 5. Chiến lược Backup
+
+```bash
+# Backup data directory
+tar -czf 9router-backup-$(date +%Y%m%d).tar.gz /var/lib/9router
+
+# Automated daily backup (add to crontab)
+0 2 * * * tar -czf /backups/9router-$(date +\%Y\%m\%d).tar.gz /var/lib/9router
+```
+
+---
+
+## 📊 Giám sát
+
+### Kiểm tra trạng thái Application
+
+```bash
+# PM2 status
+pm2 status
+
+# View logs
+pm2 logs 9router --lines 100
+
+# Monitor resources
+pm2 monit
+```
+
+### Nginx Logs
+
+```bash
+# Access logs
+sudo tail -f /var/log/nginx/access.log
+
+# Error logs
+sudo tail -f /var/log/nginx/error.log
+```
+
+### Tài nguyên hệ thống
+
+```bash
+# CPU and memory usage
+htop
+
+# Disk usage
+df -h
+
+# Network connections
+netstat -tulpn | grep -E '3000|20128'
+```
+
+---
+
+## 🚨 Troubleshooting
+
+### Application không khởi động
+
+```bash
+# Check logs
+pm2 logs 9router
+
+# Check if ports are in use
+sudo lsof -i :3000
+sudo lsof -i :20128
+
+# Check environment variables
+pm2 env 9router
+```
+
+### Nginx 502 Bad Gateway
+
+```bash
+# Check if 9Router is running
+pm2 status
+
+# Check Nginx error logs
+sudo tail -f /var/log/nginx/error.log
+
+# Test Nginx configuration
+sudo nginx -t
+```
+
+### SSE Streaming không hoạt động
+
+Đảm bảo `proxy_buffering off` được set trong cấu hình Nginx để hỗ trợ SSE.
+
+### Lỗi Permission Denied
+
+```bash
+# Fix data directory permissions
+sudo chown -R $USER:$USER /var/lib/9router
+chmod 755 /var/lib/9router
+```
+
+---
+
+## 🔗 Bước tiếp theo
+
+- [Kết nối Providers](/providers/subscription.md)
+- [Setup Combos](/features/combos.md)
+- [Tích hợp với Tools](/integration/cursor.md)
diff --git a/gitbook/content/vi/deployment/localhost.md b/gitbook/content/vi/deployment/localhost.md
new file mode 100644
index 0000000..b6fc38c
--- /dev/null
+++ b/gitbook/content/vi/deployment/localhost.md
@@ -0,0 +1,164 @@
+# 🏠 Triển khai Localhost
+
+Chạy 9Router trên máy cá nhân để phát triển và dùng cá nhân.
+
+---
+
+## 📦 Cài đặt
+
+Cài đặt 9Router toàn cục qua npm:
+
+```bash
+npm install -g 9router
+```
+
+**Yêu cầu:**
+- Node.js 20 trở lên
+- npm 9 trở lên
+
+---
+
+## 🚀 Khởi động Server
+
+Khởi động 9Router với một lệnh duy nhất:
+
+```bash
+9router
+```
+
+Dashboard sẽ tự động mở trong trình duyệt tại `http://localhost:3000`
+
+**Cấu hình mặc định:**
+- **Dashboard**: `http://localhost:3000`
+- **API Endpoint**: `http://localhost:20128/v1`
+- **Data Directory**: `~/.9router`
+
+---
+
+## 🔧 Cấu hình
+
+### Custom Data Directory
+
+Đặt thư mục data tùy chỉnh qua biến môi trường:
+
+```bash
+DATA_DIR=/path/to/data 9router
+```
+
+### Custom Port
+
+Port API (20128) và port dashboard (3000) được cấu hình trong application. Để đổi, bạn cần sửa source code hoặc dùng biến môi trường nếu được hỗ trợ.
+
+---
+
+## 🛑 Dừng Server
+
+Nhấn `Ctrl+C` trong terminal đang chạy 9Router.
+
+```bash
+# In the terminal running 9router
+^C # Press Ctrl+C
+```
+
+Server sẽ shutdown an toàn và lưu mọi dữ liệu.
+
+---
+
+## 🔄 Khởi động lại Server
+
+Chỉ cần chạy lệnh start lại:
+
+```bash
+9router
+```
+
+Mọi cấu hình, API keys và combos được giữ lại trong thư mục data.
+
+---
+
+## 📊 Cập nhật 9Router
+
+Cập nhật phiên bản mới nhất:
+
+```bash
+npm update -g 9router
+```
+
+Kiểm tra version hiện tại:
+
+```bash
+npm list -g 9router
+```
+
+---
+
+## 🔍 Troubleshooting
+
+### Port đã được dùng
+
+Nếu port 20128 hoặc 3000 đã được dùng:
+
+```bash
+# Find process using the port (macOS/Linux)
+lsof -i :20128
+lsof -i :3000
+
+# Kill the process
+kill -9
+```
+
+### Lỗi Permission
+
+Nếu gặp lỗi permission khi cài đặt:
+
+```bash
+# Use sudo (not recommended)
+sudo npm install -g 9router
+
+# Or fix npm permissions (recommended)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+```
+
+### Vấn đề Data Directory
+
+Nếu thư mục data không truy cập được:
+
+```bash
+# Check permissions
+ls -la ~/.9router
+
+# Fix permissions
+chmod 755 ~/.9router
+```
+
+---
+
+## 📁 Cấu trúc Data Directory
+
+```
+~/.9router/
+├── db.json # Main database (providers, combos, settings)
+├── logs/ # Application logs
+└── cache/ # Temporary cache files
+```
+
+**Backup Data:**
+
+```bash
+# Backup
+cp -r ~/.9router ~/.9router.backup
+
+# Restore
+cp -r ~/.9router.backup ~/.9router
+```
+
+---
+
+## 🔗 Bước tiếp theo
+
+- [Kết nối Providers](/providers/subscription.md)
+- [Tạo Combos](/features/combos.md)
+- [Tích hợp với CLI Tools](/integration/cursor.md)
diff --git a/gitbook/content/vi/faq.md b/gitbook/content/vi/faq.md
new file mode 100644
index 0000000..d1c5280
--- /dev/null
+++ b/gitbook/content/vi/faq.md
@@ -0,0 +1,387 @@
+# Câu hỏi thường gặp
+
+Những câu hỏi phổ biến về 9Router.
+
+---
+
+## 9Router là gì?
+
+**9Router là bộ định tuyến mô hình AI giúp tối đa hóa giá trị subscription và giảm chi phí.**
+
+Nó định tuyến request thông minh qua nhiều provider AI bằng hệ thống fallback 3 tầng:
+1. **Tầng Subscription** - Tối đa quota Claude Code, Codex, Gemini bạn đang trả tiền
+2. **Tầng Cheap** - Lựa chọn siêu rẻ ($0.20-$0.60 per 1M tokens)
+3. **Tầng Free** - Backup khẩn cấp với model miễn phí không giới hạn
+
+**Lợi ích chính:**
+- Không bao giờ lãng phí quota subscription
+- Fallback tự động khi hết quota
+- Theo dõi quota thời gian thực
+- Tiết kiệm 90% chi phí so với dùng API trực tiếp
+
+---
+
+## Pricing hoạt động thế nào?
+
+**9Router dùng chiến lược pricing 3 tầng:**
+
+### Tier 1: Subscription (Dùng đầu tiên)
+- **Claude Code** (Pro/Max): $20-100/tháng - Quota 5 giờ + hàng tuần
+- **OpenAI Codex** (Plus/Pro): $20-200/tháng - Quota 5 giờ + hàng tuần
+- **Gemini CLI**: MIỄN PHÍ - 180K completions/tháng + 1K/ngày
+- **GitHub Copilot**: $10-19/tháng - Reset hàng tháng
+- **Antigravity**: MIỄN PHÍ - Tương tự Gemini
+
+**Mục tiêu:** Dùng hết mọi quota trước khi reset!
+
+### Tier 2: Cheap (Backup)
+- **GLM-4.7**: $0.60/$2.20 per 1M tokens - Reset 10AM hàng ngày
+- **MiniMax M2.1**: $0.20/$1.00 per 1M tokens - 5 giờ rolling
+- **Kimi K2**: $9/tháng cố định (10M tokens)
+
+**Mục tiêu:** Rẻ hơn 90% so với ChatGPT API ($20/1M)!
+
+### Tier 3: Free (Khẩn cấp)
+- **iFlow**: 8 model MIỄN PHÍ (Kimi K2, Qwen3, GLM, MiniMax...)
+- **Qwen**: 3 model MIỄN PHÍ (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro**: 2 model MIỄN PHÍ (Claude Sonnet 4.5, Haiku 4.5)
+
+**Mục tiêu:** Fallback chi phí 0 khi mọi thứ khác bị giới hạn quota!
+
+---
+
+## 9Router có miễn phí không?
+
+**Có, 9Router hoàn toàn miễn phí và mã nguồn mở 100%.**
+
+**Provider free tier có sẵn:**
+- **Gemini CLI** - 180K completions/tháng (MIỄN PHÍ tài khoản Google)
+- **iFlow** - 8 model không giới hạn (MIỄN PHÍ OAuth)
+- **Qwen** - 3 model không giới hạn (MIỄN PHÍ OAuth)
+- **Kiro** - Claude Sonnet/Haiku (MIỄN PHÍ AWS Builder ID)
+
+**Bạn có thể code MIỄN PHÍ mãi mãi chỉ dùng provider free tier!**
+
+**Provider trả phí tùy chọn:**
+- Dịch vụ subscription bạn có thể đã có (Claude Code, Codex, Copilot)
+- Lựa chọn siêu rẻ ($0.20-$0.60 per 1M tokens)
+
+---
+
+## Provider nào được hỗ trợ?
+
+### Subscription Providers
+- **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex, GPT 5.1 Codex Max
+- **Gemini CLI** (MIỄN PHÍ) - Gemini 3 Flash/Pro, 2.5 Pro/Flash
+- **GitHub Copilot** - GPT-5, Claude 4.5, Gemini 3
+- **Antigravity** (Google) - Gemini 3 Pro, Claude Sonnet 4.5
+
+### Cheap Providers
+- **GLM** (Zhipu AI) - GLM 4.7, GLM 4.6V Vision
+- **MiniMax** - MiniMax M2.1
+- **Kimi** (Moonshot AI) - Kimi Latest
+- **OpenRouter** - Passthrough đến mọi model OpenRouter
+
+### Free Providers
+- **iFlow** - 8 models (Kimi K2, Qwen3, GLM, MiniMax, DeepSeek...)
+- **Qwen** - 3 models (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro** - 2 models (Claude Sonnet 4.5, Haiku 4.5)
+
+**Tổng: 15+ providers, 50+ models**
+
+Xem [tài liệu providers](providers/subscription.md) để biết chi tiết.
+
+---
+
+## Tôi có thể dùng nhiều provider không?
+
+**Có! Đây là tính năng cốt lõi của 9Router.**
+
+**Combo cho phép bạn nối nhiều provider với fallback tự động:**
+
+```
+Example combo: "premium-coding"
+1. cc/claude-opus-4-5 (Subscription primary)
+2. glm/glm-4.7 (Cheap backup)
+3. if/kimi-k2 (Free emergency)
+
+→ Auto-switches when quota exhausted
+→ Never stops coding
+→ Minimal extra cost
+```
+
+**Cách tạo combo:**
+```
+Dashboard → Combos → Create New
+→ Add models in priority order
+→ Use combo name in CLI: "premium-coding"
+```
+
+**Lợi ích:**
+- Zero downtime khi hết quota
+- Tối ưu chi phí tự động
+- Một tên model cho mọi công cụ
+
+Xem [tài liệu combos](features/combos.md) để biết ví dụ.
+
+---
+
+## Quota tracking hoạt động thế nào?
+
+**9Router theo dõi quota thời gian thực cho tất cả provider:**
+
+**Tính năng:**
+- **Token consumption** - Tokens input/output mỗi request
+- **Reset countdown** - Thời gian đến khi quota refresh
+- **Usage stats** - Báo cáo hàng ngày/tuần/tháng
+- **Cost estimation** - Dự kiến chi tiêu (tier trả phí)
+- **Quota alerts** - Thông báo khi quota thấp
+
+**Loại quota:**
+- **5 giờ rolling** - Claude Code, Codex, MiniMax
+- **Reset hàng ngày** - Gemini CLI (1K/ngày), GLM (10AM)
+- **Reset hàng tuần** - Claude Code, Codex (quota thêm)
+- **Reset hàng tháng** - Gemini CLI (180K), GitHub Copilot (ngày 1)
+
+**Xem quota:**
+```
+Dashboard → Providers → Quota Tracking
+→ Real-time usage + reset countdown
+```
+
+Xem [tài liệu quota tracking](features/quota-tracking.md) để biết chi tiết.
+
+---
+
+## 9Router có hoạt động với Cursor không?
+
+**Có, nhưng Cursor yêu cầu endpoint cloud.**
+
+**Vấn đề:** Cursor IDE không hỗ trợ endpoint localhost.
+
+**Giải pháp:** Dùng 9Router cloud deployment:
+
+```
+Cursor Settings → Models → Advanced:
+ OpenAI API Base URL: https://9router.com/v1
+ OpenAI API Key: [from dashboard]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+**Thay thế:** Self-host trên VPS với domain công khai:
+```bash
+# Deploy to VPS
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+npm start
+
+# Configure Nginx reverse proxy
+# Point Cursor to: https://your-domain.com/v1
+```
+
+**Công cụ CLI khác hoạt động với localhost:**
+- Cline ✅
+- Claude Desktop ✅
+- Codex CLI ✅
+- Continue ✅
+- RooCode ✅
+
+Xem [hướng dẫn tích hợp Cursor](integration/cursor.md) để biết chi tiết.
+
+---
+
+## Tôi có thể self-host 9Router không?
+
+**Có! 9Router hỗ trợ nhiều tùy chọn deployment:**
+
+### Localhost (Mặc định)
+```bash
+npm install -g 9router
+9router
+→ Dashboard: http://localhost:3000
+→ API: http://localhost:20128/v1
+```
+
+### VPS/Cloud
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+npm start
+```
+
+### Docker
+```bash
+docker build -t 9router .
+docker run -d \
+ -p 3000:3000 \
+ -e JWT_SECRET="your-secret" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Cloudflare Workers
+```bash
+cd 9router/app
+npm run deploy:cloudflare
+```
+
+**Biến môi trường:**
+- `JWT_SECRET` - **PHẢI đổi trong production!**
+- `DATA_DIR` - Đường dẫn lưu database (mặc định: `~/.9router`)
+- `INITIAL_PASSWORD` - Đăng nhập Dashboard (mặc định: `123456`)
+- `NODE_ENV` - Đặt `production` để deploy
+
+Xem [hướng dẫn deployment](getting-started/installation.md#deployment) để biết chi tiết.
+
+---
+
+## Dữ liệu của tôi có an toàn không?
+
+**Có, 9Router ưu tiên bảo mật và quyền riêng tư:**
+
+**Local storage:**
+- Mọi dữ liệu lưu cục bộ tại `~/.9router` (hoặc `DATA_DIR` tùy chỉnh)
+- Không gửi data đến server 9Router
+- OAuth tokens mã hóa bằng JWT
+
+**Không telemetry:**
+- Không tracking sử dụng
+- Không analytics
+- Không phone-home
+
+**Mã nguồn mở:**
+- Toàn bộ source code có trên GitHub
+- Tự audit bảo mật
+- Community review
+
+**Best practice:**
+- Đổi `JWT_SECRET` trong production
+- Dùng `INITIAL_PASSWORD` mạnh
+- Bật HTTPS cho cloud deployment
+- Xoay API key định kỳ
+
+**9Router lưu gì:**
+- Tokens OAuth của provider (mã hóa)
+- API keys (mã hóa)
+- Thống kê sử dụng (chỉ cục bộ)
+- Cấu hình combo
+
+**9Router KHÔNG lưu:**
+- Prompts hoặc responses của bạn
+- Code bạn tạo
+- Thông tin cá nhân
+
+---
+
+## Làm thế nào để cập nhật 9Router?
+
+**Phương thức cập nhật phụ thuộc loại cài đặt:**
+
+### Global NPM Install
+```bash
+npm update -g 9router
+```
+
+### Local Install
+```bash
+cd 9router/app
+git pull origin main
+npm install
+npm run build
+npm start
+```
+
+### Docker
+```bash
+docker pull 9router:latest
+docker stop 9router
+docker rm 9router
+docker run -d \
+ -p 3000:3000 \
+ -v 9router-data:/app/data \
+ 9router:latest
+```
+
+**Kiểm tra version:**
+```bash
+9router --version
+```
+
+**Breaking changes:**
+- Xem [CHANGELOG.md](https://github.com/decolua/9router/blob/main/CHANGELOG.md)
+- Backup `~/.9router` trước khi update lớn
+- Xem hướng dẫn migration cho major version
+
+---
+
+## Tôi có thể đóng góp như thế nào?
+
+**Chúng tôi hoan nghênh đóng góp!**
+
+### Các cách đóng góp:
+
+1. **Report bugs:**
+ - [GitHub Issues](https://github.com/decolua/9router/issues)
+ - Bao gồm error logs, các bước reproduce
+
+2. **Request features:**
+ - [GitHub Discussions](https://github.com/decolua/9router/discussions)
+ - Mô tả use case và lợi ích
+
+3. **Submit code:**
+ ```bash
+ # Fork repo
+ git clone https://github.com/YOUR_USERNAME/9router.git
+ cd 9router
+
+ # Create branch
+ git checkout -b feature/your-feature
+
+ # Make changes
+ npm install
+ npm run dev
+
+ # Test
+ npm test
+
+ # Commit and push
+ git add .
+ git commit -m "Add your feature"
+ git push origin feature/your-feature
+
+ # Create Pull Request on GitHub
+ ```
+
+4. **Cải thiện docs:**
+ - Sửa lỗi chính tả, thêm ví dụ
+ - Dịch sang ngôn ngữ khác
+ - Viết tutorial
+
+5. **Thêm provider:**
+ - Triển khai adapter provider mới
+ - Xem `app/lib/providers/` để có ví dụ
+
+**Hướng dẫn đóng góp:**
+- Tuân theo code style hiện có
+- Thêm test cho tính năng mới
+- Cập nhật tài liệu
+- Giữ commit nhỏ gọn và mô tả rõ ràng
+
+Xem [CONTRIBUTING.md](https://github.com/decolua/9router/blob/main/CONTRIBUTING.md) để biết chi tiết.
+
+---
+
+## Cần trợ giúp thêm?
+
+- **Documentation:** [9router.com/docs](https://9router.com/docs)
+- **GitHub:** [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **Troubleshooting:** [troubleshooting.md](troubleshooting.md)
diff --git a/gitbook/content/vi/features/combos.md b/gitbook/content/vi/features/combos.md
new file mode 100644
index 0000000..b583df6
--- /dev/null
+++ b/gitbook/content/vi/features/combos.md
@@ -0,0 +1,537 @@
+# Combos - Chuỗi Fallback Tùy chỉnh
+
+Tạo các tổ hợp model tùy chỉnh với fallback tự động. Combo cho phép bạn định nghĩa chiến lược routing dựa trên chi phí, chất lượng và tính khả dụng.
+
+---
+
+## Combos là gì?
+
+Combos là **chuỗi fallback tùy chỉnh** bạn tạo trong dashboard. Thay vì dùng một model duy nhất, bạn định nghĩa một chuỗi các model mà 9Router sẽ thử theo thứ tự.
+
+**Ví dụ:**
+```
+Combo name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101 (try first)
+ 2. glm/glm-4.7 (if #1 quota exhausted)
+ 3. minimax/MiniMax-M2.1 (if #2 quota exhausted)
+```
+
+**Dùng trong CLI:**
+```
+Model: premium-coding
+```
+
+9Router tự động thử từng model theo thứ tự cho đến khi thành công.
+
+---
+
+## Tại sao dùng Combos?
+
+### 1. Tối đa hóa Giá trị Subscription
+```
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ Use subscription first, cheap backup, free emergency
+→ Get full value from subscriptions you already pay for
+```
+
+### 2. Giảm Chi phí
+```
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+
+→ Start with cheapest paid option ($0.60/1M)
+→ Fallback to even cheaper ($0.20/1M)
+→ Emergency free tier
+→ Total cost: ~$5-10/month vs $2000 on ChatGPT API
+```
+
+### 3. Đảm bảo Khả dụng 24/7
+```
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ Always include free tier at the end
+→ Never run out of quota
+→ Code anytime, anywhere
+```
+
+### 4. Tối ưu Chất lượng
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → gc/gemini-3-pro
+
+→ Best models first
+→ Fallback to other premium models
+→ Maintain high quality across fallback chain
+```
+
+---
+
+## Cách tạo Combos
+
+### Bước 1: Mở Dashboard
+
+```
+http://localhost:20128
+→ Login with your password
+```
+
+### Bước 2: Đi đến Combos
+
+```
+Dashboard → Combos → Create New Combo
+```
+
+### Bước 3: Cấu hình Combo
+
+**Tên Combo:**
+```
+premium-coding
+```
+
+**Mô tả (tùy chọn):**
+```
+Subscription first, cheap backup, free emergency
+```
+
+**Chọn Models:**
+```
+1. cc/claude-opus-4-5-20251101
+2. glm/glm-4.7
+3. minimax/MiniMax-M2.1
+```
+
+**Kéo để sắp xếp lại** - Ưu tiên từ trên xuống dưới.
+
+### Bước 4: Lưu
+
+```
+Click "Save Combo"
+→ Combo appears in model list
+```
+
+### Bước 5: Dùng trong CLI
+
+```
+Cursor/Cline/Any tool:
+ Model: premium-coding
+```
+
+---
+
+## Ví dụ Combos
+
+### Ví dụ 1: Premium Coding (Subscription → Cheap → Free)
+
+**Mục tiêu**: Tối đa giá trị subscription, giảm chi phí thêm.
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. glm/glm-4.7
+ 3. minimax/MiniMax-M2.1
+```
+
+**Sử dụng:**
+```
+Cursor IDE:
+ Model: premium-coding
+```
+
+**Hoạt động:**
+```
+Morning (fresh quota):
+ Request → cc/claude-opus-4-5 ✅
+
+Afternoon (Claude quota out):
+ Request → glm/glm-4.7 ✅ (auto switched)
+
+Evening (GLM quota out):
+ Request → minimax/MiniMax-M2.1 ✅ (auto switched)
+```
+
+**Chi phí hàng tháng (100M tokens):**
+```
+80M via Claude Code: $0 (subscription)
+15M via GLM: $9
+5M via MiniMax: $1
+Total: $10 + your subscription
+```
+
+**Tiết kiệm**: ~99% so với ChatGPT API ($2000).
+
+---
+
+### Ví dụ 2: Budget Combo (Cheap → Free)
+
+**Mục tiêu**: Giảm chi phí, dùng free tier làm backup.
+
+```
+Dashboard → Combos → Create New
+
+Name: budget-combo
+Models:
+ 1. glm/glm-4.7
+ 2. minimax/MiniMax-M2.1
+ 3. if/kimi-k2-thinking
+```
+
+**Sử dụng:**
+```
+Cline:
+ Provider: OpenAI Compatible
+ Base URL: http://localhost:20128/v1
+ Model: budget-combo
+```
+
+**Hoạt động:**
+```
+Request → glm/glm-4.7
+ ✅ Daily quota available → Use GLM ($0.60/1M)
+ ❌ Quota exhausted → Try MiniMax ($0.20/1M)
+ ❌ MiniMax quota out → Use iFlow (FREE)
+```
+
+**Chi phí hàng tháng (100M tokens):**
+```
+70M via GLM: $42
+20M via MiniMax: $4
+10M via iFlow: $0
+Total: $46 vs $2000 on ChatGPT API
+```
+
+**Tiết kiệm**: 97%.
+
+---
+
+### Ví dụ 3: Free Combo (Chi phí 0)
+
+**Mục tiêu**: 100% miễn phí, không bao giờ tốn tiền.
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking
+ 2. qw/qwen3-coder-plus
+ 3. kr/claude-sonnet-4.5
+```
+
+**Sử dụng:**
+```
+Claude Desktop:
+ Model: free-combo
+```
+
+**Hoạt động:**
+```
+Request → if/kimi-k2-thinking
+ ✅ Available → Use iFlow
+ ❌ Error → Try Qwen
+ ❌ Error → Try Kiro
+```
+
+**Chi phí hàng tháng:**
+```
+100M tokens via free providers: $0
+Total: $0 forever
+```
+
+**Use case**: Dự án cá nhân, học tập, thử nghiệm.
+
+---
+
+### Ví dụ 4: Quality First (Chỉ Premium Models)
+
+**Mục tiêu**: Chất lượng tốt nhất, không fallback rẻ.
+
+```
+Dashboard → Combos → Create New
+
+Name: quality-first
+Models:
+ 1. cc/claude-opus-4-5-20251101
+ 2. cx/gpt-5.2-codex
+ 3. gc/gemini-3-pro-preview
+```
+
+**Sử dụng:**
+```
+Codex CLI:
+ export OPENAI_BASE_URL="http://localhost:20128"
+ Model: quality-first
+```
+
+**Hoạt động:**
+```
+Request → cc/claude-opus-4-5
+ ❌ Quota out → cx/gpt-5.2-codex
+ ❌ Quota out → gc/gemini-3-pro-preview
+ ❌ All out → Return error (no cheap fallback)
+```
+
+**Use case**: Code production quan trọng, refactoring phức tạp.
+
+---
+
+### Ví dụ 5: Multi-Subscription (Tối đa hết tất cả)
+
+**Mục tiêu**: Dùng hết subscription trước khi trả thêm tiền.
+
+```
+Dashboard → Combos → Create New
+
+Name: multi-sub
+Models:
+ 1. gc/gemini-3-flash-preview (FREE 180K/month)
+ 2. cc/claude-opus-4-5-20251101 (Pro subscription)
+ 3. cx/gpt-5.2-codex (Plus subscription)
+ 4. gh/gpt-5 (Copilot subscription)
+ 5. glm/glm-4.7 (Cheap backup)
+ 6. if/kimi-k2-thinking (Free emergency)
+```
+
+**Chi phí hàng tháng (200M tokens):**
+```
+50M via Gemini CLI: $0 (free tier)
+80M via Claude Code: $0 (subscription)
+40M via Codex: $0 (subscription)
+20M via Copilot: $0 (subscription)
+8M via GLM: $4.80
+2M via iFlow: $0
+Total: $4.80 + existing subscriptions
+```
+
+**Kết quả**: Dùng 190M tokens từ subscription, chỉ $4.80 phụ.
+
+---
+
+### Ví dụ 6: Tối ưu Reset Quota
+
+**Mục tiêu**: Phân bổ sử dụng dựa trên thời gian reset.
+
+```
+Dashboard → Combos → Create New
+
+Name: reset-optimized
+Models:
+ 1. cc/claude-opus-4-5 (5h reset, use morning)
+ 2. gc/gemini-3-flash (1K/day, use afternoon)
+ 3. glm/glm-4.7 (daily 10AM reset, use evening)
+ 4. minimax/MiniMax-M2.1 (5h rolling, use night)
+ 5. if/kimi-k2-thinking (unlimited, emergency)
+```
+
+**Lịch trình hàng ngày:**
+```
+08:00 - 13:00: Claude Code (fresh 5h quota)
+13:00 - 18:00: Gemini CLI (1K/day quota)
+18:00 - 22:00: GLM (resets 10AM next day)
+22:00 - 08:00: MiniMax (5h rolling) or iFlow
+```
+
+**Kết quả**: Code 24/7 với chi phí tối thiểu.
+
+---
+
+## Dùng Combos trong CLI Tools
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from dashboard]
+ Model: premium-coding
+```
+
+### Claude Desktop
+
+Sửa `~/.claude/config.json`:
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key",
+ "model": "budget-combo"
+}
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex --model quality-first "your prompt"
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [from dashboard]
+Model: free-combo
+```
+
+### API Request
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "premium-coding",
+ "messages": [
+ {"role": "user", "content": "Write a function to..."}
+ ],
+ "stream": true
+ }'
+```
+
+---
+
+## Best Practices
+
+### 1. Luôn bao gồm Free Tier
+
+```
+✅ Good:
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+❌ Bad:
+cc/claude-opus → glm/glm-4.7
+(no free fallback, can run out of quota)
+```
+
+**Lý do**: Đảm bảo khả dụng 24/7, không bao giờ bị chặn bởi quota.
+
+### 2. Sắp xếp theo Chi phí (Rẻ đến Đắt)
+
+```
+✅ Good:
+glm/glm-4.7 → minimax/MiniMax-M2.1 → cc/claude-opus
+
+❌ Bad:
+cc/claude-opus → glm/glm-4.7
+(wastes subscription quota on simple tasks)
+```
+
+**Ngoại lệ**: Nếu muốn tối đa giá trị subscription, đặt subscription đầu tiên.
+
+### 3. Phù hợp với Yêu cầu Chất lượng
+
+```
+For production code:
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7
+
+For quick tasks:
+glm/glm-4.7 → if/kimi-k2-thinking
+
+For experimentation:
+if/kimi-k2-thinking → qw/qwen3-coder-plus
+```
+
+### 4. Cân nhắc Thời gian Reset Quota
+
+```
+Morning combo (fresh quotas):
+cc/claude-opus → cx/gpt-5.2-codex
+
+Evening combo (quotas likely exhausted):
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+### 5. Tạo nhiều Combo cho các Use Case khác nhau
+
+```
+premium-coding: For complex tasks
+budget-combo: For simple tasks
+free-combo: For experimentation
+quality-first: For production code
+```
+
+**Chuyển đổi combo** dựa trên yêu cầu task.
+
+### 6. Theo dõi hiệu năng Combo
+
+```
+Dashboard → Analytics → Combo Usage:
+ premium-coding:
+ 80% via cc/claude-opus (good, using subscription)
+ 15% via glm/glm-4.7 (acceptable backup)
+ 5% via minimax (rare fallback)
+```
+
+**Tối ưu**: Nếu fallback quá nhiều, tăng quota chính hoặc sắp xếp lại model.
+
+---
+
+## Cấu hình Nâng cao
+
+### Đặt Giới hạn Ngân sách cho mỗi Combo
+
+```
+Dashboard → Combos → Edit → Budget:
+ Daily limit: $5
+ Monthly limit: $50
+```
+
+Khi đạt giới hạn, 9Router bỏ qua model trả phí và chỉ dùng free tier.
+
+### Bật/Tắt Model trong Combo
+
+```
+Dashboard → Combos → Edit → Models:
+ ✅ cc/claude-opus-4-5 (enabled)
+ ❌ glm/glm-4.7 (temporarily disabled)
+ ✅ if/kimi-k2-thinking (enabled)
+```
+
+**Use case**: Tạm tắt model đắt mà không cần xóa combo.
+
+### Clone Combo có sẵn
+
+```
+Dashboard → Combos → Clone "premium-coding"
+→ Creates copy with "-copy" suffix
+→ Modify and save as new combo
+```
+
+**Use case**: Tạo biến thể cho các kịch bản khác nhau.
+
+---
+
+## Troubleshooting
+
+**Issue: Combo không xuất hiện trong danh sách model**
+
+**Giải pháp:**
+1. Refresh dashboard
+2. Kiểm tra combo đã được lưu (dấu tick xanh)
+3. Khởi động lại CLI tool để refresh danh sách model
+
+**Issue: Combo luôn dùng model cuối cùng (free tier)**
+
+**Giải pháp:**
+1. Kiểm tra quota cho các model chính (Dashboard → Quota)
+2. Xác minh API keys hợp lệ (Dashboard → Providers)
+3. Kiểm tra giới hạn ngân sách không vượt quá
+
+**Issue: Combo tốn hơn dự kiến**
+
+**Giải pháp:**
+1. Dashboard → Analytics → Xem usage combo
+2. Kiểm tra model chính có bị hết quota không
+3. Sắp xếp lại model (đặt rẻ hơn lên trước)
+4. Đặt giới hạn ngân sách
+
+---
+
+## Liên quan
+
+- [Smart Routing](./smart-routing.md) - Cách auto fallback hoạt động
+- [Quota Tracking](./quota-tracking.md) - Theo dõi sử dụng và chi phí
diff --git a/gitbook/content/vi/features/quota-tracking.md b/gitbook/content/vi/features/quota-tracking.md
new file mode 100644
index 0000000..7e728d4
--- /dev/null
+++ b/gitbook/content/vi/features/quota-tracking.md
@@ -0,0 +1,687 @@
+# Quota Tracking & Giám sát Usage
+
+Theo dõi tiêu thụ token thời gian thực, giám sát giới hạn quota, ước tính chi phí và nhận cảnh báo trước khi hết. Không bao giờ lãng phí quota subscription hoặc vượt giới hạn ngân sách.
+
+---
+
+## Tổng quan
+
+9Router cung cấp quota tracking toàn diện cho mọi provider:
+
+- **Tiêu thụ token thời gian thực** - Xem tokens dùng mỗi request
+- **Giới hạn quota & còn lại** - Theo dõi usage so với giới hạn
+- **Đếm ngược Reset** - Biết khi nào quota refresh
+- **Ước tính chi phí** - Tính chi tiêu cho tier trả phí
+- **Báo cáo hàng tháng** - Phân tích pattern sử dụng
+- **Cảnh báo & thông báo** - Nhận cảnh báo trước giới hạn
+
+---
+
+## Tổng quan Dashboard
+
+### Tóm tắt Quota
+
+```
+Dashboard → Home → Quota Overview
+
+┌─────────────────────────────────────────────┐
+│ Claude Code (cc/) │
+│ ████████████░░░░░░░░ 2.5h / 5h (50%) │
+│ Resets in: 2h 30m │
+│ Cost: $0 (subscription) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ Gemini CLI (gc/) │
+│ ████████░░░░░░░░░░░░ 450 / 1000 (45%) │
+│ Daily reset in: 18h 30m │
+│ Monthly: 45K / 180K (25%) │
+│ Cost: $0 (free tier) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ GLM-4.7 (glm/) │
+│ ██████████████░░░░░░ 7M / 10M tokens (70%) │
+│ Resets: Daily 10:00 AM (in 5h 35m) │
+│ Cost today: $4.20 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ MiniMax M2.1 (minimax/) │
+│ ████████████████░░░░ 4M / 5M tokens (80%) │
+│ Rolling 5h window │
+│ Cost (5h): $0.80 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ iFlow (if/) │
+│ ████████████████████ Unlimited │
+│ Cost: $0 (free forever) │
+└─────────────────────────────────────────────┘
+```
+
+---
+
+## Tiêu thụ Token Thời gian thực
+
+### Theo dõi từng Request
+
+Mỗi request hiển thị usage token chi tiết:
+
+```
+Dashboard → Activity → Recent Requests
+
+Request #1234
+Model: cc/claude-opus-4-5-20251101
+Timestamp: 2026-02-04 04:15:32
+
+Tokens:
+ Input: 1,250 tokens
+ Output: 850 tokens
+ Total: 2,100 tokens
+
+Cost: $0 (subscription quota)
+Duration: 3.2s
+Status: ✅ Success
+```
+
+### Live Usage Monitor
+
+```
+Dashboard → Live Monitor
+
+Current request:
+ Model: glm/glm-4.7
+ Tokens streamed: 450 / ~800 estimated
+ Cost so far: $0.0009
+ Duration: 1.8s
+```
+
+### Phân tích Token theo Model
+
+```
+Dashboard → Analytics → Token Usage
+
+Today (Feb 4, 2026):
+ cc/claude-opus-4-5: 15M tokens ($0, subscription)
+ glm/glm-4.7: 8M tokens ($4.80)
+ if/kimi-k2-thinking: 3M tokens ($0, free)
+
+Total: 26M tokens
+Cost: $4.80
+```
+
+---
+
+## Giới hạn Quota & Thời gian Reset
+
+### Subscription Providers
+
+**Claude Code (Pro/Max)**
+```
+Quota type: Time-based (5-hour rolling)
+Limit: 5 hours of usage
+Reset: Rolling 5-hour window + Weekly refresh
+Tracking: Usage time per model
+
+Dashboard shows:
+ Opus: 2.5h / 5h used
+ Sonnet: 1.2h / 5h used
+ Haiku: 0.8h / 5h used
+
+Weekly reset: Every Monday 00:00 UTC
+```
+
+**OpenAI Codex (Plus/Pro)**
+```
+Quota type: Time-based (5-hour rolling)
+Limit: 5 hours (Plus) / 10 hours (Pro)
+Reset: Rolling 5-hour window + Weekly refresh
+
+Dashboard shows:
+ GPT-5.2 Codex: 3.5h / 5h used
+ Resets in: 1h 30m
+```
+
+**Gemini CLI (MIỄN PHÍ)**
+```
+Quota type: Request count + Monthly tokens
+Daily limit: 1,000 requests
+Monthly limit: 180,000 completions
+Reset: Daily 00:00 UTC + Monthly 1st
+
+Dashboard shows:
+ Today: 450 / 1,000 requests (45%)
+ This month: 45K / 180K completions (25%)
+ Daily reset in: 18h 30m
+ Monthly reset in: 26 days
+```
+
+**GitHub Copilot**
+```
+Quota type: Monthly usage
+Limit: Varies by plan
+Reset: 1st of each month
+
+Dashboard shows:
+ Usage: 60% of monthly quota
+ Resets: March 1, 2026 (in 25 days)
+```
+
+### Cheap Providers
+
+**GLM-4.7**
+```
+Quota type: Daily token limit
+Limit: 10M tokens/day (Coding Plan)
+Reset: Daily 10:00 AM Beijing Time (UTC+8)
+
+Dashboard shows:
+ Used: 7M / 10M tokens (70%)
+ Remaining: 3M tokens
+ Resets in: 5h 35m
+ Cost today: $4.20
+```
+
+**MiniMax M2.1**
+```
+Quota type: Rolling 5-hour window
+Limit: 5M tokens per 5 hours
+Reset: Continuous rolling window
+
+Dashboard shows:
+ Used (5h): 4M / 5M tokens (80%)
+ Oldest usage expires in: 45m
+ Cost (5h): $0.80
+```
+
+**Kimi K2**
+```
+Quota type: Monthly subscription
+Limit: 10M tokens/month ($9 flat)
+Reset: Monthly on subscription date
+
+Dashboard shows:
+ Used: 6M / 10M tokens (60%)
+ Resets: Feb 15, 2026 (in 11 days)
+ Cost: $9/month (prepaid)
+```
+
+### Free Providers
+
+**iFlow / Qwen / Kiro**
+```
+Quota type: Unlimited (rate-limited)
+Limit: No hard limit
+Reset: N/A
+
+Dashboard shows:
+ Used today: 5M tokens
+ Cost: $0 (free forever)
+ Status: ✅ Available
+```
+
+---
+
+## Ước tính Chi phí
+
+### Theo dõi Chi phí Thời gian thực
+
+```
+Dashboard → Costs → Today
+
+Subscription providers: $0
+ Claude Code: 15M tokens ($0, included)
+ Gemini CLI: 3M tokens ($0, free tier)
+
+Paid providers: $4.80
+ GLM-4.7: 8M tokens ($4.80)
+ Input: 6M × $0.60/1M = $3.60
+ Output: 2M × $2.20/1M = $4.40
+ Total: $4.80
+
+Free providers: $0
+ iFlow: 3M tokens ($0)
+
+Total today: $4.80
+```
+
+### Báo cáo Chi tiêu Hàng tháng
+
+```
+Dashboard → Costs → This Month (February 2026)
+
+Week 1 (Feb 1-7):
+ Subscription: $0 (80M tokens)
+ Paid: $15.20 (25M tokens)
+ Free: $0 (10M tokens)
+ Total: $15.20
+
+Week 2 (Feb 8-14):
+ Subscription: $0 (75M tokens)
+ Paid: $12.80 (20M tokens)
+ Free: $0 (8M tokens)
+ Total: $12.80
+
+Month to date: $28.00
+Projected (30 days): ~$120
+
+Breakdown by provider:
+ GLM-4.7: $22.00 (78%)
+ MiniMax M2.1: $6.00 (22%)
+
+Average cost per 1M tokens: $0.62
+Savings vs ChatGPT API: 97% ($4,000 → $120)
+```
+
+### Dự kiến Chi phí
+
+```
+Dashboard → Costs → Projections
+
+Based on last 7 days usage:
+ Daily average: 50M tokens
+ Daily cost: $4.50
+
+Monthly projection:
+ Tokens: 1,500M (1.5B)
+ Cost: $135
+
+Breakdown:
+ Subscription: 900M tokens ($0)
+ GLM-4.7: 450M tokens ($90)
+ MiniMax: 120M tokens ($24)
+ Free: 30M tokens ($0)
+
+Budget status:
+ Daily limit: $5 → 90% used today
+ Monthly limit: $150 → 90% projected
+ ⚠️ Warning: May exceed monthly budget
+```
+
+---
+
+## Dashboard Usage
+
+### Thống kê Tổng quan
+
+```
+Dashboard → Analytics → Overview
+
+Today (Feb 4, 2026):
+ Requests: 1,234
+ Tokens: 26M
+ Cost: $4.80
+ Avg response time: 2.1s
+
+This week:
+ Requests: 8,456
+ Tokens: 180M
+ Cost: $28.00
+ Success rate: 99.2%
+
+This month:
+ Requests: 15,234
+ Tokens: 320M
+ Cost: $52.00
+ Top model: cc/claude-opus-4-5 (45%)
+```
+
+### Usage theo Model
+
+```
+Dashboard → Analytics → Models
+
+Top models (this month):
+1. cc/claude-opus-4-5: 145M tokens (45%)
+2. glm/glm-4.7: 95M tokens (30%)
+3. if/kimi-k2-thinking: 50M tokens (16%)
+4. minimax/MiniMax-M2.1: 20M tokens (6%)
+5. gc/gemini-3-flash: 10M tokens (3%)
+
+Cost breakdown:
+ cc/claude-opus: $0 (subscription)
+ glm/glm-4.7: $45.00
+ if/kimi-k2-thinking: $0 (free)
+ minimax/MiniMax-M2.1: $7.00
+ gc/gemini-3-flash: $0 (free)
+```
+
+### Usage theo Thời gian
+
+```
+Dashboard → Analytics → Timeline
+
+Hourly usage (today):
+00:00 - 01:00: 0.5M tokens
+01:00 - 02:00: 0.2M tokens
+...
+08:00 - 09:00: 3.2M tokens (peak)
+09:00 - 10:00: 2.8M tokens
+...
+23:00 - 00:00: 0.8M tokens
+
+Peak hours: 08:00 - 12:00 (morning coding)
+Low hours: 00:00 - 06:00 (night)
+```
+
+### Usage theo Combo
+
+```
+Dashboard → Analytics → Combos
+
+premium-coding:
+ Requests: 456
+ Tokens: 12M
+ Cost: $2.40
+
+ Breakdown:
+ cc/claude-opus: 8M tokens (67%, $0)
+ glm/glm-4.7: 3M tokens (25%, $1.80)
+ minimax/MiniMax-M2.1: 1M tokens (8%, $0.20)
+
+budget-combo:
+ Requests: 234
+ Tokens: 6M
+ Cost: $1.20
+
+ Breakdown:
+ glm/glm-4.7: 4M tokens (67%, $2.40)
+ if/kimi-k2-thinking: 2M tokens (33%, $0)
+```
+
+---
+
+## Cảnh báo & Thông báo
+
+### Cảnh báo Quota
+
+```
+Dashboard → Settings → Alerts
+
+Quota warnings:
+ ✅ Alert at 80% quota used
+ ✅ Alert at 90% quota used
+ ✅ Alert when quota exhausted
+ ✅ Notify when quota resets
+
+Delivery:
+ ✅ Dashboard notification
+ ✅ Email (optional)
+ ✅ Webhook (optional)
+```
+
+**Ví dụ thông báo:**
+```
+⚠️ Claude Code quota 80% used
+ 2.5h remaining (resets in 1h 30m)
+
+⚠️ GLM-4.7 quota 90% used
+ 1M tokens remaining (resets in 5h)
+
+✅ Gemini CLI quota reset
+ 1,000 requests available (daily limit)
+```
+
+### Cảnh báo Ngân sách
+
+```
+Dashboard → Settings → Budget Alerts
+
+Daily budget: $5
+ ✅ Alert at 80% ($4)
+ ✅ Alert at 100% ($5)
+ ✅ Auto-switch to free tier when exceeded
+
+Monthly budget: $150
+ ✅ Alert at 50% ($75)
+ ✅ Alert at 80% ($120)
+ ✅ Alert at 100% ($150)
+```
+
+**Ví dụ thông báo:**
+```
+⚠️ Daily budget 80% used
+ $4.00 / $5.00 spent today
+
+⚠️ Monthly budget 50% reached
+ $75 / $150 spent this month
+ Projected: $135 (within budget)
+
+🚨 Daily budget exceeded
+ $5.20 / $5.00 spent today
+ Auto-switched to free tier
+```
+
+### Phát hiện Bất thường Chi phí
+
+```
+Dashboard → Settings → Anomaly Detection
+
+✅ Detect unusual spending patterns
+✅ Alert on cost spikes (>2× daily average)
+✅ Warn on quota exhaustion patterns
+
+Example alert:
+⚠️ Cost spike detected
+ Today: $12.50 (2.5× daily average)
+ Reason: High GLM-4.7 usage (20M tokens)
+ Suggestion: Check if primary models quota-exhausted
+```
+
+---
+
+## Best Practices
+
+### 1. Theo dõi Quota Hàng ngày
+
+```
+Daily routine:
+1. Check dashboard quota overview (30 seconds)
+2. Review reset times
+3. Plan usage around quota availability
+```
+
+**Ví dụ:**
+```
+Morning check:
+ ✅ Claude Code: 5h available (fresh reset)
+ ✅ Gemini CLI: 1K requests available
+ ⚠️ GLM-4.7: 2M tokens left (resets 10AM)
+
+Action: Use Claude Code for morning work
+```
+
+### 2. Đặt Giới hạn Ngân sách
+
+```
+Dashboard → Settings → Budget:
+ Daily: $5 (prevents overspending)
+ Monthly: $150 (aligns with budget)
+```
+
+**Kết quả**: Auto-switch sang free tier khi đạt giới hạn.
+
+### 3. Tối ưu Combo Usage
+
+```
+Dashboard → Analytics → Combos:
+ Review which models are used most
+ Adjust combo order to minimize costs
+```
+
+**Ví dụ:**
+```
+Current: cc/claude-opus → glm/glm-4.7
+ 80% via Claude (good)
+ 20% via GLM ($12/month)
+
+Optimized: gc/gemini-3-flash → cc/claude-opus → glm/glm-4.7
+ 50% via Gemini (free)
+ 40% via Claude (subscription)
+ 10% via GLM ($6/month)
+
+Savings: $6/month
+```
+
+### 4. Theo dõi Thời gian Reset
+
+```
+Dashboard → Quota → Reset Schedule:
+ Claude Code: 5h rolling + Weekly Monday
+ Gemini CLI: Daily 00:00 UTC + Monthly 1st
+ GLM-4.7: Daily 10:00 AM Beijing Time
+ MiniMax: Rolling 5h window
+```
+
+**Chiến lược**: Dùng provider khi quota mới reset.
+
+### 5. Xem Báo cáo Hàng tháng
+
+```
+Dashboard → Analytics → Monthly Report:
+ Total tokens: 1.5B
+ Total cost: $120
+ Savings: 97% vs ChatGPT API
+
+Insights:
+ - 60% usage via subscriptions ($0)
+ - 30% via GLM ($90)
+ - 10% via free tier ($0)
+
+Optimization:
+ - Increase Gemini CLI usage (free)
+ - Reduce GLM usage (expensive)
+```
+
+---
+
+## Truy cập API
+
+### Lấy trạng thái Quota
+
+```bash
+GET http://localhost:20128/api/quota
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "providers": [
+ {
+ "id": "cc",
+ "name": "Claude Code",
+ "quota": {
+ "used": 2.5,
+ "limit": 5,
+ "unit": "hours",
+ "percentage": 50
+ },
+ "reset": {
+ "type": "rolling",
+ "window": "5h",
+ "nextReset": "2026-02-04T06:45:00Z"
+ },
+ "cost": {
+ "today": 0,
+ "month": 0,
+ "currency": "USD"
+ }
+ },
+ {
+ "id": "glm",
+ "name": "GLM-4.7",
+ "quota": {
+ "used": 7000000,
+ "limit": 10000000,
+ "unit": "tokens",
+ "percentage": 70
+ },
+ "reset": {
+ "type": "daily",
+ "time": "10:00 AM UTC+8",
+ "nextReset": "2026-02-04T10:00:00+08:00"
+ },
+ "cost": {
+ "today": 4.20,
+ "month": 52.00,
+ "currency": "USD"
+ }
+ }
+ ]
+}
+```
+
+### Lấy Usage Stats
+
+```bash
+GET http://localhost:20128/api/usage?period=today
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "period": "today",
+ "date": "2026-02-04",
+ "summary": {
+ "requests": 1234,
+ "tokens": 26000000,
+ "cost": 4.80
+ },
+ "byModel": [
+ {
+ "model": "cc/claude-opus-4-5",
+ "requests": 456,
+ "tokens": 15000000,
+ "cost": 0
+ },
+ {
+ "model": "glm/glm-4.7",
+ "requests": 234,
+ "tokens": 8000000,
+ "cost": 4.80
+ }
+ ]
+}
+```
+
+---
+
+## Troubleshooting
+
+**Issue: Quota hiển thị 0% nhưng request thất bại**
+
+**Giải pháp:**
+1. Kiểm tra kết nối provider (Dashboard → Providers)
+2. Xác minh API keys hợp lệ
+3. Kiểm tra provider có down không (trang status)
+4. Thử kết nối lại OAuth providers
+
+**Issue: Ước tính chi phí sai**
+
+**Giải pháp:**
+1. Dashboard → Settings → Pricing
+2. Xác minh giá mỗi provider khớp với mức hiện tại
+3. Cập nhật giá nếu provider thay đổi
+4. Liên hệ support nếu vẫn lệch
+
+**Issue: Thời gian reset không cập nhật**
+
+**Giải pháp:**
+1. Refresh dashboard (F5)
+2. Kiểm tra thời gian hệ thống đúng
+3. Xác minh cài đặt timezone
+4. Khởi động lại 9Router nếu vẫn lỗi
+
+**Issue: Không nhận được cảnh báo**
+
+**Giải pháp:**
+1. Dashboard → Settings → Alerts
+2. Xác minh địa chỉ email đúng
+3. Kiểm tra folder spam
+4. Test notification (nút Send Test)
+
+---
+
+## Liên quan
+
+- [Smart Routing](./smart-routing.md) - Auto fallback dựa trên quota
+- [Combos](./combos.md) - Tạo chuỗi fallback tùy chỉnh
diff --git a/gitbook/content/vi/features/smart-routing.md b/gitbook/content/vi/features/smart-routing.md
new file mode 100644
index 0000000..277a74d
--- /dev/null
+++ b/gitbook/content/vi/features/smart-routing.md
@@ -0,0 +1,407 @@
+# Smart Routing & Auto Fallback
+
+9Router tự động định tuyến request qua provider tốt nhất hiện có bằng hệ thống fallback 3 tầng. Không bao giờ ngừng code vì giới hạn quota hay rate limiting.
+
+---
+
+## Cách hoạt động
+
+9Router dùng định tuyến thông minh để tối đa hóa subscription hiện có, giảm chi phí và đảm bảo khả dụng 24/7:
+
+```
+Request → 9Router → Check Tier 1 (Subscription)
+ ↓ quota exhausted
+ Check Tier 2 (Cheap)
+ ↓ budget limit
+ Check Tier 3 (Free)
+ ↓
+ Response
+```
+
+### Hệ thống Fallback 3 tầng
+
+**Tier 1: SUBSCRIPTION (Chính)**
+- Claude Code (Pro/Max)
+- OpenAI Codex (Plus/Pro)
+- Gemini CLI (MIỄN PHÍ 180K/tháng)
+- GitHub Copilot
+- Antigravity (Google)
+
+**Mục tiêu**: Tối đa giá trị từ subscription đã trả tiền.
+
+**Tier 2: CHEAP (Backup)**
+- GLM-4.7 ($0.60/1M input)
+- MiniMax M2.1 ($0.20/1M input)
+- Kimi K2 ($9/tháng cố định)
+
+**Mục tiêu**: Backup siêu rẻ khi hết quota subscription (~90% rẻ hơn ChatGPT API).
+
+**Tier 3: FREE (Khẩn cấp)**
+- iFlow (8 models)
+- Qwen (3 models)
+- Kiro (Claude MIỄN PHÍ)
+
+**Mục tiêu**: Fallback chi phí 0 để code không giới hạn.
+
+---
+
+## Chuyển đổi Tự động
+
+9Router giám sát quota thời gian thực và chuyển provider tự động:
+
+### Kịch bản 1: Hết Quota Subscription
+
+```
+User request → cc/claude-opus-4-5
+ ↓ quota exhausted (5-hour limit reached)
+ Auto switch → glm/glm-4.7
+ ↓ daily quota exhausted
+ Auto switch → minimax/MiniMax-M2.1
+ ↓ 5-hour quota exhausted
+ Auto switch → if/kimi-k2-thinking (FREE)
+ ↓
+ Response delivered ✅
+```
+
+**Kết quả**: Zero downtime, trải nghiệm liền mạch.
+
+### Kịch bản 2: Rate Limiting
+
+```
+User request → cx/gpt-5.2-codex
+ ↓ rate limited (too many requests)
+ Auto switch → glm/glm-4.7
+ ↓
+ Response delivered ✅
+```
+
+### Kịch bản 3: Provider không khả dụng
+
+```
+User request → cc/claude-opus-4-5
+ ↓ provider error (503)
+ Auto switch → next available model
+ ↓
+ Response delivered ✅
+```
+
+---
+
+## Logic chọn Model
+
+9Router chọn model tốt nhất dựa trên:
+
+1. **Khả dụng quota** - Kiểm tra provider còn quota không
+2. **Tier chi phí** - Ưu tiên subscription → cheap → free
+3. **Thời gian reset** - Cân nhắc khi quota reset
+4. **Sức khỏe provider** - Bỏ qua provider có lỗi
+
+### Ví dụ Thứ tự Ưu tiên
+
+Cho request đến `cc/claude-opus-4-5`:
+
+```
+1. Check Claude Code quota
+ ✅ Available → Use cc/claude-opus-4-5
+ ❌ Exhausted → Continue to step 2
+
+2. Check fallback tier (if configured)
+ ✅ GLM quota available → Use glm/glm-4.7
+ ❌ Exhausted → Continue to step 3
+
+3. Check free tier
+ ✅ iFlow available → Use if/kimi-k2-thinking
+ ❌ All exhausted → Return quota error
+```
+
+---
+
+## Tùy chọn Cấu hình
+
+### Cài đặt Dashboard
+
+**1. Bật/Tắt Auto Fallback**
+
+```
+Dashboard → Settings → Smart Routing
+→ Toggle "Auto Fallback" ON/OFF
+```
+
+- **ON** (mặc định): Chuyển tier tự động
+- **OFF**: Strict mode, trả lỗi nếu model chính không khả dụng
+
+**2. Đặt Giới hạn Ngân sách**
+
+```
+Dashboard → Settings → Budget Control
+→ Daily limit: $5
+→ Monthly limit: $50
+```
+
+Khi đạt ngân sách, 9Router tự động chuyển sang free tier.
+
+**3. Cấu hình Thứ tự Fallback**
+
+```
+Dashboard → Settings → Fallback Priority
+→ Drag to reorder providers within each tier
+```
+
+Ví dụ thứ tự tùy chỉnh:
+```
+Tier 1: Gemini CLI → Claude Code → Codex
+Tier 2: MiniMax → GLM → Kimi
+Tier 3: iFlow → Kiro → Qwen
+```
+
+**4. Thông báo Reset Quota**
+
+```
+Dashboard → Settings → Notifications
+→ Email when quota resets
+→ Alert when 80% quota used
+```
+
+---
+
+## Ví dụ
+
+### Ví dụ 1: Auto Fallback Cơ bản
+
+**Setup:**
+```
+Model: cc/claude-opus-4-5-20251101
+Fallback: Auto (default 3-tier)
+```
+
+**Hoạt động:**
+```
+Morning (fresh quota):
+ Request → cc/claude-opus-4-5 ✅
+
+Afternoon (quota exhausted):
+ Request → glm/glm-4.7 ✅ (auto switched)
+
+Evening (GLM quota out):
+ Request → minimax/MiniMax-M2.1 ✅ (auto switched)
+
+Late night (all paid quota out):
+ Request → if/kimi-k2-thinking ✅ (free tier)
+```
+
+**Chi phí**: ~$5-10/tháng extra (chủ yếu được bao bởi subscription).
+
+### Ví dụ 2: Định tuyến theo Ngân sách
+
+**Setup:**
+```
+Dashboard → Settings:
+ Daily budget: $2
+ Monthly budget: $20
+ Fallback: Enabled
+```
+
+**Hoạt động:**
+```
+Day 1-15 (within budget):
+ Requests → glm/glm-4.7 (cheap tier)
+ Cost: $1.50/day
+
+Day 16 (budget reached):
+ Requests → if/kimi-k2-thinking (free tier)
+ Cost: $0
+
+Next month (budget resets):
+ Requests → glm/glm-4.7 again
+```
+
+**Kết quả**: Không bao giờ vượt $20/tháng, luôn khả dụng.
+
+### Ví dụ 3: Chế độ Chỉ Subscription
+
+**Setup:**
+```
+Dashboard → Settings:
+ Auto Fallback: OFF
+ Strict mode: ON
+```
+
+**Hoạt động:**
+```
+Request → cc/claude-opus-4-5
+ ✅ Quota available → Success
+ ❌ Quota exhausted → Return error (no fallback)
+```
+
+**Use case**: Khi chỉ muốn dùng subscription trả phí, không phí thêm.
+
+### Ví dụ 4: Chế độ Chỉ Free
+
+**Setup:**
+```
+Model: if/kimi-k2-thinking
+Fallback: qw/qwen3-coder-plus → kr/claude-sonnet-4.5
+```
+
+**Hoạt động:**
+```
+All requests → Free tier only
+Cost: $0 forever
+```
+
+**Use case**: Dự án cá nhân, học tập, thử nghiệm.
+
+---
+
+## Best Practices
+
+### 1. Tối đa Giá trị Subscription
+
+```
+Strategy:
+- Set subscription models as Tier 1
+- Monitor quota usage in dashboard
+- Use cheap tier only when subscription exhausted
+```
+
+**Ví dụ combo:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 2. Tối ưu Chi phí
+
+```
+Strategy:
+- Use Gemini CLI free tier first (180K/month)
+- Fallback to GLM/MiniMax (ultra-cheap)
+- Emergency: iFlow (free)
+```
+
+**Ví dụ combo:**
+```
+gc/gemini-3-flash-preview → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 3. Tối ưu Chất lượng
+
+```
+Strategy:
+- Use best models (Claude Opus, GPT-5.2)
+- Fallback to good cheap models (GLM-4.7)
+- Last resort: Free tier
+```
+
+**Ví dụ combo:**
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → glm/glm-4.7
+```
+
+### 4. Khả dụng 24/7
+
+```
+Strategy:
+- Always include free tier in fallback
+- Monitor quota reset times
+- Distribute usage across providers
+```
+
+**Ví dụ combo:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+**Kết quả**: Không bao giờ hết quota, code mọi lúc.
+
+---
+
+## Chiến lược Reset Quota
+
+Lên kế hoạch usage quanh thời gian reset quota:
+
+| Provider | Quota Reset | Chiến lược |
+|----------|-------------|----------|
+| **Claude Code** | 5 giờ + hàng tuần | Dùng buổi sáng, quota mới |
+| **Codex** | 5 giờ + hàng tuần | Dùng sau khi hết quota Claude |
+| **Gemini CLI** | Hàng ngày (1K) + Hàng tháng (180K) | Dùng cả ngày |
+| **GLM-4.7** | Hàng ngày 10:00 AM | Dùng buổi tối, reset sáng hôm sau |
+| **MiniMax M2.1** | 5 giờ rolling | Dùng mọi lúc, theo rolling window |
+| **iFlow/Qwen/Kiro** | Không giới hạn | Backup khẩn cấp |
+
+**Ví dụ lịch hàng ngày:**
+```
+08:00 - 13:00: Claude Code (fresh 5h quota)
+13:00 - 18:00: Gemini CLI (1K/day quota)
+18:00 - 22:00: GLM-4.7 (cheap, resets 10AM)
+22:00 - 08:00: MiniMax or iFlow (5h rolling or free)
+```
+
+---
+
+## Giám sát & Cảnh báo
+
+### Dashboard Quota Tracker
+
+```
+Dashboard → Quota Overview:
+ Claude Code: 2.5h / 5h remaining (50%)
+ Gemini CLI: 450 / 1000 requests today
+ GLM-4.7: 5M / 10M tokens (resets in 8h)
+ MiniMax: 3M / 5M tokens (rolling 5h)
+```
+
+### Thông báo Thời gian thực
+
+```
+Dashboard → Notifications:
+ ⚠️ Claude Code quota 80% used (1h remaining)
+ ✅ GLM-4.7 quota reset (10M tokens available)
+ 💰 Daily budget 50% used ($2.50 / $5)
+```
+
+### Usage Analytics
+
+```
+Dashboard → Analytics:
+ Today: 50M tokens
+ - 30M via Claude Code (subscription)
+ - 15M via GLM-4.7 ($9)
+ - 5M via iFlow (free)
+
+ Cost: $9 (vs $1000 on ChatGPT API)
+ Savings: 99%
+```
+
+---
+
+## Troubleshooting
+
+**Issue: "All providers quota exhausted"**
+
+**Giải pháp:**
+1. Kiểm tra quota tracker trong dashboard
+2. Đợi quota reset (xem countdown)
+3. Thêm free tier vào fallback chain
+4. Hoặc tăng giới hạn ngân sách
+
+**Issue: "Too many fallback switches"**
+
+**Giải pháp:**
+1. Kiểm tra provider chính có down không
+2. Tăng giới hạn quota (upgrade subscription)
+3. Dùng model chính rẻ hơn (GLM thay vì Claude)
+
+**Issue: "Unexpected costs"**
+
+**Giải pháp:**
+1. Dashboard → Analytics → Xem usage
+2. Đặt giới hạn ngân sách hàng ngày/tháng
+3. Chuyển sang free tier cho task không quan trọng
+4. Dùng combo với free fallback
+
+---
+
+## Liên quan
+
+- [Combos](./combos.md) - Tạo chuỗi fallback tùy chỉnh
+- [Quota Tracking](./quota-tracking.md) - Theo dõi usage và chi phí
diff --git a/gitbook/content/vi/getting-started/installation.md b/gitbook/content/vi/getting-started/installation.md
new file mode 100644
index 0000000..8e38773
--- /dev/null
+++ b/gitbook/content/vi/getting-started/installation.md
@@ -0,0 +1,478 @@
+# Cài đặt
+
+Hướng dẫn cài đặt chi tiết cho 9Router với mẹo troubleshooting.
+
+---
+
+## Yêu cầu
+
+### Yêu cầu hệ thống
+
+- **Node.js**: Phiên bản 20.0.0 trở lên
+- **npm**: Phiên bản 10.0.0 trở lên (đi kèm Node.js)
+- **OS**: macOS, Linux, Windows (khuyên dùng WSL)
+- **Dung lượng**: ~200MB để cài đặt
+
+### Kiểm tra Phiên bản
+
+```bash
+node --version
+# Should show v20.x.x or higher
+
+npm --version
+# Should show 10.x.x or higher
+```
+
+**Chưa có Node.js?** Cài đặt từ [nodejs.org](https://nodejs.org/)
+
+---
+
+## Phương thức Cài đặt
+
+### Cách 1: Cài Global (Khuyên dùng)
+
+Cài 9Router toàn cục để dùng ở bất kỳ đâu:
+
+```bash
+npm install -g 9router
+```
+
+**Khởi động 9Router:**
+
+```bash
+9router
+```
+
+**Lợi ích:**
+- ✅ Chạy từ mọi thư mục
+- ✅ Lệnh đơn giản: `9router`
+- ✅ Auto-update với `npm update -g 9router`
+
+### Cách 2: Cài Local
+
+Cài trong project cụ thể:
+
+```bash
+mkdir my-9router
+cd my-9router
+npm install 9router
+```
+
+**Khởi động 9Router:**
+
+```bash
+npx 9router
+```
+
+**Lợi ích:**
+- ✅ Cô lập mỗi project
+- ✅ Version control mỗi project
+- ✅ Không làm bẩn global namespace
+
+### Cách 3: Từ Source (Development)
+
+Clone và build từ GitHub:
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install
+npm run build
+npm start
+```
+
+**Lợi ích:**
+- ✅ Tính năng phát triển mới nhất
+- ✅ Đóng góp cho dự án
+- ✅ Tùy chỉnh
+
+---
+
+## Lần chạy Đầu tiên
+
+### Khởi động Server
+
+```bash
+9router
+```
+
+**Điều gì xảy ra:**
+1. Server khởi động tại `http://localhost:20128`
+2. Dashboard tự động mở trong browser
+3. Data directory được tạo tại `~/.9router`
+4. API key được tạo tự động
+
+### Đăng nhập Dashboard
+
+**Credentials mặc định:**
+- Mật khẩu: `123456`
+
+**⚠️ Đổi mật khẩu ngay:**
+1. Đăng nhập dashboard
+2. Settings → Change Password
+3. Dùng mật khẩu mạnh
+
+### Lấy API Key
+
+```
+Dashboard → Settings → API Keys
+→ Copy your API key
+→ Use in CLI tools
+```
+
+**Ví dụ format API key:**
+```
+9r_1234567890abcdef1234567890abcdef
+```
+
+---
+
+## Xác minh Cài đặt
+
+### Kiểm tra trạng thái Server
+
+```bash
+curl http://localhost:20128/health
+```
+
+**Phản hồi dự kiến:**
+```json
+{
+ "status": "ok",
+ "version": "1.0.0"
+}
+```
+
+### Liệt kê Model khả dụng
+
+```bash
+curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+```
+
+**Phản hồi dự kiến:**
+```json
+{
+ "object": "list",
+ "data": [
+ {
+ "id": "cc/claude-opus-4-5-20251101",
+ "object": "model",
+ "created": 1234567890,
+ "owned_by": "claude-code"
+ }
+ ]
+}
+```
+
+### Test Chat Completion
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "cc/claude-opus-4-5-20251101",
+ "messages": [
+ {"role": "user", "content": "Hello!"}
+ ]
+ }'
+```
+
+---
+
+## Cấu hình
+
+### Biến môi trường
+
+Tạo file `.env` hoặc set biến môi trường:
+
+```bash
+# Security (REQUIRED in production)
+export JWT_SECRET="your-secure-secret-change-this"
+export INITIAL_PASSWORD="your-password"
+
+# Storage
+export DATA_DIR="~/.9router"
+
+# Server
+export PORT="20128"
+export NODE_ENV="production"
+
+# Logging
+export ENABLE_REQUEST_LOGS="false"
+```
+
+### Data Directory
+
+**Vị trí mặc định:** `~/.9router`
+
+**Nội dung:**
+```
+~/.9router/
+ ├── db.json # Database (providers, combos, usage)
+ ├── api-keys.json # API keys
+ └── logs/ # Request logs (if enabled)
+```
+
+**Đổi vị trí:**
+
+```bash
+export DATA_DIR="/custom/path"
+9router
+```
+
+### Cấu hình Port
+
+**Port mặc định:** `20128`
+
+**Đổi port:**
+
+```bash
+export PORT="3000"
+9router
+```
+
+**Hoặc dùng command line:**
+
+```bash
+9router --port 3000
+```
+
+---
+
+## Troubleshooting
+
+### Port đã được dùng
+
+**Lỗi:**
+```
+Error: listen EADDRINUSE: address already in use :::20128
+```
+
+**Giải pháp 1: Kill process hiện có**
+
+```bash
+# Find process using port 20128
+lsof -i :20128
+
+# Kill process
+kill -9
+```
+
+**Giải pháp 2: Dùng port khác**
+
+```bash
+9router --port 3000
+```
+
+### Permission Denied
+
+**Lỗi:**
+```
+Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/9router'
+```
+
+**Giải pháp: Dùng sudo (không khuyến nghị) hoặc fix npm permissions**
+
+```bash
+# Fix npm permissions (recommended)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+
+# Then install again
+npm install -g 9router
+```
+
+### Node.js Phiên bản quá cũ
+
+**Lỗi:**
+```
+Error: The engine "node" is incompatible with this module
+```
+
+**Giải pháp: Cập nhật Node.js**
+
+```bash
+# Using nvm (recommended)
+nvm install 20
+nvm use 20
+
+# Or download from nodejs.org
+```
+
+### Dashboard không mở
+
+**Vấn đề:** Dashboard không tự mở
+
+**Giải pháp 1: Mở thủ công**
+
+```
+http://localhost:20128
+```
+
+**Giải pháp 2: Kiểm tra firewall**
+
+```bash
+# macOS: Allow Node.js in System Preferences → Security
+# Linux: Check iptables
+# Windows: Check Windows Firewall
+```
+
+### Không kết nối được Provider
+
+**Vấn đề:** OAuth login thất bại hoặc API key không hợp lệ
+
+**Giải pháp 1: Kiểm tra kết nối internet**
+
+```bash
+ping google.com
+```
+
+**Giải pháp 2: Kiểm tra trạng thái provider**
+
+- Claude Code: [status.anthropic.com](https://status.anthropic.com)
+- OpenAI: [status.openai.com](https://status.openai.com)
+- Gemini: [status.cloud.google.com](https://status.cloud.google.com)
+
+**Giải pháp 3: Tạo lại API key**
+
+```
+Dashboard → Provider → Disconnect → Reconnect
+```
+
+### Sử dụng RAM cao
+
+**Vấn đề:** 9Router dùng quá nhiều RAM
+
+**Giải pháp: Khởi động lại server**
+
+```bash
+# Stop
+pkill -f 9router
+
+# Start
+9router
+```
+
+**Hoặc dùng PM2 để auto-restart:**
+
+```bash
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+```
+
+---
+
+## Tùy chọn Deployment
+
+### Phát triển cục bộ
+
+```bash
+npm install -g 9router
+9router
+```
+
+**Use case:** Code cá nhân, testing
+
+### VPS/Cloud Server
+
+```bash
+# Install
+npm install -g 9router
+
+# Configure
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+# Start with PM2
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+pm2 startup
+```
+
+**Use case:** Team access, remote coding
+
+### Docker
+
+```bash
+docker pull 9router/9router:latest
+
+docker run -d \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret" \
+ -e INITIAL_PASSWORD="your-password" \
+ -v 9router-data:/root/.9router \
+ --name 9router \
+ 9router/9router:latest
+```
+
+**Use case:** Containerized deployment, Kubernetes
+
+### Reverse Proxy (Nginx)
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ location / {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+
+ # SSE support for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+**Use case:** HTTPS, custom domain, load balancing
+
+---
+
+## Gỡ cài đặt
+
+### Gỡ Global Installation
+
+```bash
+npm uninstall -g 9router
+```
+
+### Xóa Data Directory
+
+```bash
+rm -rf ~/.9router
+```
+
+### Xóa Cấu hình
+
+```bash
+# Remove environment variables from shell config
+nano ~/.bashrc # or ~/.zshrc
+# Delete 9router-related exports
+```
+
+---
+
+## Bước tiếp theo
+
+- [Hướng dẫn Bắt đầu](../getting-started.md) - Kết nối provider và bắt đầu code
+- [Tính năng](../features/) - Khám phá quota tracking, combos, deployment
+- [Troubleshooting](../troubleshooting.md) - Sửa các vấn đề thường gặp
+
+---
+
+## Cần trợ giúp?
+
+- **Website**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/vi/getting-started/quick-start.md b/gitbook/content/vi/getting-started/quick-start.md
new file mode 100644
index 0000000..ab16ff8
--- /dev/null
+++ b/gitbook/content/vi/getting-started/quick-start.md
@@ -0,0 +1,247 @@
+# Bắt đầu
+
+Khởi chạy 9Router trong 5 phút và bắt đầu định tuyến các request AI một cách thông minh.
+
+---
+
+## Bắt đầu nhanh
+
+### 1. Cài đặt
+
+```bash
+npm install -g 9router
+```
+
+**Yêu cầu:** Node.js 20+ ([Chi tiết cài đặt](getting-started/installation.md))
+
+### 2. Khởi chạy
+
+```bash
+9router
+```
+
+🎉 **Dashboard tự động mở** tại `http://localhost:20128`
+
+- Mật khẩu mặc định: `123456` (đổi trong dashboard)
+- API key được tạo tự động
+- Sẵn sàng kết nối provider
+
+### 3. Kết nối Provider
+
+Bạn có 3 cách để kết nối provider:
+
+#### Cách A: OAuth (Subscription Provider)
+
+**Tốt nhất cho:** Claude Code, Codex, Gemini CLI, GitHub Copilot
+
+```
+Dashboard → Providers → Connect [Provider]
+→ OAuth login → Auto token refresh
+→ Quota tracking enabled
+```
+
+**Ví dụ: Claude Code**
+1. Click "Connect Claude Code"
+2. Đăng nhập tài khoản Claude
+3. Cho phép 9Router
+4. ✅ Xong! Dùng model: `cc/claude-opus-4-5-20251101`
+
+#### Cách B: API Key (Cheap Provider)
+
+**Tốt nhất cho:** GLM, MiniMax, Kimi, OpenRouter
+
+```
+Dashboard → Providers → Add API Key
+→ Select provider
+→ Paste API key
+→ Save
+```
+
+**Ví dụ: GLM-4.7**
+1. Đăng ký tại [Zhipu AI](https://open.bigmodel.cn/)
+2. Lấy API key từ Coding Plan
+3. Dashboard → Add API Key → Provider: `glm` → Paste key
+4. ✅ Xong! Dùng model: `glm/glm-4.7`
+
+#### Cách C: Free Provider (Miễn phí)
+
+**Tốt nhất cho:** iFlow, Qwen, Kiro
+
+```
+Dashboard → Providers → Connect [Free Provider]
+→ Device code or OAuth
+→ Unlimited usage
+```
+
+**Ví dụ: iFlow**
+1. Click "Connect iFlow"
+2. Đăng nhập tài khoản iFlow
+3. Cho phép
+4. ✅ Xong! Dùng 8 model: `if/kimi-k2-thinking`, `if/qwen3-coder-plus`, v.v.
+
+---
+
+## 4. Dùng trong CLI Tools
+
+Trỏ công cụ code của bạn tới 9Router:
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Claude Desktop
+
+Sửa `~/.claude/config.json`:
+
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key"
+}
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [from dashboard]
+Model: cc/claude-opus-4-5-20251101
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex "your prompt"
+```
+
+---
+
+## 5. Tạo Smart Combos (Tùy chọn)
+
+Combo cho phép fallback tự động giữa các model:
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. cc/claude-opus-4-5-20251101 (Subscription primary)
+ 2. glm/glm-4.7 (Cheap backup, $0.6/1M)
+ 3. if/kimi-k2-thinking (Free fallback)
+
+Use in CLI: premium-coding
+```
+
+**Cách hoạt động:**
+1. Thử Claude Opus trước (subscription của bạn)
+2. Nếu hết quota → GLM-4.7 (siêu rẻ)
+3. Nếu hết budget → iFlow (miễn phí)
+4. Zero downtime, chuyển đổi tự động!
+
+---
+
+## Model có sẵn
+
+### Subscription Models (Dùng đầu tiên)
+
+**Claude Code (`cc/`)** - Subscription Pro/Max:
+- `cc/claude-opus-4-5-20251101` - Claude 4.5 Opus
+- `cc/claude-sonnet-4-5-20250929` - Claude 4.5 Sonnet
+- `cc/claude-haiku-4-5-20251001` - Claude 4.5 Haiku
+
+**Codex (`cx/`)** - Subscription Plus/Pro:
+- `cx/gpt-5.2-codex` - GPT 5.2 Codex
+- `cx/gpt-5.1-codex-max` - GPT 5.1 Codex Max
+
+**Gemini CLI (`gc/`)** - MIỄN PHÍ 180K/tháng:
+- `gc/gemini-3-flash-preview` - Gemini 3 Flash Preview
+- `gc/gemini-2.5-pro` - Gemini 2.5 Pro
+
+**GitHub Copilot (`gh/`)** - Subscription:
+- `gh/gpt-5` - GPT-5
+- `gh/claude-4.5-sonnet` - Claude 4.5 Sonnet
+
+### Cheap Models (Backup)
+
+**GLM (`glm/`)** - $0.6/$2.2 per 1M:
+- `glm/glm-4.7` - GLM 4.7 (reset 10AM hàng ngày)
+
+**MiniMax (`minimax/`)** - $0.20/$1.00 per 1M:
+- `minimax/MiniMax-M2.1` - MiniMax M2.1 (reset 5h)
+
+**Kimi (`kimi/`)** - $9/tháng (10M tokens):
+- `kimi/kimi-latest` - Kimi Latest
+
+### Model MIỄN PHÍ (Khẩn cấp)
+
+**iFlow (`if/`)** - 8 models MIỄN PHÍ:
+- `if/kimi-k2-thinking` - Kimi K2 Thinking
+- `if/qwen3-coder-plus` - Qwen3 Coder Plus
+- `if/glm-4.7` - GLM 4.7
+- `if/deepseek-r1` - DeepSeek R1
+
+**Qwen (`qw/`)** - 3 models MIỄN PHÍ:
+- `qw/qwen3-coder-plus` - Qwen3 Coder Plus
+- `qw/qwen3-coder-flash` - Qwen3 Coder Flash
+
+**Kiro (`kr/`)** - 2 models MIỄN PHÍ:
+- `kr/claude-sonnet-4.5` - Claude Sonnet 4.5
+- `kr/claude-haiku-4.5` - Claude Haiku 4.5
+
+---
+
+## Chiến lược Tối ưu Chi phí
+
+### Ngân sách hàng tháng: $10-20/tháng
+
+```
+1. Use Gemini CLI free tier (180K/month) for quick tasks
+2. Use Claude Code subscription quota fully (you already pay)
+3. Fallback to GLM ($0.6/1M) when quota out
+4. Emergency: MiniMax M2.1 ($0.20/1M) or iFlow (free)
+
+Real example (100M tokens/month):
+ 60M via Gemini CLI: $0 (free tier)
+ 30M via Claude Code: $0 (subscription you already have)
+ 8M via GLM: $4.80
+ 2M via MiniMax: $0.40
+ Total: $5.20/month + existing subscriptions
+```
+
+### Chiến lược Reset Quota
+
+```
+Daily routine:
+1. Morning: Fresh Claude Code quota (5h reset)
+2. Afternoon: Switch to Gemini CLI (1K/day)
+3. Evening: GLM daily quota (reset 10AM next day)
+4. Late night: MiniMax (5h rolling) or iFlow (free)
+
+→ Code 24/7 with minimal extra cost!
+```
+
+---
+
+## Bước tiếp theo
+
+- [Chi tiết cài đặt](getting-started/installation.md) - Yêu cầu, troubleshooting
+- [Tính năng](features/) - Khám phá quota tracking, combos, deployment
+- [FAQ](faq.md) - Câu hỏi thường gặp
+- [Troubleshooting](troubleshooting.md) - Sửa các vấn đề phổ biến
+
+---
+
+## Cần trợ giúp?
+
+- **Website**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/vi/index.md b/gitbook/content/vi/index.md
new file mode 100644
index 0000000..7ef5f66
--- /dev/null
+++ b/gitbook/content/vi/index.md
@@ -0,0 +1,164 @@
+# Chào mừng đến với 9Router
+
+**Dùng Claude, Codex, Gemini MIỄN PHÍ • Lựa chọn siêu rẻ từ $0.20/1M tokens**
+
+9Router là bộ định tuyến mô hình AI giúp tối đa hóa giá trị subscription và giảm chi phí thông qua định tuyến thông minh và fallback tự động.
+
+---
+
+## 9Router là gì?
+
+9Router là một proxy thông minh nằm giữa các công cụ lập trình của bạn (Cursor, Cline, Claude Desktop) và các nhà cung cấp AI. Nó tự động định tuyến request đến model tốt nhất hiện có dựa trên quota, chi phí và tính khả dụng.
+
+**Đừng lãng phí tiền:**
+- ❌ Quota subscription hết hạn mỗi tháng mà không dùng đến
+- ❌ Rate limit chặn bạn đang lập trình
+- ❌ API đắt đỏ ($20-50/tháng cho mỗi provider)
+- ❌ Chuyển đổi provider thủ công
+
+**Bắt đầu tối đa hóa giá trị:**
+- ✅ **Tối đa Subscription** - Theo dõi và dùng từng chút quota của Claude Code, Codex, Gemini
+- ✅ **MIỄN PHÍ** - Truy cập model iFlow, Qwen, Kiro qua CLI
+- ✅ **Backup siêu rẻ** - GLM ($0.6/1M), MiniMax M2.1 ($0.20/1M)
+- ✅ **Smart Fallback** - Subscription → Cheap → Free, chuyển đổi tự động
+
+---
+
+## Tính năng chính
+
+### 🔄 Smart 3-Tier Fallback
+
+```
+Setup once, never stop coding:
+
+Tier 1 (SUBSCRIPTION): Claude Code → Codex → Gemini
+ ↓ quota exhausted
+Tier 2 (CHEAP): GLM-4.7 → MiniMax M2.1 → Kimi
+ ↓ budget limit
+Tier 3 (FREE): iFlow → Qwen → Kiro
+
+→ Automatic switching, zero downtime!
+```
+
+### 📊 Theo dõi Quota
+
+- Tiêu thụ token thời gian thực cho mỗi provider
+- Đếm ngược reset (5 giờ, hàng ngày, hàng tuần, hàng tháng)
+- Ước tính chi phí cho tier trả phí
+- Báo cáo chi tiêu hàng tháng
+
+### 🎯 Hỗ trợ CLI Toàn diện
+
+Hoạt động với mọi công cụ hỗ trợ custom OpenAI endpoint:
+
+✅ **Cursor** • **Cline** • **Claude Desktop** • **Codex** • **RooCode** • **Continue** • **Bất kỳ tool nào tương thích OpenAI**
+
+### 💰 Tối ưu Chi phí
+
+**Ví dụ thực tế (100M tokens/tháng):**
+```
+60M qua Gemini CLI: $0 (free tier)
+30M qua Claude Code: $0 (subscription đã có)
+8M qua GLM: $4.80
+2M qua MiniMax: $0.40
+Tổng: $5.20/tháng so với $2000 trên ChatGPT API!
+```
+
+---
+
+## Tại sao chọn 9Router?
+
+### Tối đa hóa Subscription
+
+Đã trả tiền cho Claude Code ($20-100/tháng) hoặc Codex ($20-200/tháng)? Nhận giá trị đầy đủ:
+
+- Theo dõi sử dụng quota thời gian thực
+- Tự động chuyển khi quota reset (5 giờ, hàng tuần)
+- Dùng hết mọi token trước khi hết hạn
+- Gemini CLI: 180K completions/tháng **MIỄN PHÍ**
+
+### Backup Siêu Rẻ
+
+Khi quota subscription hết, trả vài xu:
+
+| Provider | Giá per 1M tokens | Reset |
+|----------|-------------------|-------|
+| **GLM-4.7** | $0.60 input / $2.20 output | Hàng ngày 10:00 AM |
+| **MiniMax M2.1** | $0.20 input / $1.00 output | 5 giờ rolling |
+| **Kimi K2** | $9/tháng (10M tokens) | Hàng tháng |
+
+**~90% rẻ hơn ChatGPT API ($20/1M)!**
+
+### Fallback Miễn phí Mãi mãi
+
+Backup khẩn cấp khi mọi thứ khác đều bị giới hạn quota:
+
+- **iFlow**: 8 models (Kimi K2, Qwen3 Coder Plus, GLM 4.7, MiniMax M2)
+- **Qwen**: 3 models (Qwen3 Coder Plus/Flash, Vision)
+- **Kiro**: Claude Sonnet 4.5, Haiku 4.5 (AWS Builder ID)
+
+---
+
+## Bắt đầu nhanh
+
+Bắt đầu trong 2 phút:
+
+```bash
+# Install globally
+npm install -g 9router
+
+# Start (dashboard opens automatically)
+9router
+```
+
+🎉 **Dashboard mở** → Kết nối provider → Bắt đầu code!
+
+**Dùng trong CLI tool:**
+
+```
+Endpoint: http://localhost:20128/v1
+API Key: [from dashboard]
+Model: cc/claude-opus-4-5-20251101
+```
+
+[→ Hướng dẫn Bắt đầu đầy đủ](getting-started.md)
+
+---
+
+## Trường hợp sử dụng
+
+### Cho Developer cá nhân
+
+- Tối đa hóa subscription Claude Code/Codex
+- Dùng Gemini CLI free tier (180K/tháng)
+- Fallback sang model siêu rẻ ($0.20/1M)
+- Code 24/7 không bị rate limit
+
+### Cho Team
+
+- Triển khai trên VPS/Cloud để chia sẻ truy cập
+- Theo dõi chi tiêu team thời gian thực
+- Đặt giới hạn ngân sách cho mỗi tier
+- Quản lý provider tập trung
+
+### Cho Mobile/Remote Coding
+
+- Dùng cloud deployment (https://9router.com)
+- Truy cập từ iPad, điện thoại, mọi nơi
+- Không bị giới hạn localhost
+- Mạng Cloudflare edge (300+ vị trí)
+
+---
+
+## Tiếp theo là gì?
+
+- [Bắt đầu](getting-started.md) - Cài đặt và cấu hình trong 5 phút
+- [Hướng dẫn cài đặt](getting-started/installation.md) - Hướng dẫn setup chi tiết
+- [Tính năng](features/) - Khám phá mọi khả năng
+- [FAQ](faq.md) - Các câu hỏi thường gặp
+
+---
+
+
+ Built with ❤️ for developers maximizing AI value
+
diff --git a/gitbook/content/vi/integration/claude-code.md b/gitbook/content/vi/integration/claude-code.md
new file mode 100644
index 0000000..e4f9a08
--- /dev/null
+++ b/gitbook/content/vi/integration/claude-code.md
@@ -0,0 +1,109 @@
+# Tích hợp Claude Code
+
+Tích hợp 9Router với Claude Code CLI để định tuyến request API Anthropic qua hệ thống routing thông minh của 9Router.
+
+## Yêu cầu
+
+- Claude Code CLI đã cài đặt
+- 9Router đang chạy cục bộ hoặc cloud endpoint đã cấu hình
+- API key từ 9Router dashboard
+
+## Setup
+
+### 1. Cấu hình biến môi trường
+
+Đặt các biến môi trường sau trong file cấu hình shell (`~/.bashrc`, `~/.zshrc`, hoặc `~/.bash_profile`):
+
+```bash
+# Base URL for 9Router
+export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
+
+# Optional: Set default models for aliases
+export ANTHROPIC_DEFAULT_OPUS_MODEL="cc/claude-opus-4-5-20251101"
+export ANTHROPIC_DEFAULT_SONNET_MODEL="cc/claude-sonnet-4-5-20250929"
+export ANTHROPIC_DEFAULT_HAIKU_MODEL="cc/claude-haiku-4-5-20251001"
+```
+
+### 2. Reload Shell Configuration
+
+```bash
+source ~/.zshrc # or ~/.bashrc
+```
+
+### 3. Xác minh Cấu hình
+
+Kiểm tra các biến môi trường đã set đúng:
+
+```bash
+echo $ANTHROPIC_BASE_URL
+```
+
+## Model Aliases
+
+Claude Code hỗ trợ các alias model sau ánh xạ sang model 9Router:
+
+| Alias | Model | Biến môi trường |
+|-------|-------|---------------------|
+| `opus` | Claude Opus 4.5 | `ANTHROPIC_DEFAULT_OPUS_MODEL` |
+| `sonnet` | Claude Sonnet 4.5 | `ANTHROPIC_DEFAULT_SONNET_MODEL` |
+| `haiku` | Claude Haiku 4.5 | `ANTHROPIC_DEFAULT_HAIKU_MODEL` |
+
+## Ví dụ Sử dụng
+
+### Dùng Model Aliases
+
+```bash
+# Use Opus model
+claude --model opus "Explain quantum computing"
+
+# Use Sonnet model
+claude --model sonnet "Write a Python function"
+
+# Use Haiku model
+claude --model haiku "Quick code review"
+```
+
+### Dùng Full Model Names
+
+```bash
+claude --model cc/claude-opus-4-5-20251101 "Your prompt here"
+```
+
+## File Settings
+
+Claude Code lưu cấu hình trong `~/.claude/settings.json`. Bạn có thể sửa file này thủ công nếu cần:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "defaultModel": "sonnet"
+}
+```
+
+## Troubleshooting
+
+### Lỗi Connection
+
+Nếu gặp lỗi kết nối:
+
+1. Xác minh 9Router đang chạy: `curl http://localhost:20128/health`
+2. Kiểm tra biến môi trường đã set đúng
+3. Đảm bảo không firewall nào chặn port 20128
+
+### Model Not Found
+
+Nếu gặp lỗi "model not found":
+
+1. Xác minh tên model khớp với cấu hình 9Router
+2. Kiểm tra kết nối provider đang hoạt động trong 9Router dashboard
+3. Đảm bảo model có sẵn trong các provider đã kết nối
+
+## Cloud Endpoint
+
+Để dùng 9Router cloud endpoint thay vì localhost:
+
+```bash
+export ANTHROPIC_BASE_URL="https://9router.com"
+```
+
+Đảm bảo bạn đã cấu hình API key trong 9Router cloud dashboard.
diff --git a/gitbook/content/vi/integration/cline.md b/gitbook/content/vi/integration/cline.md
new file mode 100644
index 0000000..9917265
--- /dev/null
+++ b/gitbook/content/vi/integration/cline.md
@@ -0,0 +1,201 @@
+# Tích hợp Cline
+
+Tích hợp 9Router với extension Cline VSCode để định tuyến request AI qua hệ thống routing thông minh của 9Router.
+
+## Yêu cầu
+
+- Visual Studio Code đã cài đặt
+- Extension Cline đã cài đặt từ VSCode marketplace
+- 9Router đang chạy cục bộ hoặc cloud endpoint đã cấu hình
+- API key từ 9Router dashboard
+
+## Setup
+
+### 1. Mở Cline Settings
+
+1. Mở Visual Studio Code
+2. Mở panel extension Cline (click icon Cline trong sidebar)
+3. Click icon **Settings** (icon bánh răng) trong panel Cline
+
+### 2. Chọn API Provider
+
+1. Trong Cline settings, tìm dropdown **API Provider**
+2. Chọn **Ollama** từ danh sách
+ - Lưu ý: Chúng ta dùng provider type Ollama vì nó tương thích với API kiểu OpenAI
+
+### 3. Cấu hình Base URL
+
+Đặt base URL tới endpoint 9Router:
+
+**Cho 9Router cục bộ:**
+```
+http://localhost:20128/v1
+```
+
+**Cho 9Router cloud:**
+```
+https://9router.com
+```
+
+**Các bước:**
+1. Trong field **Base URL**, nhập endpoint 9Router
+2. Đảm bảo bao gồm `/v1` ở cuối
+
+### 4. Thêm API Key
+
+1. Trong field **API Key**, nhập API key 9Router của bạn
+2. Bạn có thể tìm API key trong 9Router dashboard tại **Settings → API Keys**
+3. Key bắt đầu bằng `sk-9router-`
+
+### 5. Chọn Model
+
+1. Trong dropdown **Model**, bạn có thể:
+ - Chọn từ model có sẵn (nếu Cline auto-detect)
+ - Nhập tên model thủ công từ cấu hình 9Router
+
+2. Tên model phổ biến:
+ - `gpt-4`
+ - `gpt-4o`
+ - `claude-opus-4-5`
+ - `claude-sonnet-4-5`
+ - `gemini-2.0-flash`
+
+### 6. Lưu Cấu hình
+
+Click **Save** hoặc đóng panel settings. Cline sẽ tự lưu cấu hình.
+
+## Ví dụ Cấu hình
+
+Cline settings của bạn nên trông như sau:
+
+```
+API Provider: Ollama
+Base URL: http://localhost:20128/v1
+API Key: sk-9router-xxxxxxxxxxxxx
+Model: gpt-4
+```
+
+## Model có sẵn
+
+Bạn có thể dùng bất kỳ model nào đã cấu hình trong 9Router dashboard. Ví dụ phổ biến:
+
+| Tên Model | Provider | Mô tả |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## Sử dụng
+
+### Chat với AI
+
+1. Mở panel Cline trong VSCode
+2. Gõ tin nhắn vào input chat
+3. Nhấn Enter để gửi
+4. Cline sẽ dùng 9Router để xử lý request
+
+### Tạo Code
+
+1. Yêu cầu Cline tạo code: "Create a React component for a login form"
+2. Cline sẽ tạo code qua 9Router
+3. Xem và chấp nhận code được tạo
+
+### Giải thích Code
+
+1. Chọn code trong editor
+2. Hỏi Cline: "Explain this code"
+3. Nhận giải thích AI qua 9Router
+
+### Thao tác File
+
+1. Yêu cầu Cline tạo, sửa hoặc xóa files
+2. Cline sẽ dùng 9Router để hiểu context và thực hiện thay đổi
+3. Xem thay đổi trước khi chấp nhận
+
+## Troubleshooting
+
+### Lỗi "Connection Failed"
+
+1. Xác minh 9Router đang chạy: `curl http://localhost:20128/health`
+2. Kiểm tra base URL đúng và bao gồm `/v1`
+3. Đảm bảo không firewall nào chặn port 20128
+4. Thử khởi động lại VSCode
+
+### Lỗi "Invalid API Key"
+
+1. Xác minh API key trong 9Router dashboard
+2. Đảm bảo bạn sao chép đầy đủ key bao gồm prefix `sk-9router-`
+3. Kiểm tra API key chưa hết hạn
+4. Thử tạo API key mới
+
+### Lỗi "Model Not Found"
+
+1. Xác minh tên model khớp chính xác với cấu hình 9Router
+2. Kiểm tra kết nối provider đang hoạt động trong 9Router dashboard
+3. Đảm bảo model có sẵn trong các provider đã kết nối
+4. Thử dùng tên model đầy đủ (ví dụ: `openai/gpt-4` thay vì `gpt-4`)
+
+### Cline không phản hồi
+
+1. Kiểm tra panel output Cline để xem thông báo lỗi
+2. Xác minh 9Router instance đang chạy và healthy
+3. Thử reload cửa sổ VSCode (Cmd/Ctrl + Shift + P → "Reload Window")
+4. Kiểm tra logs 9Router để xem lỗi
+
+## Cấu hình Nâng cao
+
+### Dùng Cloud Endpoint
+
+Để dùng 9Router cloud endpoint thay vì localhost:
+
+1. Trong Cline settings, đặt Base URL: `https://9router.com`
+2. Đảm bảo bạn đã cấu hình API key trong 9Router cloud dashboard
+3. Đảm bảo cloud endpoint đang hoạt động và truy cập được
+
+### Nhiều Model
+
+Bạn có thể chuyển nhanh giữa các model:
+
+1. Mở Cline settings
+2. Đổi field **Model** sang model khác
+3. Lưu và tiếp tục chat với model mới
+
+### Custom Timeout
+
+Nếu gặp vấn đề timeout với request lớn:
+
+1. Mở VSCode settings (Cmd/Ctrl + ,)
+2. Tìm "Cline timeout"
+3. Tăng giá trị timeout (mặc định thường là 30 giây)
+
+## Best Practices
+
+1. **Dùng Model phù hợp**: Chọn model nhanh (như Haiku hoặc Flash) cho task đơn giản, model mạnh hơn (như Opus hoặc GPT-4) cho task phức tạp
+2. **Theo dõi Usage**: Kiểm tra 9Router dashboard để xem thống kê và chi phí
+3. **Quản lý Context**: Giữ cuộc trò chuyện tập trung để giảm token usage
+4. **Chuyển Model**: Chuyển model dựa trên độ phức tạp task để tối ưu chi phí và hiệu năng
+5. **Bảo mật API Key**: Không bao giờ commit API key vào version control
+
+## Tích hợp với Tính năng 9Router
+
+### Định tuyến Model
+
+9Router tự động định tuyến request đến provider tốt nhất hiện có dựa trên:
+- Tính khả dụng của model
+- Trạng thái sức khỏe provider
+- Tối ưu chi phí
+- Load balancing
+
+### Hỗ trợ Fallback
+
+Nếu một provider thất bại, 9Router tự động fallback sang provider khác đã cấu hình trong dashboard.
+
+### Theo dõi Usage
+
+Giám sát usage Cline qua 9Router dashboard:
+- Tổng request
+- Token usage
+- Chi phí mỗi model
+- Phân bổ provider
diff --git a/gitbook/content/vi/integration/codex.md b/gitbook/content/vi/integration/codex.md
new file mode 100644
index 0000000..1d2a76e
--- /dev/null
+++ b/gitbook/content/vi/integration/codex.md
@@ -0,0 +1,136 @@
+# Tích hợp OpenAI Codex CLI
+
+Tích hợp 9Router với OpenAI Codex CLI để định tuyến request API OpenAI qua hệ thống routing thông minh của 9Router.
+
+## Yêu cầu
+
+- OpenAI Codex CLI đã cài đặt
+- 9Router đang chạy cục bộ hoặc cloud endpoint đã cấu hình
+- API key từ 9Router dashboard
+
+## Setup
+
+### 1. Cấu hình biến môi trường
+
+Đặt các biến môi trường sau trong file cấu hình shell (`~/.bashrc`, `~/.zshrc`, hoặc `~/.bash_profile`):
+
+```bash
+# Base URL for 9Router
+export OPENAI_BASE_URL="http://localhost:20128/v1"
+
+# API Key from 9Router dashboard
+export OPENAI_API_KEY="your-9router-api-key"
+```
+
+### 2. Reload Shell Configuration
+
+```bash
+source ~/.zshrc # or ~/.bashrc
+```
+
+### 3. Xác minh Cấu hình
+
+Kiểm tra các biến môi trường đã set đúng:
+
+```bash
+echo $OPENAI_BASE_URL
+echo $OPENAI_API_KEY
+```
+
+## Model có sẵn
+
+9Router cung cấp các model Codex sau:
+
+| Model ID | Mô tả |
+|----------|-------------|
+| `cx/gpt-5.2-codex` | GPT-5.2 Codex - Phiên bản mới nhất |
+| `cx/gpt-5.1-codex-max` | GPT-5.1 Codex Max - Extended context |
+
+## Ví dụ Sử dụng
+
+### Sử dụng Cơ bản
+
+```bash
+# Use GPT-5.2 Codex
+codex --model cx/gpt-5.2-codex "Write a function to sort an array"
+
+# Use GPT-5.1 Codex Max
+codex --model cx/gpt-5.1-codex-max "Explain this complex algorithm"
+```
+
+### Tạo Code
+
+```bash
+codex --model cx/gpt-5.2-codex "Create a REST API endpoint for user authentication"
+```
+
+### Giải thích Code
+
+```bash
+codex --model cx/gpt-5.1-codex-max "Explain what this code does: $(cat myfile.js)"
+```
+
+## File Cấu hình
+
+Bạn cũng có thể cấu hình Codex CLI qua file cấu hình. Tạo hoặc sửa `~/.codex/config.json`:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "apiKey": "your-9router-api-key",
+ "defaultModel": "cx/gpt-5.2-codex"
+}
+```
+
+## Troubleshooting
+
+### Lỗi Xác thực
+
+Nếu gặp lỗi xác thực:
+
+1. Xác minh API key đúng trong 9Router dashboard
+2. Kiểm tra biến môi trường `OPENAI_API_KEY` đã set
+3. Đảm bảo API key chưa hết hạn
+
+### Lỗi Connection
+
+Nếu gặp lỗi kết nối:
+
+1. Xác minh 9Router đang chạy: `curl http://localhost:20128/health`
+2. Kiểm tra biến môi trường đã set đúng
+3. Đảm bảo không firewall nào chặn port 20128
+
+### Model không khả dụng
+
+Nếu gặp lỗi "model not available":
+
+1. Xác minh tên model khớp với cấu hình 9Router
+2. Kiểm tra kết nối provider OpenAI đang hoạt động trong 9Router dashboard
+3. Đảm bảo model có sẵn trong các provider đã kết nối
+
+## Cloud Endpoint
+
+Để dùng 9Router cloud endpoint thay vì localhost:
+
+```bash
+export OPENAI_BASE_URL="https://9router.com"
+```
+
+Đảm bảo bạn đã cấu hình API key trong 9Router cloud dashboard.
+
+## Cấu hình Nâng cao
+
+### Custom Timeout
+
+```bash
+export OPENAI_TIMEOUT=60 # seconds
+```
+
+### Debug Mode
+
+Bật debug mode để xem logs request/response chi tiết:
+
+```bash
+export CODEX_DEBUG=true
+codex --model cx/gpt-5.2-codex "Your prompt"
+```
diff --git a/gitbook/content/vi/integration/continue.md b/gitbook/content/vi/integration/continue.md
new file mode 100644
index 0000000..0aabef2
--- /dev/null
+++ b/gitbook/content/vi/integration/continue.md
@@ -0,0 +1,249 @@
+# Tích hợp Continue VSCode Extension
+
+Tích hợp 9Router với extension Continue để mang trợ lý AI trực tiếp vào Visual Studio Code.
+
+## Yêu cầu
+
+- Visual Studio Code đã cài đặt
+- Extension Continue đã cài đặt từ VSCode marketplace
+- 9Router API key từ [dashboard](https://9router.com/dashboard)
+- 9Router đang chạy (cục bộ hoặc cloud)
+
+## Các bước Cấu hình
+
+### 1. Mở Continue Configuration
+
+1. Mở VSCode
+2. Nhấn `Cmd+Shift+P` (Mac) hoặc `Ctrl+Shift+P` (Windows/Linux)
+3. Gõ "Continue: Open Config" và chọn
+4. Mở `~/.continue/config.json`
+
+### 2. Thêm Cấu hình Model 9Router
+
+Thêm cấu hình sau vào `config.json`:
+
+**Setup Một Model:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**Setup Nhiều Model:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus (Best)",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Sonnet (Balanced)",
+ "provider": "openai",
+ "model": "cc/claude-sonnet-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - DeepSeek Chat (Code)",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Haiku (Fast)",
+ "provider": "openai",
+ "model": "cc/claude-haiku-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**Cho Cloud 9Router:**
+Thay `apiBase` bằng:
+```json
+"apiBase": "https://9router.com/v1"
+```
+
+### 3. Lưu và Reload
+
+1. Lưu file cấu hình
+2. Reload cửa sổ VSCode: `Cmd+Shift+P` → "Developer: Reload Window"
+3. Extension Continue sẽ load cấu hình mới
+
+### 4. Chọn Model
+
+1. Mở sidebar Continue (click icon Continue trong panel trái)
+2. Click dropdown chọn model ở trên cùng
+3. Chọn model 9Router ưa thích
+
+## Model có sẵn
+
+### Claude Models (Anthropic)
+- `cc/claude-opus-4-5-20251101` - Mạnh nhất, tốt nhất cho task phức tạp
+- `cc/claude-sonnet-4-20250514` - Cân bằng hiệu năng và tốc độ
+- `cc/claude-haiku-4-20250514` - Nhanh nhất, phù hợp task đơn giản
+
+### DeepSeek Models
+- `cx/deepseek-chat` - Xuất sắc cho tạo code
+- `cx/deepseek-reasoner` - Tốt nhất cho giải quyết vấn đề phức tạp
+
+### GLM Models (Zhipu AI)
+- `glm/glm-4-plus` - Tiếng Trung và tiếng Anh nâng cao
+- `glm/glm-4-flash` - Phản hồi nhanh
+
+## Ví dụ Sử dụng
+
+### Giải thích Code
+1. Chọn code trong editor
+2. Mở sidebar Continue
+3. Gõ: "Explain this code"
+4. Model: `cc/claude-sonnet-4-20250514`
+
+### Tạo Code
+1. Mở sidebar Continue
+2. Gõ: "Create a React component for user profile card"
+3. Model: `cx/deepseek-chat`
+
+### Refactoring
+1. Chọn code để refactor
+2. Gõ: "Refactor this to use async/await"
+3. Model: `cc/claude-sonnet-4-20250514`
+
+### Sửa Bug
+1. Chọn code có vấn đề
+2. Gõ: "Find and fix the bug in this code"
+3. Model: `cx/deepseek-reasoner`
+
+## Cấu hình Nâng cao
+
+### Custom System Prompts
+
+Thêm system prompt tùy chỉnh cho hành vi cụ thể:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Code Expert",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "systemMessage": "You are an expert programmer. Always provide clean, well-documented code with best practices."
+ }
+ ]
+}
+```
+
+### Temperature và Parameters
+
+Điều chỉnh hành vi model với parameters:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Creative Writer",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "temperature": 0.9,
+ "topP": 0.95
+ }
+ ]
+}
+```
+
+### Context Providers
+
+Cấu hình context Continue gửi đến model:
+
+```json
+{
+ "contextProviders": [
+ {
+ "name": "code",
+ "params": {
+ "maxLines": 100
+ }
+ },
+ {
+ "name": "diff",
+ "params": {}
+ },
+ {
+ "name": "terminal",
+ "params": {}
+ }
+ ]
+}
+```
+
+## Phím tắt
+
+- `Cmd+L` (Mac) / `Ctrl+L` (Windows/Linux) - Mở Continue chat
+- `Cmd+I` (Mac) / `Ctrl+I` (Windows/Linux) - Inline edit
+- `Cmd+Shift+R` (Mac) / `Ctrl+Shift+R` (Windows/Linux) - Tạo lại response
+
+## Troubleshooting
+
+### Model không phản hồi
+- Kiểm tra 9Router đang chạy: `curl http://localhost:20128/health`
+- Xác minh API key trong config.json
+- Kiểm tra VSCode Developer Console để xem lỗi: `Help` → `Toggle Developer Tools`
+
+### Chọn sai Model
+- Click dropdown model trong sidebar Continue
+- Chọn đúng model 9Router
+- Tên model phải khớp chính xác (case-sensitive)
+
+### Cấu hình không Load
+- Xác minh JSON syntax hợp lệ (dùng JSON validator)
+- Kiểm tra vị trí file: `~/.continue/config.json`
+- Reload cửa sổ VSCode sau khi thay đổi
+
+### Hiệu năng Chậm
+- Chuyển sang model nhanh hơn (haiku, flash)
+- Giảm context size trong contextProviders
+- Kiểm tra độ trễ network đến 9Router
+
+## Best Practices
+
+### Chiến lược Chọn Model
+- **Edit nhanh**: Dùng `cc/claude-haiku-4-20250514`
+- **Tạo code**: Dùng `cx/deepseek-chat`
+- **Refactoring phức tạp**: Dùng `cc/claude-opus-4-5-20251101`
+- **Giải quyết vấn đề**: Dùng `cx/deepseek-reasoner`
+
+### Quản lý Context
+- Chỉ chọn code liên quan trước khi hỏi
+- Dùng prompt cụ thể, rõ ràng
+- Chia task phức tạp thành các bước nhỏ
+
+### Tối ưu Chi phí
+- Dùng model nhanh hơn/rẻ hơn cho task đơn giản
+- Giới hạn context size khi có thể
+- Cache response thường dùng
+
+## Bước tiếp theo
+
+- [Cấu hình Cursor](cursor.md) cho tích hợp IDE nâng cao
+- [Setup Roo](roo.md) cho trợ lý AI
+- [Khám phá CLI usage](../cli/basic-usage.md)
+- [Tìm hiểu về chọn model](../models/overview.md)
diff --git a/gitbook/content/vi/integration/cursor.md b/gitbook/content/vi/integration/cursor.md
new file mode 100644
index 0000000..6e89d99
--- /dev/null
+++ b/gitbook/content/vi/integration/cursor.md
@@ -0,0 +1,149 @@
+# Tích hợp Cursor
+
+Tích hợp 9Router với Cursor IDE để định tuyến request AI qua hệ thống routing thông minh của 9Router.
+
+## Yêu cầu
+
+- Cursor IDE đã cài đặt
+- Tài khoản Cursor Pro (cần thiết cho custom API endpoint)
+- 9Router cloud endpoint đã cấu hình
+- API key từ 9Router dashboard
+
+## ⚠️ Lưu ý Quan trọng
+
+> **Yêu cầu Cloud Endpoint**: Cursor định tuyến request qua server của chính nó và không hỗ trợ endpoint localhost. Bạn phải dùng 9Router cloud endpoint: `https://9router.com`
+
+> **Yêu cầu Cursor Pro**: Tính năng này yêu cầu tài khoản Cursor Pro để dùng custom API endpoint.
+
+## Setup
+
+### 1. Mở Cursor Settings
+
+1. Mở Cursor IDE
+2. Đi đến **Settings** (Cmd/Ctrl + ,)
+3. Đi đến phần **Models**
+
+### 2. Bật OpenAI API
+
+1. Tìm option **OpenAI API key**
+2. Bật toggle để kích hoạt cấu hình custom API
+
+### 3. Cấu hình Base URL
+
+Đặt base URL tới 9Router cloud endpoint:
+
+```
+https://9router.com
+```
+
+**Các bước:**
+1. Trong cài đặt Models, tìm field **Base URL**
+2. Nhập: `https://9router.com`
+3. Click **Save**
+
+### 4. Thêm API Key
+
+1. Trong field **API Key**, nhập API key 9Router
+2. Bạn có thể tìm API key trong 9Router dashboard tại **Settings → API Keys**
+3. Click **Save**
+
+### 5. Thêm Custom Model
+
+1. Click nút **View All Models**
+2. Click **Add Custom Model**
+3. Nhập tên model từ cấu hình 9Router (ví dụ: `gpt-4`, `claude-opus-4-5`, v.v.)
+4. Click **Add**
+
+### 6. Chọn Model
+
+1. Trong giao diện chat Cursor, click dropdown chọn model
+2. Chọn custom model từ danh sách
+3. Bắt đầu dùng 9Router với Cursor!
+
+## Ví dụ Cấu hình
+
+Cursor settings của bạn nên trông như sau:
+
+```
+OpenAI API: ✓ Enabled
+Base URL: https://9router.com
+API Key: sk-9router-xxxxxxxxxxxxx
+Custom Models: gpt-4, claude-opus-4-5, gemini-2.0-flash
+```
+
+## Model có sẵn
+
+Bạn có thể dùng bất kỳ model nào đã cấu hình trong 9Router dashboard. Ví dụ phổ biến:
+
+| Tên Model | Provider | Mô tả |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## Sử dụng
+
+### Giao diện Chat
+
+1. Mở Cursor chat (Cmd/Ctrl + L)
+2. Chọn model từ dropdown
+3. Bắt đầu chat với AI qua 9Router
+
+### Tạo Code Inline
+
+1. Chọn code trong editor
+2. Nhấn Cmd/Ctrl + K
+3. Nhập prompt
+4. Cursor sẽ dùng 9Router để tạo code
+
+### Giải thích Code
+
+1. Chọn code trong editor
+2. Nhấn Cmd/Ctrl + L
+3. Hỏi "Explain this code"
+4. Nhận giải thích AI qua 9Router
+
+## Troubleshooting
+
+### Lỗi "Invalid API Key"
+
+1. Xác minh API key trong 9Router dashboard
+2. Đảm bảo bạn sao chép đầy đủ key bao gồm prefix `sk-9router-`
+3. Kiểm tra API key chưa hết hạn
+4. Thử tạo API key mới
+
+### Lỗi "Model Not Found"
+
+1. Xác minh tên model khớp chính xác với cấu hình 9Router
+2. Kiểm tra kết nối provider đang hoạt động trong 9Router dashboard
+3. Đảm bảo model có sẵn trong các provider đã kết nối
+4. Thử dùng tên model đầy đủ (ví dụ: `openai/gpt-4` thay vì `gpt-4`)
+
+### Lỗi Connection
+
+1. Xác minh bạn đang dùng cloud endpoint: `https://9router.com`
+2. Kiểm tra kết nối internet
+3. Đảm bảo dịch vụ 9Router cloud đang hoạt động
+4. Thử tắt VPN hoặc proxy nếu đang bật
+
+### Localhost không hoạt động
+
+> **Nhớ**: Cursor không hỗ trợ endpoint localhost. Bạn phải dùng cloud endpoint `https://9router.com`. Nếu cần dùng 9Router cục bộ, hãy cân nhắc dùng dịch vụ tunneling như ngrok để expose endpoint cục bộ.
+
+## Setup Cloud Endpoint
+
+Nếu bạn chạy 9Router cục bộ và muốn dùng với Cursor:
+
+1. Bật cloud endpoint trong 9Router settings
+2. Cấu hình URL cloud endpoint trong 9Router dashboard
+3. Dùng URL cloud trong Cursor settings
+4. Đảm bảo 9Router instance cục bộ có thể truy cập từ internet
+
+## Best Practices
+
+1. **Dùng Model Aliases**: Tạo alias ngắn cho model thường dùng trong 9Router
+2. **Theo dõi Usage**: Kiểm tra 9Router dashboard để xem thống kê và chi phí
+3. **Xoay API Key**: Định kỳ xoay API key để bảo mật
+4. **Test Model**: Thử các model khác nhau để tìm model tốt nhất cho use case
diff --git a/gitbook/content/vi/integration/other-tools.md b/gitbook/content/vi/integration/other-tools.md
new file mode 100644
index 0000000..4bfffa8
--- /dev/null
+++ b/gitbook/content/vi/integration/other-tools.md
@@ -0,0 +1,416 @@
+# Tích hợp các Công cụ khác
+
+9Router tương thích với mọi công cụ hỗ trợ format API OpenAI. Hướng dẫn này bao gồm pattern tích hợp tổng quát cho nhiều công cụ và ứng dụng tùy chỉnh.
+
+## Tổng quan
+
+9Router cung cấp API endpoint tương thích OpenAI hoạt động với:
+- Script và ứng dụng tùy chỉnh
+- API client và công cụ test
+- Công cụ CLI và utility
+- Tích hợp bên thứ ba
+- Framework phát triển
+
+## Pattern Setup Tổng quát
+
+Mọi công cụ tương thích OpenAI có thể kết nối đến 9Router bằng các cài đặt sau:
+
+**9Router cục bộ:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+Model: any 9Router model (cc/*, cx/*, glm/*, etc.)
+```
+
+**9Router cloud:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+Model: any 9Router model (cc/*, cx/*, glm/*, etc.)
+```
+
+## Model có sẵn
+
+### Claude Models (Anthropic)
+- `cc/claude-opus-4-5-20251101`
+- `cc/claude-sonnet-4-20250514`
+- `cc/claude-haiku-4-20250514`
+
+### DeepSeek Models
+- `cx/deepseek-chat`
+- `cx/deepseek-reasoner`
+
+### GLM Models (Zhipu AI)
+- `glm/glm-4-plus`
+- `glm/glm-4-flash`
+
+## Ví dụ Tích hợp
+
+### Python với OpenAI SDK
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+)
+
+print(response.choices[0].message.content)
+```
+
+### Node.js với OpenAI SDK
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+const response = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [
+ { role: "user", content: "Hello, how are you?" }
+ ]
+});
+
+console.log(response.choices[0].message.content);
+```
+
+### Lệnh cURL
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer your-api-key-from-dashboard" \
+ -d '{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+ }'
+```
+
+### HTTP Client (Postman, Insomnia)
+
+**Request:**
+```
+POST http://localhost:20128/v1/chat/completions
+```
+
+**Headers:**
+```
+Content-Type: application/json
+Authorization: Bearer your-api-key-from-dashboard
+```
+
+**Body:**
+```json
+{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ],
+ "temperature": 0.7,
+ "max_tokens": 1000
+}
+```
+
+### Tích hợp LangChain
+
+```python
+from langchain.chat_models import ChatOpenAI
+from langchain.schema import HumanMessage
+
+llm = ChatOpenAI(
+ model_name="cc/claude-sonnet-4-20250514",
+ openai_api_key="your-api-key-from-dashboard",
+ openai_api_base="http://localhost:20128/v1",
+ temperature=0.7
+)
+
+messages = [HumanMessage(content="Explain quantum computing")]
+response = llm(messages)
+print(response.content)
+```
+
+### Tích hợp LlamaIndex
+
+```python
+from llama_index.llms import OpenAI
+
+llm = OpenAI(
+ model="cc/claude-sonnet-4-20250514",
+ api_key="your-api-key-from-dashboard",
+ api_base="http://localhost:20128/v1"
+)
+
+response = llm.complete("What is machine learning?")
+print(response.text)
+```
+
+## Ví dụ Script Tùy chỉnh
+
+### Script Xử lý Batch
+
+```python
+import openai
+import json
+
+openai.api_key = "your-api-key-from-dashboard"
+openai.api_base = "http://localhost:20128/v1"
+
+def process_batch(prompts, model="cx/deepseek-chat"):
+ results = []
+ for prompt in prompts:
+ response = openai.ChatCompletion.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ results.append({
+ "prompt": prompt,
+ "response": response.choices[0].message.content
+ })
+ return results
+
+prompts = [
+ "Explain AI in one sentence",
+ "What is machine learning?",
+ "Define neural networks"
+]
+
+results = process_batch(prompts)
+print(json.dumps(results, indent=2))
+```
+
+### Xử lý Streaming Response
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+async function streamResponse(prompt) {
+ const stream = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [{ role: "user", content: prompt }],
+ stream: true
+ });
+
+ for await (const chunk of stream) {
+ const content = chunk.choices[0]?.delta?.content || "";
+ process.stdout.write(content);
+ }
+}
+
+streamResponse("Write a short story about AI");
+```
+
+### So sánh Nhiều Model
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+models = [
+ "cc/claude-sonnet-4-20250514",
+ "cx/deepseek-chat",
+ "glm/glm-4-plus"
+]
+
+prompt = "Explain quantum computing in simple terms"
+
+for model in models:
+ response = client.chat.completions.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ print(f"\n=== {model} ===")
+ print(response.choices[0].message.content)
+```
+
+## Pattern Tích hợp Phổ biến
+
+### Biến môi trường
+
+Lưu credentials an toàn:
+
+```bash
+# .env file
+ROUTER_API_KEY=your-api-key-from-dashboard
+ROUTER_BASE_URL=http://localhost:20128/v1
+ROUTER_MODEL=cc/claude-sonnet-4-20250514
+```
+
+```python
+import os
+from openai import OpenAI
+
+client = OpenAI(
+ api_key=os.getenv("ROUTER_API_KEY"),
+ base_url=os.getenv("ROUTER_BASE_URL")
+)
+```
+
+### Xử lý Lỗi
+
+```python
+from openai import OpenAI, OpenAIError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": "Hello"}]
+ )
+ print(response.choices[0].message.content)
+except OpenAIError as e:
+ print(f"Error: {e}")
+```
+
+### Logic Retry
+
+```python
+import time
+from openai import OpenAI, RateLimitError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+def chat_with_retry(prompt, max_retries=3):
+ for attempt in range(max_retries):
+ try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": prompt}]
+ )
+ return response.choices[0].message.content
+ except RateLimitError:
+ if attempt < max_retries - 1:
+ time.sleep(2 ** attempt) # Exponential backoff
+ else:
+ raise
+```
+
+## Troubleshooting
+
+### Vấn đề Connection
+
+**Vấn đề:** Không kết nối được đến 9Router
+```bash
+# Check if 9Router is running
+curl http://localhost:20128/health
+
+# Expected response:
+{"status": "ok"}
+```
+
+**Giải pháp:**
+- Xác minh 9Router đang chạy
+- Kiểm tra port 20128 không bị chặn
+- Đảm bảo base URL đúng (bao gồm `/v1`)
+
+### Lỗi Xác thực
+
+**Vấn đề:** 401 Unauthorized
+```
+Error: Invalid API key
+```
+
+**Giải pháp:**
+- Xác minh API key từ dashboard
+- Kiểm tra format header Authorization: `Bearer your-api-key`
+- Đảm bảo không có khoảng trắng hoặc xuống dòng thừa trong API key
+
+### Model Not Found
+
+**Vấn đề:** 404 Model not found
+```
+Error: Model 'cc/claude-opus' not found
+```
+
+**Giải pháp:**
+- Dùng tên model chính xác (case-sensitive)
+- Kiểm tra model có sẵn: `curl http://localhost:20128/v1/models`
+- Xác minh model được bật trong plan của bạn
+
+### Vấn đề Timeout
+
+**Vấn đề:** Request timeout
+```
+Error: Request timed out after 30s
+```
+
+**Giải pháp:**
+- Tăng timeout trong cấu hình client
+- Dùng model nhanh hơn cho task nhạy cảm về thời gian
+- Kiểm tra kết nối network đến 9Router
+
+### Rate Limiting
+
+**Vấn đề:** 429 Too Many Requests
+```
+Error: Rate limit exceeded
+```
+
+**Giải pháp:**
+- Triển khai exponential backoff
+- Giảm tần suất request
+- Kiểm tra rate limit trong dashboard
+- Cân nhắc nâng cấp plan
+
+## Best Practices
+
+### Bảo mật
+- Lưu API key trong biến môi trường
+- Không bao giờ commit API key vào version control
+- Dùng HTTPS cho cloud deployment
+- Xoay API key định kỳ
+
+### Hiệu năng
+- Dùng model phù hợp với độ phức tạp task
+- Triển khai caching cho query lặp lại
+- Dùng streaming cho phản hồi dài
+- Batch request khi có thể
+
+### Xử lý Lỗi
+- Luôn triển khai try-catch block
+- Thêm logic retry với exponential backoff
+- Log lỗi để debug
+- Cung cấp cơ chế fallback
+
+### Tối ưu Chi phí
+- Chọn model tiết kiệm chi phí cho task đơn giản
+- Cache phản hồi khi phù hợp
+- Theo dõi usage trong dashboard
+- Đặt giới hạn request trong code
+
+## Bước tiếp theo
+
+- [Cấu hình Cursor](cursor.md) cho tích hợp IDE
+- [Setup Continue](continue.md) cho VSCode
+- [Khám phá CLI usage](../cli/basic-usage.md)
+- [Tìm hiểu về chọn model](../models/overview.md)
+- [API Reference](../api/reference.md)
diff --git a/gitbook/content/vi/integration/roo.md b/gitbook/content/vi/integration/roo.md
new file mode 100644
index 0000000..431e15d
--- /dev/null
+++ b/gitbook/content/vi/integration/roo.md
@@ -0,0 +1,127 @@
+# Tích hợp Roo AI Assistant
+
+Tích hợp 9Router với Roo AI Assistant để truy cập nhiều model AI qua một giao diện thống nhất.
+
+## Yêu cầu
+
+- Roo AI Assistant đã cài đặt
+- 9Router API key từ [dashboard](https://9router.com/dashboard)
+- 9Router đang chạy (cục bộ hoặc cloud)
+
+## Các bước Cấu hình
+
+### 1. Mở Roo Settings
+
+Khởi chạy Roo AI Assistant và mở panel settings.
+
+### 2. Cấu hình API Provider
+
+1. Đi đến cài đặt **API Provider**
+2. Chọn **Ollama** làm provider type
+3. Cấu hình các settings sau:
+
+**Cho 9Router cục bộ:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+```
+
+**Cho 9Router cloud:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+```
+
+### 3. Chọn Model
+
+Chọn từ các model 9Router có sẵn:
+
+**Claude Models:**
+- `cc/claude-opus-4-5-20251101` - Mạnh nhất
+- `cc/claude-sonnet-4-20250514` - Cân bằng
+- `cc/claude-haiku-4-20250514` - Nhanh
+
+**DeepSeek Models:**
+- `cx/deepseek-chat` - Đa năng
+- `cx/deepseek-reasoner` - Reasoning phức tạp
+
+**GLM Models:**
+- `glm/glm-4-plus` - Nâng cao
+- `glm/glm-4-flash` - Phản hồi nhanh
+
+### 4. Test Connection
+
+Gửi tin nhắn test để xác minh tích hợp:
+
+```
+Hello! Can you confirm you're connected through 9Router?
+```
+
+## Ví dụ Sử dụng
+
+### Chat Cơ bản
+```
+Ask Roo: "Explain quantum computing in simple terms"
+Model: cc/claude-sonnet-4-20250514
+```
+
+### Tạo Code
+```
+Ask Roo: "Write a Python function to calculate Fibonacci numbers"
+Model: cx/deepseek-chat
+```
+
+### Reasoning Phức tạp
+```
+Ask Roo: "Analyze the trade-offs between microservices and monolithic architecture"
+Model: cx/deepseek-reasoner
+```
+
+## Mẹo Chọn Model
+
+- **Task nhanh**: Dùng `cc/claude-haiku-4-20250514` hoặc `glm/glm-4-flash`
+- **Hiệu năng cân bằng**: Dùng `cc/claude-sonnet-4-20250514` hoặc `cx/deepseek-chat`
+- **Reasoning phức tạp**: Dùng `cc/claude-opus-4-5-20251101` hoặc `cx/deepseek-reasoner`
+- **Tối ưu chi phí**: Dùng model DeepSeek hoặc GLM
+
+## Troubleshooting
+
+### Connection Failed
+- Xác minh 9Router đang chạy: `curl http://localhost:20128/health`
+- Kiểm tra API key đúng
+- Đảm bảo Base URL bao gồm hậu tố `/v1`
+
+### Model không khả dụng
+- Kiểm tra tên model khớp chính xác (case-sensitive)
+- Xác minh model được bật trong 9Router plan
+- Thử model khác từ danh sách
+
+### Phản hồi Chậm
+- Chuyển sang model nhanh hơn (haiku, flash)
+- Kiểm tra kết nối network
+- Theo dõi logs 9Router để xem vấn đề
+
+## Cấu hình Nâng cao
+
+### Custom Model Aliases
+
+Bạn có thể tạo shortcut cho model thường dùng trong Roo settings:
+
+```
+Alias: "fast" → cc/claude-haiku-4-20250514
+Alias: "smart" → cc/claude-opus-4-5-20251101
+Alias: "code" → cx/deepseek-chat
+```
+
+### Nhiều Profile
+
+Setup profile khác nhau cho use case khác nhau:
+- **Development**: Model DeepSeek cho code
+- **Writing**: Model Claude cho nội dung
+- **Research**: Model Reasoner cho phân tích
+
+## Bước tiếp theo
+
+- [Cấu hình Cursor](cursor.md) cho tích hợp IDE
+- [Setup Continue](continue.md) cho VSCode
+- [Khám phá CLI usage](../cli/basic-usage.md)
diff --git a/gitbook/content/vi/providers/cheap.md b/gitbook/content/vi/providers/cheap.md
new file mode 100644
index 0000000..f7b825d
--- /dev/null
+++ b/gitbook/content/vi/providers/cheap.md
@@ -0,0 +1,462 @@
+# Cheap Providers - Backup Siêu Rẻ
+
+Khi hết quota subscription, trả vài xu thay vì vài đô. Rẻ hơn ChatGPT API ~90%!
+
+---
+
+## Tổng quan
+
+Provider tier rẻ là **backup** khi hết quota subscription:
+
+- 💰 **GLM-4.7** - $0.6/$2.2 per 1M tokens (reset hàng ngày)
+- 💰 **MiniMax M2.1** - $0.2/$1.0 per 1M tokens (reset 5h)
+- 💰 **Kimi K2** - $9/tháng cố định (10M tokens)
+
+**Chiến lược:** Dùng sau khi hết quota subscription, trước free tier. Tiết kiệm chi phí khổng lồ so với ChatGPT API ($20/1M).
+
+---
+
+## GLM-4.7 (Reset Hàng ngày)
+
+### Pricing
+
+| Tier | Input | Output | Reset |
+|------|-------|--------|-------|
+| Standard | $0.60/1M | $2.20/1M | Hàng ngày 10:00 AM |
+| Coding Plan | $0.60/1M | $2.20/1M | Hàng ngày 10:00 AM (3× quota) |
+
+**Ví dụ Chi phí (10M tokens):**
+- Input: 10M × $0.60 = $6
+- Output: 10M × $2.20 = $22
+- **Tổng: $6-22** so với $200 trên ChatGPT API!
+
+### Setup
+
+**Bước 1: Đăng ký**
+
+1. Vào [Zhipu AI](https://open.bigmodel.cn/)
+2. Tạo tài khoản (xác thực số điện thoại)
+3. Chọn **Coding Plan** để có quota 3× ở cùng giá
+
+**Bước 2: Lấy API Key**
+
+```bash
+Dashboard → API Keys → Create New
+→ Copy API key (starts with "zhipu-")
+```
+
+**Bước 3: Thêm vào 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: glm
+API Key: zhipu-your-api-key-here
+```
+
+**Bước 4: Dùng trong CLI**
+
+```
+Model: glm/glm-4.7
+ glm/glm-4.6v (vision)
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Context | Tốt nhất cho |
+|----------|-------------|---------|----------|
+| `glm/glm-4.7` | GLM 4.7 | 128K | Coding, task chung |
+| `glm/glm-4.6v` | GLM 4.6V Vision | 128K | Phân tích ảnh |
+
+### Mẹo Pro
+
+- **Coding Plan** - 3× quota cùng giá ($0.6/$2.2)
+- **Reset hàng ngày** - Quota mới lúc 10:00 AM giờ Bắc Kinh
+- **Tốt nhất cho coding** - Tối ưu cho code generation
+- **Context 128K** - Xử lý file lớn
+
+### Reset Quota
+
+```
+Daily reset: 10:00 AM Beijing Time (UTC+8)
+→ 2:00 AM UTC
+→ 6:00 PM PST (previous day)
+→ 9:00 PM EST (previous day)
+
+Plan your heavy tasks around reset time!
+```
+
+---
+
+## MiniMax M2.1 (Reset 5 Giờ)
+
+### Pricing
+
+| Tier | Input | Output | Reset |
+|------|-------|--------|-------|
+| Standard | $0.20/1M | $1.00/1M | 5 giờ rolling |
+
+**Ví dụ Chi phí (10M tokens):**
+- Input: 10M × $0.20 = $2
+- Output: 10M × $1.00 = $10
+- **Tổng: $2-10** - Lựa chọn rẻ nhất!
+
+### Setup
+
+**Bước 1: Đăng ký**
+
+1. Vào [MiniMax](https://www.minimax.io/)
+2. Tạo tài khoản
+3. Xác thực email/điện thoại
+
+**Bước 2: Lấy API Key**
+
+```bash
+Dashboard → API Management → Create Key
+→ Copy API key
+```
+
+**Bước 3: Thêm vào 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: minimax
+API Key: your-minimax-api-key
+```
+
+**Bước 4: Dùng trong CLI**
+
+```
+Model: minimax/MiniMax-M2.1
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Context | Tốt nhất cho |
+|----------|-------------|---------|----------|
+| `minimax/MiniMax-M2.1` | MiniMax M2.1 | 1M tokens | Context dài, coding |
+
+### Mẹo Pro
+
+- **Lựa chọn rẻ nhất** - $0.20/1M input (rẻ hơn ChatGPT 90%)
+- **5 giờ rolling** - Quota reset mỗi 5 giờ
+- **Context 1M** - Cửa sổ context khổng lồ
+- **Tốt nhất cho file dài** - Xử lý cả codebase
+
+### Reset Quota
+
+```
+5-hour rolling window:
+→ Use quota → Wait 5 hours → Fresh quota
+
+Example:
+10:00 AM - Use 5M tokens
+3:00 PM - Fresh quota available
+8:00 PM - Fresh quota available
+
+Code 24/7 with minimal cost!
+```
+
+---
+
+## Kimi K2 (Cố định $9/tháng)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Tokens bao gồm | Chi phí Hiệu quả |
+|------|--------------|-----------------|----------------|
+| Subscription | $9 | 10M tokens | $0.90/1M |
+
+**Ví dụ Chi phí:**
+- $9/tháng cố định
+- 10M tokens bao gồm
+- **Hiệu quả: $0.90/1M** - Giá trị tốt nhất cho sử dụng đều!
+
+### Setup
+
+**Bước 1: Đăng ký**
+
+1. Vào [Moonshot AI](https://platform.moonshot.ai/)
+2. Tạo tài khoản
+3. Đăng ký plan $9/tháng
+
+**Bước 2: Lấy API Key**
+
+```bash
+Dashboard → API Keys → Create New
+→ Copy API key
+```
+
+**Bước 3: Thêm vào 9Router**
+
+```bash
+9router
+# Dashboard → Providers → Add API Key
+
+Provider: kimi
+API Key: your-kimi-api-key
+```
+
+**Bước 4: Dùng trong CLI**
+
+```
+Model: kimi/kimi-latest
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Context | Tốt nhất cho |
+|----------|-------------|---------|----------|
+| `kimi/kimi-latest` | Kimi Latest | 200K | Coding chung |
+
+### Mẹo Pro
+
+- **Chi phí cố định** - $9/tháng bất kể usage (lên tới 10M)
+- **Tốt nhất cho sử dụng đều** - Nếu dùng 10M/tháng, chỉ $0.90/1M
+- **Reset hàng tháng** - 10M tokens reset hàng tháng
+- **Billing dự đoán được** - Không có chi phí bất ngờ
+
+### Reset Quota
+
+```
+Monthly reset: 1st of each month
+→ 10M tokens refresh
+
+Example monthly usage:
+Week 1: 3M tokens
+Week 2: 2M tokens
+Week 3: 3M tokens
+Week 4: 2M tokens
+Total: 10M tokens = $9 flat
+```
+
+---
+
+## So sánh Giá
+
+| Provider | Input/1M | Output/1M | Reset | Chi phí 10M | Tốt nhất cho |
+|----------|----------|-----------|-------|----------|----------|
+| **GLM-4.7** | $0.60 | $2.20 | Hàng ngày 10AM | $6-22 | Dùng quota hàng ngày |
+| **MiniMax M2.1** | $0.20 | $1.00 | 5 giờ | $2-10 | **Rẻ nhất!** |
+| **Kimi K2** | $0.90 | $0.90 | Hàng tháng | **$9 cố định** | Sử dụng đều |
+| ChatGPT API | $20.00 | $20.00 | Không | $200 | ❌ Đắt |
+
+**Tiết kiệm:** Rẻ hơn ChatGPT API 90-95%!
+
+---
+
+## Ví dụ Sử dụng
+
+### Setup Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: glm/glm-4.7
+```
+
+### Tạo Combo (Khuyên dùng)
+
+```
+Dashboard → Combos → Create New
+
+Name: cheap-backup
+Models:
+ 1. cc/claude-opus-4-5 (Subscription primary)
+ 2. glm/glm-4.7 (Cheap backup, daily reset)
+ 3. minimax/MiniMax-M2.1 (Cheapest fallback)
+ 4. if/kimi-k2-thinking (FREE emergency)
+
+Use in CLI: cheap-backup
+```
+
+**Kết quả:** Subscription → Cheap → Cheapest → Free
+
+---
+
+## Tối ưu Chi phí
+
+### Chiến lược 1: Lịch Reset Hàng ngày
+
+```
+Morning (10AM): Fresh GLM quota
+→ Use GLM for heavy tasks
+→ Save subscription quota
+
+Afternoon: Subscription quota
+→ Use Claude/Codex for complex tasks
+
+Evening: MiniMax (5h reset)
+→ Cheap fallback for late work
+
+Night: Free tier (iFlow)
+→ Zero cost emergency backup
+```
+
+### Chiến lược 2: Ưu tiên Ngân sách
+
+```
+Set monthly budget: $20
+
+Allocation:
+- $9 Kimi K2 (10M tokens flat)
+- $6 GLM daily quota (10M tokens)
+- $5 MiniMax overflow (25M tokens)
+
+Total: 45M tokens for $20
+vs 1M tokens for $20 on ChatGPT API!
+```
+
+### Chiến lược 3: Tối đa Subscription Trước
+
+```
+Priority:
+1. Gemini CLI (180K/month FREE)
+2. Claude Code (subscription you already pay)
+3. GLM-4.7 (cheap backup, $0.6/1M)
+4. MiniMax M2.1 (cheapest, $0.2/1M)
+5. iFlow (FREE emergency)
+
+Monthly cost example (100M tokens):
+- 60M via Gemini CLI: $0 (free)
+- 30M via Claude Code: $0 (subscription)
+- 8M via GLM: $4.80
+- 2M via MiniMax: $0.40
+Total: $5.20/month!
+```
+
+---
+
+## Ví dụ Thực tế
+
+### Ví dụ 1: Tháng Coding Nặng (100M tokens)
+
+```
+Breakdown:
+- 60M via subscription (Claude/Codex): $0 extra
+- 30M via GLM-4.7: $18
+- 10M via MiniMax M2.1: $2
+
+Total: $20/month
+vs $2000 on ChatGPT API!
+
+Savings: 99% cheaper!
+```
+
+### Ví dụ 2: Coder Ngân sách ($10/tháng)
+
+```
+Strategy:
+- $9 Kimi K2 (10M tokens)
+- $1 MiniMax overflow (5M tokens)
+
+Total: 15M tokens for $10
+vs 0.5M tokens for $10 on ChatGPT API!
+
+30× more tokens!
+```
+
+### Ví dụ 3: Freelancer (Usage Biến thiên)
+
+```
+Light month (20M tokens):
+- 15M via subscription: $0
+- 5M via GLM: $3
+Total: $3
+
+Heavy month (150M tokens):
+- 60M via subscription: $0
+- 60M via GLM: $36
+- 30M via MiniMax: $6
+Total: $42
+
+Average: $22.50/month
+vs $3400 on ChatGPT API!
+```
+
+---
+
+## Best Practices
+
+### 1. Theo dõi Quota Hàng ngày
+
+```
+Dashboard shows:
+- GLM quota: 75% used (reset in 6h)
+- MiniMax quota: 50% used (reset in 2h)
+- Kimi quota: 8M/10M used (reset in 15 days)
+
+Plan heavy tasks around reset times!
+```
+
+### 2. Dùng Coding Plan (GLM)
+
+```
+Standard: 1× quota
+Coding Plan: 3× quota (same price!)
+
+→ Always choose Coding Plan
+```
+
+### 3. Kết hợp với Free Tier
+
+```
+Combo:
+1. gc/gemini-3-flash (FREE primary)
+2. glm/glm-4.7 (cheap backup)
+3. minimax/MiniMax-M2.1 (cheapest)
+4. if/kimi-k2-thinking (FREE emergency)
+
+Result: Minimize costs, maximize uptime
+```
+
+### 4. Đặt Cảnh báo Ngân sách
+
+```
+Dashboard → Settings → Budget Alerts
+
+Daily: $2 limit
+Weekly: $10 limit
+Monthly: $30 limit
+
+→ Auto switch to free tier when limit reached
+```
+
+---
+
+## Troubleshooting
+
+### "Quota exhausted"
+
+**Giải pháp:**
+- GLM: Đợi đến 10:00 AM giờ Bắc Kinh
+- MiniMax: Đợi 5 giờ kể từ lần dùng đầu
+- Kimi: Đợi đến ngày 1 tháng sau
+- Dùng combo fallback sang free tier
+
+### "API key invalid"
+
+**Giải pháp:**
+- Kiểm tra API key sao chép đúng
+- Xác minh tài khoản có credits
+- Tạo lại API key nếu cần
+
+### "High costs"
+
+**Giải pháp:**
+- Kiểm tra usage stats trong Dashboard
+- Đặt cảnh báo ngân sách
+- Chuyển sang MiniMax ($0.2/1M rẻ nhất)
+- Dùng free tier cho task không quan trọng
+
+---
+
+## Bước tiếp theo
+
+- **Thêm free fallback:** [Free Providers](./free.md)
+- **Setup subscriptions:** [Subscription Providers](./subscription.md)
+- **Tạo combos:** Dashboard → Combos → Create New
diff --git a/gitbook/content/vi/providers/free.md b/gitbook/content/vi/providers/free.md
new file mode 100644
index 0000000..707ceae
--- /dev/null
+++ b/gitbook/content/vi/providers/free.md
@@ -0,0 +1,442 @@
+# Free Providers - Fallback Chi phí 0
+
+Backup khẩn cấp khi mọi thứ khác bị giới hạn quota. Code 24/7 với chi phí 0!
+
+---
+
+## Tổng quan
+
+Provider free tier là **fallback** khi hết quota subscription và cheap:
+
+- 🆓 **iFlow** - 8 model MIỄN PHÍ (Kimi K2, Qwen3, GLM 4.7, MiniMax M2...)
+- 🆓 **Qwen** - 3 model MIỄN PHÍ (Qwen3 Coder Plus/Flash, Vision)
+- 🆓 **Kiro** - 2 model MIỄN PHÍ (Claude Sonnet 4.5, Haiku 4.5)
+
+**Chiến lược:** Dùng làm backup khẩn cấp. Usage không giới hạn, miễn phí mãi mãi!
+
+---
+
+## iFlow (8 Model MIỄN PHÍ)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Models | Quota |
+|------|--------------|--------|-------|
+| FREE | $0 | 8 models | Không giới hạn |
+
+**Giá trị tốt nhất:** Nhiều model nhất trong free tier! Kimi K2, Qwen3, GLM, MiniMax, DeepSeek.
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect iFlow
+```
+
+**Bước 2: Đăng nhập OAuth iFlow**
+
+- Click "Connect iFlow"
+- Browser mở → trang đăng nhập iFlow
+- Tạo tài khoản hoặc đăng nhập
+- Cấp quyền
+- Auto token refresh được bật
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: if/kimi-k2-thinking
+ if/kimi-k2
+ if/qwen3-coder-plus
+ if/glm-4.7
+ if/minimax-m2
+ if/deepseek-r1
+ if/deepseek-v3.2-chat
+ if/deepseek-v3.2-reasoner
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `if/kimi-k2-thinking` | Kimi K2 Thinking | Reasoning phức tạp |
+| `if/kimi-k2` | Kimi K2 | Coding chung |
+| `if/qwen3-coder-plus` | Qwen3 Coder Plus | Tạo code |
+| `if/glm-4.7` | GLM 4.7 | Tiếng Trung + Anh |
+| `if/minimax-m2` | MiniMax M2 | Context dài |
+| `if/deepseek-r1` | DeepSeek R1 | Task reasoning |
+| `if/deepseek-v3.2-chat` | DeepSeek V3.2 Chat | Conversational |
+| `if/deepseek-v3.2-reasoner` | DeepSeek V3.2 Reasoner | Logic phức tạp |
+
+### Mẹo Pro
+
+- **8 model MIỄN PHÍ** - Đa dạng nhất trong free tier
+- **Usage không giới hạn** - Không giới hạn quota
+- **Kimi K2 Thinking** - Tốt nhất cho reasoning phức tạp
+- **DeepSeek R1** - Khả năng reasoning mạnh
+
+---
+
+## Qwen (3 Model MIỄN PHÍ)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Models | Quota |
+|------|--------------|--------|-------|
+| FREE | $0 | 3 models | Không giới hạn |
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Qwen
+```
+
+**Bước 2: Xác thực Device Code**
+
+- Click "Connect Qwen"
+- Dashboard hiển thị device code
+- Vào URL xác thực
+- Nhập device code
+- Đăng nhập tài khoản Qwen
+- Auto token refresh được bật
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: qw/qwen3-coder-plus
+ qw/qwen3-coder-flash
+ qw/vision-model
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `qw/qwen3-coder-plus` | Qwen3 Coder Plus | Coding nâng cao |
+| `qw/qwen3-coder-flash` | Qwen3 Coder Flash | Phản hồi nhanh |
+| `qw/vision-model` | Qwen3 Vision | Phân tích ảnh |
+
+### Mẹo Pro
+
+- **Qwen3 Coder Plus** - Khả năng coding mạnh
+- **Qwen3 Coder Flash** - Nhanh cho task nhanh
+- **Vision model** - Phân tích ảnh MIỄN PHÍ
+- **Usage không giới hạn** - Không giới hạn quota
+
+---
+
+## Kiro (Claude MIỄN PHÍ)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Models | Quota |
+|------|--------------|--------|-------|
+| FREE | $0 | Claude Sonnet 4.5, Haiku 4.5 | Không giới hạn |
+
+**Giá trị tốt nhất:** Claude MIỄN PHÍ! Cùng chất lượng với Claude Code trả phí.
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Kiro
+```
+
+**Bước 2: AWS Builder ID hoặc OAuth**
+
+- Click "Connect Kiro"
+- Chọn phương thức đăng nhập:
+ - AWS Builder ID (khuyên dùng)
+ - Tài khoản Google
+ - Tài khoản GitHub
+- Cấp quyền
+- Auto token refresh được bật
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: kr/claude-sonnet-4.5
+ kr/claude-haiku-4.5
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `kr/claude-sonnet-4.5` | Claude Sonnet 4.5 | Cân bằng chất lượng/tốc độ |
+| `kr/claude-haiku-4.5` | Claude Haiku 4.5 | Phản hồi nhanh |
+
+### Mẹo Pro
+
+- **Claude MIỄN PHÍ** - Cùng chất lượng tier trả phí
+- **AWS Builder ID** - Setup dễ với tài khoản AWS
+- **Usage không giới hạn** - Không giới hạn quota
+- **Chất lượng tốt nhất** - Claude 4.5 miễn phí!
+
+---
+
+## So sánh Tính năng
+
+| Provider | Models | Model tốt nhất | Setup | Quota |
+|----------|--------|------------|-------|-------|
+| **iFlow** | 8 | Kimi K2 Thinking | OAuth | Không giới hạn |
+| **Qwen** | 3 | Qwen3 Coder Plus | Device Code | Không giới hạn |
+| **Kiro** | 2 | Claude Sonnet 4.5 | AWS Builder ID | Không giới hạn |
+
+**Thắng cuộc:** iFlow vì đa dạng, Kiro vì chất lượng!
+
+---
+
+## Ví dụ Sử dụng
+
+### Setup Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: if/kimi-k2-thinking
+```
+
+### Tạo Combo (Khuyên dùng)
+
+```
+Dashboard → Combos → Create New
+
+Name: free-combo
+Models:
+ 1. if/kimi-k2-thinking (iFlow primary)
+ 2. qw/qwen3-coder-plus (Qwen backup)
+ 3. kr/claude-sonnet-4.5 (Kiro quality)
+
+Use in CLI: free-combo
+```
+
+**Kết quả:** Chi phí 0, uptime tối đa!
+
+---
+
+## Chiến lược Fallback Đầy đủ
+
+### Combo 3 Tầng Hoàn chỉnh
+
+```
+Dashboard → Combos → Create New
+
+Name: complete-fallback
+Models:
+ 1. gc/gemini-3-flash-preview (FREE subscription)
+ 2. cc/claude-opus-4-5 (Paid subscription)
+ 3. glm/glm-4.7 (Cheap backup, $0.6/1M)
+ 4. minimax/MiniMax-M2.1 (Cheapest, $0.2/1M)
+ 5. if/kimi-k2-thinking (FREE fallback)
+ 6. kr/claude-sonnet-4.5 (FREE quality)
+
+Use in CLI: complete-fallback
+```
+
+**Kết quả:**
+- Tier 1: Subscription MIỄN PHÍ (Gemini CLI)
+- Tier 2: Subscription trả phí (Claude Code)
+- Tier 3: Backup rẻ (GLM, MiniMax)
+- Tier 4: Fallback MIỄN PHÍ (iFlow, Kiro)
+
+**Không bao giờ ngừng code!**
+
+---
+
+## Best Practices
+
+### 1. Dùng làm Backup Khẩn cấp
+
+```
+Priority:
+1. Subscription tier (maximize paid quota)
+2. Cheap tier (pennies per 1M tokens)
+3. FREE tier (unlimited, zero cost)
+
+Only use free tier when:
+- Subscription quota exhausted
+- Budget limit reached
+- Testing/non-critical tasks
+```
+
+### 2. Chọn Model phù hợp
+
+```
+Complex reasoning: if/kimi-k2-thinking
+Fast coding: qw/qwen3-coder-flash
+Best quality: kr/claude-sonnet-4.5
+Long context: if/minimax-m2
+Vision tasks: qw/vision-model
+```
+
+### 3. Tạo Combo Chỉ Free
+
+```
+For zero-cost coding:
+
+Name: zero-cost
+Models:
+ 1. kr/claude-sonnet-4.5 (Best quality)
+ 2. if/kimi-k2-thinking (Complex tasks)
+ 3. qw/qwen3-coder-plus (Fast coding)
+
+Cost: $0 forever!
+```
+
+### 4. Test Trước Production
+
+```
+Use free tier to:
+- Test prompts
+- Prototype features
+- Learn new frameworks
+- Non-critical tasks
+
+Save paid quota for:
+- Production code
+- Complex refactoring
+- Critical features
+```
+
+---
+
+## Ví dụ Thực tế
+
+### Ví dụ 1: Sinh viên/Người học (Ngân sách 0)
+
+```
+Setup:
+1. kr/claude-sonnet-4.5 (Best quality)
+2. if/kimi-k2-thinking (Complex reasoning)
+3. qw/qwen3-coder-plus (Fast coding)
+
+Monthly cost: $0
+Usage: Unlimited
+
+Perfect for:
+- Learning to code
+- Personal projects
+- Homework/assignments
+```
+
+### Ví dụ 2: Freelancer (Tiết kiệm Ngân sách)
+
+```
+Setup:
+1. gc/gemini-3-flash-preview (FREE 180K/month)
+2. glm/glm-4.7 (Cheap backup, $0.6/1M)
+3. if/kimi-k2-thinking (FREE fallback)
+
+Monthly cost: $5-10
+Usage: 100M+ tokens
+
+Perfect for:
+- Client projects (paid tier)
+- Testing (free tier)
+- Emergency backup
+```
+
+### Ví dụ 3: Heavy User (Tối đa hết tất cả)
+
+```
+Setup:
+1. gc/gemini-3-flash-preview (FREE 180K/month)
+2. cc/claude-opus-4-5 (Subscription $20-100)
+3. cx/gpt-5.2-codex (Subscription $20-200)
+4. glm/glm-4.7 (Cheap $0.6/1M)
+5. minimax/MiniMax-M2.1 (Cheapest $0.2/1M)
+6. if/kimi-k2-thinking (FREE unlimited)
+7. kr/claude-sonnet-4.5 (FREE quality)
+
+Monthly cost: $40-320 (subscriptions) + $10-20 (cheap tier)
+Usage: 500M+ tokens
+
+Perfect for:
+- Professional development
+- Team projects
+- 24/7 coding
+```
+
+---
+
+## So sánh Chi phí
+
+### Kịch bản: 100M tokens/tháng
+
+**Phương án 1: Chỉ ChatGPT API**
+```
+100M × $20/1M = $2,000/month
+```
+
+**Phương án 2: Chỉ 9Router Free Tier**
+```
+100M via free tier = $0/month
+Savings: $2,000/month (100%)
+```
+
+**Phương án 3: Chiến lược Hoàn chỉnh 9Router**
+```
+60M via Gemini CLI (FREE): $0
+30M via Claude Code (subscription): $0 extra
+8M via GLM (cheap): $4.80
+2M via iFlow (FREE): $0
+Total: $4.80/month + subscriptions you already have
+Savings: $1,995/month (99.76%)
+```
+
+---
+
+## Troubleshooting
+
+### "OAuth failed"
+
+**Giải pháp:**
+- Kiểm tra kết nối internet
+- Thử browser khác
+- Xóa cache browser
+- Kết nối lại trong dashboard
+
+### "Model not available"
+
+**Giải pháp:**
+- Kiểm tra provider đã kết nối trong dashboard
+- Xác minh OAuth token hợp lệ
+- Kết nối lại provider nếu cần
+
+### "Slow responses"
+
+**Giải pháp:**
+- Free tier có thể có ưu tiên thấp hơn
+- Dùng trong giờ thấp điểm
+- Chuyển sang free provider khác
+- Nâng cấp lên cheap tier để tăng tốc
+
+---
+
+## Giới hạn
+
+### Cân nhắc Free Tier
+
+- **Tốc độ** - Có thể chậm hơn tier trả phí
+- **Ưu tiên** - Ưu tiên thấp hơn trong giờ cao điểm
+- **Rate limit** - Có thể bị rate limit (nhưng không giới hạn quota)
+- **Tính khả dụng** - Có thể có downtime thỉnh thoảng
+
+**Giải pháp:** Dùng chiến lược fallback 3 tầng để đáng tin cậy!
+
+---
+
+## Bước tiếp theo
+
+- **Setup subscriptions:** [Subscription Providers](./subscription.md)
+- **Thêm cheap backup:** [Cheap Providers](./cheap.md)
+- **Tạo combos:** Dashboard → Combos → Create New
+- **Bắt đầu code:** Dùng combo `complete-fallback` để có độ tin cậy tối đa
diff --git a/gitbook/content/vi/providers/subscription.md b/gitbook/content/vi/providers/subscription.md
new file mode 100644
index 0000000..4cdbdfd
--- /dev/null
+++ b/gitbook/content/vi/providers/subscription.md
@@ -0,0 +1,404 @@
+# Subscription Providers - Tối đa hóa Giá trị
+
+Tối đa hóa subscription AI hiện có với quota tracking thông minh và auto fallback. Dùng hết mọi quota subscription trước khi reset!
+
+---
+
+## Tổng quan
+
+Provider tier subscription là lựa chọn **chính** - bạn đã trả tiền cho chúng, hãy lấy đầy đủ giá trị:
+
+- ✅ **Claude Code** (Pro/Max) - Claude 4.5 Opus/Sonnet/Haiku
+- ✅ **OpenAI Codex** (Plus/Pro) - GPT 5.2 Codex, GPT 5.1 Codex Max
+- ✅ **Gemini CLI** (Free tier!) - 180K completions/tháng
+- ✅ **GitHub Copilot** - GPT-5, Claude 4.5, Gemini 3
+- ✅ **Antigravity** (Google) - Gemini 3 Pro, Claude Sonnet 4.5
+
+**Chiến lược:** Dùng đầu tiên, theo dõi quota thời gian thực, fallback sang cheap/free khi hết.
+
+---
+
+## Claude Code (Pro/Max)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Quota Reset | Models |
+|------|--------------|-------------|--------|
+| Pro | $20 | 5 giờ + Hàng tuần | Opus, Sonnet, Haiku |
+| Max | $100 | 5 giờ + Hàng tuần | Opus, Sonnet, Haiku |
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard opens → Providers → Connect Claude Code
+```
+
+**Bước 2: Đăng nhập OAuth**
+
+- Click "Connect Claude Code"
+- Browser mở → Đăng nhập Claude.ai
+- Auto token refresh được bật
+- Quota tracking bắt đầu
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: cc/claude-opus-4-5-20251101
+ cc/claude-sonnet-4-5-20250929
+ cc/claude-haiku-4-5-20251001
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `cc/claude-opus-4-5-20251101` | Claude 4.5 Opus | Task phức tạp, kiến trúc |
+| `cc/claude-sonnet-4-5-20250929` | Claude 4.5 Sonnet | Cân bằng tốc độ/chất lượng |
+| `cc/claude-haiku-4-5-20251001` | Claude 4.5 Haiku | Phản hồi nhanh |
+
+### Mẹo Pro
+
+- **Dùng Opus cho task phức tạp** - Quyết định kiến trúc, refactoring
+- **Dùng Sonnet cho tốc độ** - Edit nhanh, tạo code
+- **Theo dõi quota mỗi model** - Dashboard hiển thị usage mỗi model
+- **Reset 5 giờ** - Quota mới mỗi 5 giờ + reset hàng tuần
+
+---
+
+## OpenAI Codex (Plus/Pro)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Quota Reset | Models |
+|------|--------------|-------------|--------|
+| Plus | $20 | 5 giờ + Hàng tuần | GPT 5.2, GPT 5.1 |
+| Pro | $200 | 5 giờ + Hàng tuần | GPT 5.2 Codex, GPT 5.1 Max |
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Codex
+```
+
+**Bước 2: Đăng nhập OAuth**
+
+- Click "Connect Codex"
+- Browser mở đến `http://localhost:1455`
+- Đăng nhập tài khoản OpenAI
+- Auto token refresh được bật
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: cx/gpt-5.2-codex
+ cx/gpt-5.1-codex-max
+ cx/gpt-5.2
+ cx/gpt-5.1-codex
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `cx/gpt-5.2-codex` | GPT 5.2 Codex | Model coding mới nhất |
+| `cx/gpt-5.1-codex-max` | GPT 5.1 Codex Max | Context tối đa |
+| `cx/gpt-5.2` | GPT 5.2 | Task chung |
+| `cx/gpt-5.1-codex` | GPT 5.1 Codex | Coding ổn định |
+
+### Mẹo Pro
+
+- **Quota rolling 5 giờ** - Quota mới mỗi 5 giờ
+- **Reset hàng tuần** - Reset quota đầy đủ hàng tuần
+- **Tier Pro** - Quota gấp 10× Plus
+
+---
+
+## Gemini CLI (MIỄN PHÍ 180K/tháng!)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Quota | Reset |
+|------|--------------|-------|-------|
+| FREE | $0 | 180K completions/tháng + 1K/ngày | Hàng ngày + Hàng tháng |
+
+**Giá trị tốt nhất:** Free tier khổng lồ! Dùng trước tier trả phí.
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Gemini CLI
+```
+
+**Bước 2: Google OAuth**
+
+- Click "Connect Gemini CLI"
+- Browser mở → Đăng nhập tài khoản Google
+- Cấp quyền
+- Auto token refresh được bật
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: gc/gemini-3-flash-preview
+ gc/gemini-3-pro-preview
+ gc/gemini-2.5-pro
+ gc/gemini-2.5-flash
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `gc/gemini-3-flash-preview` | Gemini 3 Flash Preview | Phản hồi nhanh |
+| `gc/gemini-3-pro-preview` | Gemini 3 Pro Preview | Task phức tạp |
+| `gc/gemini-2.5-pro` | Gemini 2.5 Pro | Production ổn định |
+| `gc/gemini-2.5-flash` | Gemini 2.5 Flash | Task nhanh |
+
+### Mẹo Pro
+
+- **180K completions/tháng** - Free tier khổng lồ
+- **Giới hạn 1K/ngày** - Quota hàng ngày reset lúc nửa đêm
+- **Dùng đầu tiên** - Free tier, dùng trước subscription trả phí
+- **Không cần thẻ tín dụng** - Hoàn toàn miễn phí với tài khoản Google
+
+---
+
+## GitHub Copilot
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Quota Reset | Models |
+|------|--------------|-------------|--------|
+| Individual | $10 | Hàng tháng (ngày 1) | GPT-5, Claude 4.5, Gemini 3 |
+| Business | $19 | Hàng tháng (ngày 1) | GPT-5, Claude 4.5, Gemini 3 |
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect GitHub
+```
+
+**Bước 2: OAuth qua GitHub**
+
+- Click "Connect GitHub"
+- Browser mở → Đăng nhập GitHub
+- Authorize GitHub Copilot
+- Auto token refresh được bật
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: gh/gpt-5
+ gh/gpt-5.1-codex-max
+ gh/claude-4.5-sonnet
+ gh/gemini-3-pro
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `gh/gpt-5` | GPT-5 | Model OpenAI mới nhất |
+| `gh/gpt-5.1-codex-max` | GPT-5.1 Codex Max | Context tối đa |
+| `gh/claude-4.5-sonnet` | Claude 4.5 Sonnet | Chất lượng Anthropic |
+| `gh/gemini-3-pro` | Gemini 3 Pro | Chất lượng Google |
+
+### Mẹo Pro
+
+- **Reset hàng tháng** - Reset quota đầy đủ vào ngày 1 hàng tháng
+- **Nhiều model** - Truy cập GPT, Claude, Gemini trong một subscription
+- **Tier Business** - Quota cao hơn cho team
+
+---
+
+## Antigravity (Tài khoản Google)
+
+### Pricing
+
+| Plan | Chi phí Hàng tháng | Quota | Models |
+|------|--------------|-------|--------|
+| FREE | $0 | Tương tự Gemini CLI | Gemini 3 Pro, Claude Sonnet 4.5 |
+
+### Setup
+
+**Bước 1: Kết nối qua Dashboard**
+
+```bash
+9router
+# Dashboard → Providers → Connect Antigravity
+```
+
+**Bước 2: Google OAuth**
+
+- Click "Connect Antigravity"
+- Browser mở → Đăng nhập tài khoản Google
+- Cấp quyền
+- Auto token refresh được bật
+
+**Bước 3: Dùng trong CLI**
+
+```
+Model: ag/gemini-3-pro-high
+ ag/claude-sonnet-4-5
+ ag/claude-opus-4-5-thinking
+```
+
+### Model có sẵn
+
+| Model ID | Mô tả | Tốt nhất cho |
+|----------|-------------|----------|
+| `ag/gemini-3-pro-high` | Gemini 3 Pro High | Phản hồi chất lượng cao |
+| `ag/claude-sonnet-4-5` | Claude Sonnet 4.5 | Chất lượng Anthropic |
+| `ag/claude-opus-4-5-thinking` | Claude Opus 4.5 Thinking | Reasoning phức tạp |
+
+### Mẹo Pro
+
+- **Free tier** - Không phí với tài khoản Google
+- **Truy cập Claude** - Claude Sonnet/Opus miễn phí
+- **Quota tương tự Gemini CLI** - Giới hạn hàng ngày/tháng
+
+---
+
+## So sánh Giá
+
+| Provider | Chi phí Hàng tháng | Quota Reset | Giá trị |
+|----------|--------------|-------------|-------|
+| **Claude Code Pro** | $20 | 5 giờ + Hàng tuần | ⭐⭐⭐⭐⭐ Chất lượng tốt nhất |
+| **Claude Code Max** | $100 | 5 giờ + Hàng tuần | ⭐⭐⭐⭐⭐ Quota cao nhất |
+| **Codex Plus** | $20 | 5 giờ + Hàng tuần | ⭐⭐⭐⭐ Giá trị tốt |
+| **Codex Pro** | $200 | 5 giờ + Hàng tuần | ⭐⭐⭐⭐⭐ Quota 10× |
+| **Gemini CLI** | **$0** | Hàng ngày + Hàng tháng | ⭐⭐⭐⭐⭐ MIỄN PHÍ 180K/tháng! |
+| **GitHub Copilot** | $10-19 | Hàng tháng (ngày 1) | ⭐⭐⭐⭐ Đa model |
+| **Antigravity** | **$0** | Hàng ngày + Hàng tháng | ⭐⭐⭐⭐ Claude MIỄN PHÍ! |
+
+---
+
+## Ví dụ Sử dụng
+
+### Setup Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [from 9router dashboard]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Tạo Combo (Khuyên dùng)
+
+```
+Dashboard → Combos → Create New
+
+Name: premium-coding
+Models:
+ 1. gc/gemini-3-flash-preview (FREE, use first)
+ 2. cc/claude-opus-4-5-20251101 (Subscription)
+ 3. cx/gpt-5.2-codex (Subscription backup)
+
+Use in CLI: premium-coding
+```
+
+**Kết quả:** Tối đa free tier → Dùng subscription → Auto fallback
+
+---
+
+## Quota Tracking
+
+9Router theo dõi quota thời gian thực:
+
+- **Tiêu thụ token** - Tokens input/output mỗi request
+- **Đếm ngược reset** - Thời gian đến lần reset tiếp theo
+- **Phần trăm usage** - Đã dùng bao nhiêu quota
+- **Auto fallback** - Chuyển sang tier sau khi hết
+
+**Dashboard view:**
+
+```
+Claude Code Pro
+├─ Quota: 75% used
+├─ Reset: 2h 15m (5-hour)
+├─ Weekly reset: 3 days
+└─ Fallback: glm/glm-4.7 (cheap tier)
+```
+
+---
+
+## Best Practices
+
+### 1. Dùng Free Tier Trước
+
+```
+Priority:
+1. Gemini CLI (180K/month FREE)
+2. Antigravity (FREE Claude)
+3. Claude Code/Codex (paid subscriptions)
+```
+
+### 2. Theo dõi Quota Hàng ngày
+
+- Kiểm tra dashboard mỗi sáng
+- Lên kế hoạch task nặng quanh thời gian reset quota
+- Dùng cheap/free tier cho task không quan trọng
+
+### 3. Tạo Smart Combos
+
+```
+Example combo:
+1. gc/gemini-3-flash-preview (FREE primary)
+2. cc/claude-opus-4-5 (Complex tasks)
+3. glm/glm-4.7 (Cheap backup)
+4. if/kimi-k2-thinking (FREE fallback)
+```
+
+### 4. Tối ưu theo Thời gian
+
+```
+Morning: Fresh 5-hour quota (Claude/Codex)
+Afternoon: Gemini CLI (1K/day)
+Evening: Subscription quota
+Night: Cheap/free tier
+```
+
+---
+
+## Troubleshooting
+
+### "Quota exhausted"
+
+**Giải pháp:**
+- Kiểm tra quota tracker trong dashboard
+- Đợi reset (5 giờ hoặc hàng ngày)
+- Dùng combo fallback sang cheap/free tier
+
+### "OAuth token expired"
+
+**Giải pháp:**
+- Auto-refresh bởi 9Router
+- Nếu vẫn lỗi: Dashboard → Provider → Reconnect
+
+### "Rate limiting"
+
+**Giải pháp:**
+- Hết quota subscription
+- Thêm fallback: `cc/claude-opus → glm/glm-4.7`
+- Dùng free tier: `if/kimi-k2-thinking`
+
+---
+
+## Bước tiếp theo
+
+- **Setup cheap backup:** [Cheap Providers](./cheap.md)
+- **Thêm free fallback:** [Free Providers](./free.md)
+- **Tạo combos:** Dashboard → Combos → Create New
diff --git a/gitbook/content/vi/troubleshooting.md b/gitbook/content/vi/troubleshooting.md
new file mode 100644
index 0000000..7ae6cf3
--- /dev/null
+++ b/gitbook/content/vi/troubleshooting.md
@@ -0,0 +1,351 @@
+# Troubleshooting
+
+Các vấn đề và giải pháp phổ biến khi dùng 9Router.
+
+---
+
+## "Language model did not provide messages"
+
+**Vấn đề:** Request thất bại với phản hồi rỗng hoặc thông báo lỗi.
+
+**Nguyên nhân:**
+- Hết quota provider
+- API key không hợp lệ hoặc hết hạn
+- Model không khả dụng
+
+**Giải pháp:**
+
+1. **Kiểm tra trạng thái quota:**
+ ```
+ Dashboard → Providers → View quota tracker
+ ```
+ Nếu hết quota, đợi reset hoặc đổi provider.
+
+2. **Dùng fallback combo:**
+ ```
+ Dashboard → Combos → Create fallback chain
+ Example: cc/claude-opus → glm/glm-4.7 → if/kimi-k2
+ ```
+
+3. **Xác minh kết nối provider:**
+ ```
+ Dashboard → Providers → Reconnect if needed
+ ```
+
+---
+
+## Rate Limiting
+
+**Vấn đề:** Lỗi "Rate limit exceeded" hoặc "Too many requests".
+
+**Nguyên nhân:**
+- Hết quota subscription (giới hạn 5h/ngày/tuần)
+- Đạt API rate limit
+- Quá nhiều request đồng thời
+
+**Giải pháp:**
+
+1. **Kiểm tra thời gian reset:**
+ ```
+ Dashboard → Quota Tracking → View reset countdown
+ ```
+
+2. **Chuyển sang tier rẻ:**
+ ```
+ Use: glm/glm-4.7 ($0.6/1M tokens)
+ minimax/MiniMax-M2.1 ($0.20/1M tokens)
+ ```
+
+3. **Thêm fallback combo:**
+ ```
+ Dashboard → Combos → Add backup models
+ Primary: cc/claude-opus (subscription)
+ Backup: glm/glm-4.7 (cheap)
+ Emergency: if/kimi-k2 (free)
+ ```
+
+---
+
+## OAuth Token hết hạn
+
+**Vấn đề:** Lỗi "Unauthorized" hoặc "Token expired".
+
+**Nguyên nhân:**
+- OAuth token hết hạn (auto-refresh thất bại)
+- Session provider không hợp lệ
+- Vấn đề network khi refresh
+
+**Giải pháp:**
+
+1. **Auto-refresh (mặc định):**
+ 9Router tự refresh tokens. Đợi 30 giây rồi thử lại.
+
+2. **Kết nối lại thủ công:**
+ ```
+ Dashboard → Providers → [Provider Name] → Reconnect
+ → Complete OAuth flow again
+ ```
+
+3. **Kiểm tra trạng thái provider:**
+ Xác minh provider service đang online (Claude Code, Codex, v.v.)
+
+---
+
+## Chi phí cao
+
+**Vấn đề:** Sử dụng hoặc chi phí cao bất ngờ.
+
+**Nguyên nhân:**
+- Dùng model đắt không cần thiết
+- Không fallback sang tier rẻ hơn
+- Context window lớn
+
+**Giải pháp:**
+
+1. **Kiểm tra usage stats:**
+ ```
+ Dashboard → Usage Stats → View token consumption
+ → Identify high-cost models
+ ```
+
+2. **Chuyển sang model rẻ hơn:**
+ ```
+ Replace: cc/claude-opus ($20-100/month subscription)
+ With: glm/glm-4.7 ($0.6/1M tokens)
+ minimax/MiniMax-M2.1 ($0.20/1M tokens)
+ ```
+
+3. **Dùng free tier:**
+ ```
+ if/kimi-k2-thinking (FREE)
+ qw/qwen3-coder-plus (FREE)
+ kr/claude-sonnet-4.5 (FREE)
+ gc/gemini-3-flash-preview (FREE 180K/month)
+ ```
+
+4. **Tối ưu prompt:**
+ - Giảm context size
+ - Dùng streaming cho phản hồi dài
+ - Cache prompt thường dùng
+
+---
+
+## Connection Refused
+
+**Vấn đề:** Lỗi "ECONNREFUSED" hoặc "Cannot connect to localhost:20128".
+
+**Nguyên nhân:**
+- 9Router không chạy
+- Port 20128 bị chặn
+- Firewall chặn kết nối
+
+**Giải pháp:**
+
+1. **Khởi động 9Router:**
+ ```bash
+ 9router
+ ```
+ Dashboard sẽ mở tại http://localhost:3000
+
+2. **Xác minh port 20128:**
+ ```bash
+ # Check if port is listening
+ lsof -i :20128
+
+ # Or on Windows
+ netstat -ano | findstr :20128
+ ```
+
+3. **Kiểm tra firewall:**
+ - macOS: System Settings → Network → Firewall
+ - Windows: Windows Defender Firewall → Allow app
+ - Linux: `sudo ufw allow 20128`
+
+4. **Dùng cloud endpoint:**
+ Nếu localhost không hoạt động (ví dụ: Cursor IDE):
+ ```
+ Endpoint: https://9router.com/v1
+ ```
+
+---
+
+## Dashboard không mở
+
+**Vấn đề:** Dashboard không load tại http://localhost:3000.
+
+**Nguyên nhân:**
+- Port 3000 đã được dùng
+- 9Router bị crash
+- Vấn đề cache browser
+
+**Giải pháp:**
+
+1. **Kiểm tra 9Router có chạy không:**
+ ```bash
+ # Check process
+ ps aux | grep 9router
+
+ # Check port 3000
+ lsof -i :3000
+ ```
+
+2. **Kill process xung đột:**
+ ```bash
+ # macOS/Linux
+ lsof -ti:3000 | xargs kill -9
+
+ # Windows
+ netstat -ano | findstr :3000
+ taskkill /PID /F
+ ```
+
+3. **Khởi động lại 9Router:**
+ ```bash
+ # Stop
+ pkill -f 9router
+
+ # Start
+ 9router
+ ```
+
+4. **Xóa cache browser:**
+ - Chrome: Ctrl+Shift+Delete → Clear cache
+ - Thử chế độ ẩn danh
+
+5. **Kiểm tra cài đặt firewall:**
+ Đảm bảo port 3000 không bị chặn.
+
+---
+
+## Model Not Found
+
+**Vấn đề:** Lỗi "Model not found" hoặc "Invalid model".
+
+**Nguyên nhân:**
+- Provider chưa kết nối
+- Sai chính tả model ID
+- Provider không hoạt động
+
+**Giải pháp:**
+
+1. **Xác minh kết nối provider:**
+ ```
+ Dashboard → Providers → Check status (green = active)
+ ```
+
+2. **Kiểm tra format model ID:**
+ ```
+ Correct: cc/claude-opus-4-5-20251101
+ Wrong: claude-opus-4-5-20251101
+
+ Format: [provider-prefix]/[model-name]
+ ```
+
+3. **Liệt kê model khả dụng:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+ ```
+
+4. **Kết nối lại provider:**
+ ```
+ Dashboard → Providers → [Provider] → Reconnect
+ ```
+
+---
+
+## Phản hồi chậm
+
+**Vấn đề:** Request mất quá lâu hoặc timeout.
+
+**Nguyên nhân:**
+- Độ trễ provider
+- Vấn đề network
+- Context/response lớn
+- Provider rate limiting
+
+**Giải pháp:**
+
+1. **Kiểm tra trạng thái provider:**
+ ```
+ Dashboard → Providers → View latency stats
+ ```
+
+2. **Chuyển sang model nhanh hơn:**
+ ```
+ Fast: cc/claude-haiku-4-5 (Haiku is faster than Opus)
+ gc/gemini-3-flash-preview
+ qw/qwen3-coder-flash
+ ```
+
+3. **Dùng streaming:**
+ ```json
+ {
+ "model": "cc/claude-opus-4-5",
+ "messages": [...],
+ "stream": true
+ }
+ ```
+
+4. **Kiểm tra network:**
+ ```bash
+ # Test latency
+ ping api.anthropic.com
+ ping api.openai.com
+ ```
+
+5. **Giảm context size:**
+ - Cắt bớt lịch sử tin nhắn
+ - Dùng prompt nhỏ hơn
+ - Bật context pruning trong CLI tool
+
+---
+
+## API Key không hợp lệ
+
+**Vấn đề:** Lỗi "Invalid API key" hoặc "Authentication failed".
+
+**Nguyên nhân:**
+- Sao chép sai API key
+- API key hết hạn
+- API key chưa được tạo
+
+**Giải pháp:**
+
+1. **Tạo lại API key:**
+ ```
+ Dashboard → Settings → API Keys → Generate New Key
+ → Copy and use new key
+ ```
+
+2. **Xác minh format key:**
+ ```
+ Correct: 9r_xxxxxxxxxxxxxxxxxxxxxxxx
+ Wrong: Missing 9r_ prefix
+ ```
+
+3. **Kiểm tra key trong CLI config:**
+ ```bash
+ # Cursor
+ Settings → Models → OpenAI API Key
+
+ # Cline
+ Settings → API Key
+
+ # Environment variable
+ export OPENAI_API_KEY="9r_your_key"
+ ```
+
+4. **Test API key:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer 9r_your_key"
+ ```
+
+---
+
+## Cần trợ giúp thêm?
+
+- **GitHub Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **Documentation:** [9router.com/docs](https://9router.com/docs)
+- **FAQ:** [faq.md](faq.md)
diff --git a/gitbook/content/zh-CN/deployment/cloud.md b/gitbook/content/zh-CN/deployment/cloud.md
new file mode 100644
index 0000000..6762f66
--- /dev/null
+++ b/gitbook/content/zh-CN/deployment/cloud.md
@@ -0,0 +1,473 @@
+# ☁️ 云端部署
+
+将 9Router 部署到 VPS 或 Docker,实现远程访问和生产使用。
+
+---
+
+## 🖥️ VPS 部署
+
+### 前置要求
+
+- Ubuntu 20.04+ 或类似 Linux 发行版
+- Node.js 20+
+- Git
+- root 或 sudo 权限
+
+### 步骤 1:克隆仓库
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+```
+
+### 步骤 2:安装依赖
+
+```bash
+npm install
+```
+
+### 步骤 3:构建应用
+
+```bash
+npm run build
+```
+
+### 步骤 4:配置环境变量
+
+创建 `.env` 文件或导出变量:
+
+```bash
+export JWT_SECRET="your-secure-secret-change-this-to-random-string"
+export INITIAL_PASSWORD="your-secure-password"
+export DATA_DIR="/var/lib/9router"
+export NODE_ENV="production"
+```
+
+**环境变量:**
+
+| 变量 | 默认值 | 说明 |
+|----------|---------|-------------|
+| `JWT_SECRET` | 自动生成 | **生产环境必须修改!** 用于 JWT token 签名 |
+| `INITIAL_PASSWORD` | `123456` | 仪表盘登录密码 |
+| `DATA_DIR` | `~/.9router` | 数据库与数据存储路径 |
+| `NODE_ENV` | `development` | 部署时设为 `production` |
+| `ENABLE_REQUEST_LOGS` | `false` | 启用 debug 请求/响应日志 |
+
+### 步骤 5:创建数据目录
+
+```bash
+sudo mkdir -p /var/lib/9router
+sudo chown $USER:$USER /var/lib/9router
+```
+
+### 步骤 6:启动应用
+
+```bash
+npm run start
+```
+
+### 步骤 7:用 PM2 部署到生产环境
+
+PM2 让应用持续运行,崩溃时自动重启:
+
+```bash
+# 全局安装 PM2
+npm install -g pm2
+
+# 用 PM2 启动 9Router
+pm2 start npm --name 9router -- start
+
+# 保存 PM2 配置
+pm2 save
+
+# 设置开机自启
+pm2 startup
+# 按上一条命令打印的提示执行
+```
+
+**PM2 管理命令:**
+
+```bash
+# 查看日志
+pm2 logs 9router
+
+# 重启应用
+pm2 restart 9router
+
+# 停止应用
+pm2 stop 9router
+
+# 查看状态
+pm2 status
+
+# 监控资源
+pm2 monit
+```
+
+---
+
+## 🐳 Docker 部署
+
+### 方式 1:使用 Dockerfile
+
+在 `app` 目录中创建 `Dockerfile`:
+
+```dockerfile
+FROM node:20-alpine
+
+WORKDIR /app
+
+# Copy package files
+COPY package*.json ./
+
+# Install dependencies
+RUN npm ci --only=production
+
+# Copy application files
+COPY . .
+
+# Build application
+RUN npm run build
+
+# Expose ports
+EXPOSE 3000 20128
+
+# Set environment variables
+ENV NODE_ENV=production
+ENV DATA_DIR=/app/data
+
+# Create data directory
+RUN mkdir -p /app/data
+
+# Start application
+CMD ["npm", "run", "start"]
+```
+
+**构建并运行:**
+
+```bash
+# 构建镜像
+docker build -t 9router .
+
+# 运行容器
+docker run -d \
+ --name 9router \
+ -p 3000:3000 \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret-change-this" \
+ -e INITIAL_PASSWORD="your-secure-password" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### 方式 2:Docker Compose
+
+创建 `docker-compose.yml`:
+
+```yaml
+version: '3.8'
+
+services:
+ 9router:
+ build: .
+ container_name: 9router
+ ports:
+ - "3000:3000"
+ - "20128:20128"
+ environment:
+ - NODE_ENV=production
+ - JWT_SECRET=your-secure-secret-change-this
+ - INITIAL_PASSWORD=your-secure-password
+ - DATA_DIR=/app/data
+ volumes:
+ - 9router-data:/app/data
+ restart: unless-stopped
+
+volumes:
+ 9router-data:
+```
+
+**使用 Docker Compose 运行:**
+
+```bash
+# 启动服务
+docker-compose up -d
+
+# 查看日志
+docker-compose logs -f
+
+# 停止服务
+docker-compose down
+
+# 重新构建并重启
+docker-compose up -d --build
+```
+
+---
+
+## 🌐 Nginx 反向代理
+
+### 为什么使用 Nginx?
+
+- SSL/TLS 终止
+- 域名映射
+- 负载均衡
+- 更好的安全性
+
+### 步骤 1:安装 Nginx
+
+```bash
+sudo apt update
+sudo apt install nginx
+```
+
+### 步骤 2:配置 Nginx
+
+创建 `/etc/nginx/sites-available/9router`:
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ # Redirect HTTP to HTTPS
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl http2;
+ server_name your-domain.com;
+
+ # SSL certificates (use certbot to generate)
+ ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
+
+ # SSL configuration
+ ssl_protocols TLSv1.2 TLSv1.3;
+ ssl_ciphers HIGH:!aNULL:!MD5;
+ ssl_prefer_server_ciphers on;
+
+ # Proxy to 9Router
+ location / {
+ proxy_pass http://localhost:3000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+
+ # API endpoint
+ location /v1 {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ # SSE support - CRITICAL for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+### 步骤 3:启用站点
+
+```bash
+# 创建软链接
+sudo ln -s /etc/nginx/sites-available/9router /etc/nginx/sites-enabled/
+
+# 测试配置
+sudo nginx -t
+
+# 重新加载 Nginx
+sudo systemctl reload nginx
+```
+
+### 步骤 4:使用 Let's Encrypt 配置 SSL
+
+```bash
+# 安装 certbot
+sudo apt install certbot python3-certbot-nginx
+
+# 获取 SSL 证书
+sudo certbot --nginx -d your-domain.com
+
+# 自动续期已自动配置
+# 测试续期
+sudo certbot renew --dry-run
+```
+
+---
+
+## 🔒 安全注意事项
+
+### 1. 修改默认凭据
+
+**关键:** 部署前修改 `JWT_SECRET` 和 `INITIAL_PASSWORD`:
+
+```bash
+# 生成安全的 JWT secret
+openssl rand -base64 32
+
+# 将该值用于 JWT_SECRET
+export JWT_SECRET="generated-secret-here"
+```
+
+### 2. 防火墙配置
+
+```bash
+# 允许 SSH
+sudo ufw allow 22/tcp
+
+# 允许 HTTP/HTTPS(若使用 Nginx)
+sudo ufw allow 80/tcp
+sudo ufw allow 443/tcp
+
+# 若不使用反向代理,放开 9Router 端口
+sudo ufw allow 3000/tcp
+sudo ufw allow 20128/tcp
+
+# 启用防火墙
+sudo ufw enable
+```
+
+### 3. 限制仪表盘访问
+
+如果只需要 API 访问,可限制仪表盘端口:
+
+```bash
+# 仅允许 localhost 访问仪表盘
+sudo ufw deny 3000/tcp
+```
+
+通过 SSH 隧道访问仪表盘:
+
+```bash
+ssh -L 3000:localhost:3000 user@your-server.com
+# 然后在浏览器打开 http://localhost:3000
+```
+
+### 4. 定期更新
+
+```bash
+# 更新系统包
+sudo apt update && sudo apt upgrade -y
+
+# 更新 9Router
+cd /path/to/9router/app
+git pull
+npm install
+npm run build
+pm2 restart 9router
+```
+
+### 5. 备份策略
+
+```bash
+# 备份数据目录
+tar -czf 9router-backup-$(date +%Y%m%d).tar.gz /var/lib/9router
+
+# 每日自动备份(加入 crontab)
+0 2 * * * tar -czf /backups/9router-$(date +\%Y\%m\%d).tar.gz /var/lib/9router
+```
+
+---
+
+## 📊 监控
+
+### 检查应用状态
+
+```bash
+# PM2 状态
+pm2 status
+
+# 查看日志
+pm2 logs 9router --lines 100
+
+# 监控资源
+pm2 monit
+```
+
+### Nginx 日志
+
+```bash
+# 访问日志
+sudo tail -f /var/log/nginx/access.log
+
+# 错误日志
+sudo tail -f /var/log/nginx/error.log
+```
+
+### 系统资源
+
+```bash
+# CPU 和内存使用
+htop
+
+# 磁盘使用
+df -h
+
+# 网络连接
+netstat -tulpn | grep -E '3000|20128'
+```
+
+---
+
+## 🚨 故障排除
+
+### 应用无法启动
+
+```bash
+# 查看日志
+pm2 logs 9router
+
+# 检查端口是否被占用
+sudo lsof -i :3000
+sudo lsof -i :20128
+
+# 检查环境变量
+pm2 env 9router
+```
+
+### Nginx 502 Bad Gateway
+
+```bash
+# 检查 9Router 是否运行
+pm2 status
+
+# 查看 Nginx 错误日志
+sudo tail -f /var/log/nginx/error.log
+
+# 测试 Nginx 配置
+sudo nginx -t
+```
+
+### SSE 流式输出无法工作
+
+确保 Nginx 配置中已设置 `proxy_buffering off` 以支持 SSE。
+
+### 权限被拒绝错误
+
+```bash
+# 修复数据目录权限
+sudo chown -R $USER:$USER /var/lib/9router
+chmod 755 /var/lib/9router
+```
+
+---
+
+## 🔗 下一步
+
+- [连接提供商](/providers/subscription.md)
+- [配置组合](/features/combos.md)
+- [集成工具](/integration/cursor.md)
diff --git a/gitbook/content/zh-CN/deployment/localhost.md b/gitbook/content/zh-CN/deployment/localhost.md
new file mode 100644
index 0000000..aed7d0c
--- /dev/null
+++ b/gitbook/content/zh-CN/deployment/localhost.md
@@ -0,0 +1,164 @@
+# 🏠 本地部署
+
+在本机运行 9Router,用于开发和个人使用。
+
+---
+
+## 📦 安装
+
+通过 npm 全局安装 9Router:
+
+```bash
+npm install -g 9router
+```
+
+**要求:**
+- Node.js 20 或更高
+- npm 9 或更高
+
+---
+
+## 🚀 启动服务器
+
+一条命令启动 9Router:
+
+```bash
+9router
+```
+
+仪表盘会自动在浏览器中打开,地址为 `http://localhost:3000`
+
+**默认配置:**
+- **仪表盘**: `http://localhost:3000`
+- **API Endpoint**: `http://localhost:20128/v1`
+- **数据目录**: `~/.9router`
+
+---
+
+## 🔧 配置
+
+### 自定义数据目录
+
+通过环境变量设置自定义数据目录:
+
+```bash
+DATA_DIR=/path/to/data 9router
+```
+
+### 自定义端口
+
+API 端口(20128)和仪表盘端口(3000)在应用中配置。如需修改,你需要改源码或使用支持的环境变量(如果有)。
+
+---
+
+## 🛑 停止服务器
+
+在运行 9Router 的终端中按 `Ctrl+C`。
+
+```bash
+# 在运行 9router 的终端中
+^C # 按 Ctrl+C
+```
+
+服务器会优雅关闭并保存所有数据。
+
+---
+
+## 🔄 重启服务器
+
+再次运行启动命令即可:
+
+```bash
+9router
+```
+
+所有配置、API keys 和组合都保存在数据目录中。
+
+---
+
+## 📊 更新 9Router
+
+更新到最新版本:
+
+```bash
+npm update -g 9router
+```
+
+查看当前版本:
+
+```bash
+npm list -g 9router
+```
+
+---
+
+## 🔍 故障排除
+
+### 端口已被占用
+
+如果端口 20128 或 3000 已被占用:
+
+```bash
+# 找到使用该端口的进程(macOS/Linux)
+lsof -i :20128
+lsof -i :3000
+
+# 杀掉进程
+kill -9
+```
+
+### 权限错误
+
+安装过程中遇到权限错误:
+
+```bash
+# 使用 sudo(不推荐)
+sudo npm install -g 9router
+
+# 或修复 npm 权限(推荐)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+```
+
+### 数据目录问题
+
+数据目录无法访问:
+
+```bash
+# 检查权限
+ls -la ~/.9router
+
+# 修复权限
+chmod 755 ~/.9router
+```
+
+---
+
+## 📁 数据目录结构
+
+```
+~/.9router/
+├── db.json # 主数据库(提供商、组合、设置)
+├── logs/ # 应用日志
+└── cache/ # 临时缓存文件
+```
+
+**备份数据:**
+
+```bash
+# 备份
+cp -r ~/.9router ~/.9router.backup
+
+# 恢复
+cp -r ~/.9router.backup ~/.9router
+```
+
+---
+
+## 🔗 下一步
+
+- [连接提供商](/providers/subscription.md)
+- [创建组合](/features/combos.md)
+- [集成 CLI 工具](/integration/cursor.md)
diff --git a/gitbook/content/zh-CN/faq.md b/gitbook/content/zh-CN/faq.md
new file mode 100644
index 0000000..91dc816
--- /dev/null
+++ b/gitbook/content/zh-CN/faq.md
@@ -0,0 +1,387 @@
+# 常见问题
+
+关于 9Router 的常见问题。
+
+---
+
+## 什么是 9Router?
+
+**9Router 是一款 AI 模型路由工具,能够最大化你的订阅价值并最小化成本。**
+
+它使用 3 层回退系统在多个 AI 提供商之间智能路由请求:
+1. **订阅层** - 充分利用你已付费的 Claude Code、Codex、Gemini 配额
+2. **低价层** - 超低价替代方案(每 1M tokens $0.20-$0.60)
+3. **免费层** - 无限免费模型应急备用
+
+**核心优势:**
+- 不再浪费订阅配额
+- 配额耗尽时自动回退
+- 实时配额跟踪
+- 比直接使用 API 节省 90% 成本
+
+---
+
+## 价格是如何计算的?
+
+**9Router 采用三层定价策略:**
+
+### 第 1 层:订阅(优先使用)
+- **Claude Code**(Pro/Max):$20-100/月 - 5 小时 + 每周配额
+- **OpenAI Codex**(Plus/Pro):$20-200/月 - 5 小时 + 每周配额
+- **Gemini CLI**:免费 - 每月 180K 次补全 + 每天 1K
+- **GitHub Copilot**:$10-19/月 - 每月重置
+- **Antigravity**:免费 - 类似 Gemini
+
+**目标:** 在配额重置前用掉每一点!
+
+### 第 2 层:低价(备用)
+- **GLM-4.7**:每 1M tokens $0.60/$2.20 - 每日 10AM 重置
+- **MiniMax M2.1**:每 1M tokens $0.20/$1.00 - 5 小时滚动
+- **Kimi K2**:$9/月固定(10M tokens)
+
+**目标:** 比 ChatGPT API(每 1M $20)便宜 90%!
+
+### 第 3 层:免费(应急)
+- **iFlow**:8 个免费模型(Kimi K2、Qwen3、GLM、MiniMax...)
+- **Qwen**:3 个免费模型(Qwen3 Coder Plus/Flash、Vision)
+- **Kiro**:2 个免费模型(Claude Sonnet 4.5、Haiku 4.5)
+
+**目标:** 当其他配额都受限时零成本回退!
+
+---
+
+## 9Router 是免费的吗?
+
+**是的,9Router 本身 100% 免费且开源。**
+
+**可用的免费层提供商:**
+- **Gemini CLI** - 每月 180K 次补全(免费 Google 账户)
+- **iFlow** - 8 个无限模型(免费 OAuth)
+- **Qwen** - 3 个无限模型(免费 OAuth)
+- **Kiro** - Claude Sonnet/Haiku(免费 AWS Builder ID)
+
+**只用免费层提供商,就可以永久免费编码!**
+
+**可选的付费提供商:**
+- 你可能已有的订阅服务(Claude Code、Codex、Copilot)
+- 超低价替代方案(每 1M tokens $0.20-$0.60)
+
+---
+
+## 支持哪些提供商?
+
+### 订阅型提供商
+- **Claude Code**(Pro/Max)- Claude 4.5 Opus/Sonnet/Haiku
+- **OpenAI Codex**(Plus/Pro)- GPT 5.2 Codex、GPT 5.1 Codex Max
+- **Gemini CLI**(免费)- Gemini 3 Flash/Pro、2.5 Pro/Flash
+- **GitHub Copilot** - GPT-5、Claude 4.5、Gemini 3
+- **Antigravity**(Google)- Gemini 3 Pro、Claude Sonnet 4.5
+
+### 低价提供商
+- **GLM**(Zhipu AI)- GLM 4.7、GLM 4.6V Vision
+- **MiniMax** - MiniMax M2.1
+- **Kimi**(Moonshot AI)- Kimi Latest
+- **OpenRouter** - 透传到任意 OpenRouter 模型
+
+### 免费提供商
+- **iFlow** - 8 个模型(Kimi K2、Qwen3、GLM、MiniMax、DeepSeek...)
+- **Qwen** - 3 个模型(Qwen3 Coder Plus/Flash、Vision)
+- **Kiro** - 2 个模型(Claude Sonnet 4.5、Haiku 4.5)
+
+**合计:15+ 个提供商,50+ 个模型**
+
+详情请见 [提供商文档](providers/subscription.md)。
+
+---
+
+## 可以同时使用多个提供商吗?
+
+**可以!这正是 9Router 的核心功能。**
+
+**通过组合(Combos),你可以把多个提供商串联起来实现自动回退:**
+
+```
+示例组合: "premium-coding"
+1. cc/claude-opus-4-5(订阅主力)
+2. glm/glm-4.7(低价备用)
+3. if/kimi-k2(免费应急)
+
+→ 配额耗尽时自动切换
+→ 永不停止编码
+→ 几乎零额外成本
+```
+
+**创建组合的方法:**
+```
+仪表盘 → 组合 → 新建
+→ 按优先级添加模型
+→ CLI 中使用组合名: "premium-coding"
+```
+
+**优势:**
+- 配额耗尽时零停机
+- 自动成本优化
+- 所有工具使用同一个模型名
+
+详情见 [组合文档](features/combos.md)。
+
+---
+
+## 配额跟踪是如何工作的?
+
+**9Router 为所有提供商提供实时配额跟踪:**
+
+**功能:**
+- **Token 消耗** - 每次请求的输入/输出 tokens
+- **重置倒计时** - 配额刷新前剩余时间
+- **使用统计** - 每日/每周/每月报告
+- **成本估算** - 预计支出(付费层)
+- **配额告警** - 配额不足时通知
+
+**配额类型:**
+- **5 小时滚动** - Claude Code、Codex、MiniMax
+- **每日重置** - Gemini CLI(每日 1K)、GLM(10AM)
+- **每周重置** - Claude Code、Codex(额外配额)
+- **每月重置** - Gemini CLI(180K)、GitHub Copilot(1 日)
+
+**查看配额:**
+```
+仪表盘 → 提供商 → 配额跟踪
+→ 实时使用情况 + 重置倒计时
+```
+
+详情见 [配额跟踪文档](features/quota-tracking.md)。
+
+---
+
+## 9Router 能配合 Cursor 使用吗?
+
+**可以,但 Cursor 需要使用云端 endpoint。**
+
+**问题:** Cursor IDE 不支持 localhost endpoint。
+
+**解决方案:** 使用 9Router 云端部署:
+
+```
+Cursor Settings → Models → Advanced:
+ OpenAI API Base URL: https://9router.com/v1
+ OpenAI API Key: [从仪表盘获取]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+**替代方案:** 在 VPS 上自托管,使用公开域名:
+```bash
+# 部署到 VPS
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+npm start
+
+# 配置 Nginx 反向代理
+# 将 Cursor 指向: https://your-domain.com/v1
+```
+
+**其他 CLI 工具支持 localhost:**
+- Cline ✅
+- Claude Desktop ✅
+- Codex CLI ✅
+- Continue ✅
+- RooCode ✅
+
+详情见 [Cursor 集成指南](integration/cursor.md)。
+
+---
+
+## 可以自托管 9Router 吗?
+
+**可以!9Router 支持多种部署方式:**
+
+### Localhost(默认)
+```bash
+npm install -g 9router
+9router
+→ 仪表盘: http://localhost:3000
+→ API: http://localhost:20128/v1
+```
+
+### VPS/云
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install && npm run build
+
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+npm start
+```
+
+### Docker
+```bash
+docker build -t 9router .
+docker run -d \
+ -p 3000:3000 \
+ -e JWT_SECRET="your-secret" \
+ -v 9router-data:/app/data \
+ 9router
+```
+
+### Cloudflare Workers
+```bash
+cd 9router/app
+npm run deploy:cloudflare
+```
+
+**环境变量:**
+- `JWT_SECRET` - **生产环境必须修改!**
+- `DATA_DIR` - 数据库存储路径(默认:`~/.9router`)
+- `INITIAL_PASSWORD` - 仪表盘登录(默认:`123456`)
+- `NODE_ENV` - 部署时设为 `production`
+
+详情见 [部署指南](getting-started/installation.md#deployment)。
+
+---
+
+## 我的数据安全吗?
+
+**是的,9Router 优先考虑安全和隐私:**
+
+**本地存储:**
+- 所有数据存储在本地 `~/.9router`(或自定义 `DATA_DIR`)
+- 不会发送数据到 9Router 服务器
+- OAuth tokens 使用 JWT 加密
+
+**无遥测:**
+- 不跟踪使用情况
+- 不分析
+- 不向外回连
+
+**开源:**
+- GitHub 上提供完整源码
+- 可自行审计安全性
+- 社区评审
+
+**最佳实践:**
+- 生产环境修改 `JWT_SECRET`
+- 使用强 `INITIAL_PASSWORD`
+- 云端部署启用 HTTPS
+- 定期轮换 API keys
+
+**9Router 存储的内容:**
+- 提供商 OAuth tokens(加密)
+- API keys(加密)
+- 使用统计(仅本地)
+- 组合配置
+
+**9Router 不存储的内容:**
+- 你的 prompt 或响应
+- 你生成的代码
+- 个人信息
+
+---
+
+## 如何更新 9Router?
+
+**更新方式取决于安装类型:**
+
+### 全局 NPM 安装
+```bash
+npm update -g 9router
+```
+
+### 本地安装
+```bash
+cd 9router/app
+git pull origin main
+npm install
+npm run build
+npm start
+```
+
+### Docker
+```bash
+docker pull 9router:latest
+docker stop 9router
+docker rm 9router
+docker run -d \
+ -p 3000:3000 \
+ -v 9router-data:/app/data \
+ 9router:latest
+```
+
+**查看版本:**
+```bash
+9router --version
+```
+
+**破坏性变更:**
+- 查看 [CHANGELOG.md](https://github.com/decolua/9router/blob/main/CHANGELOG.md)
+- 大版本更新前备份 `~/.9router`
+- 阅读大版本的迁移指南
+
+---
+
+## 如何贡献?
+
+**欢迎贡献!**
+
+### 贡献方式:
+
+1. **报告 bug:**
+ - [GitHub Issues](https://github.com/decolua/9router/issues)
+ - 附上错误日志、复现步骤
+
+2. **功能请求:**
+ - [GitHub Discussions](https://github.com/decolua/9router/discussions)
+ - 描述使用场景和价值
+
+3. **提交代码:**
+ ```bash
+ # Fork 仓库
+ git clone https://github.com/YOUR_USERNAME/9router.git
+ cd 9router
+
+ # 创建分支
+ git checkout -b feature/your-feature
+
+ # 修改代码
+ npm install
+ npm run dev
+
+ # 测试
+ npm test
+
+ # 提交并推送
+ git add .
+ git commit -m "Add your feature"
+ git push origin feature/your-feature
+
+ # 在 GitHub 上创建 Pull Request
+ ```
+
+4. **改进文档:**
+ - 修正错别字、添加示例
+ - 翻译到其他语言
+ - 编写教程
+
+5. **添加提供商:**
+ - 实现新的 provider adapter
+ - 参考 `app/lib/providers/` 中的示例
+
+**贡献指南:**
+- 遵循现有代码风格
+- 为新功能添加测试
+- 更新文档
+- 提交保持原子化、描述清晰
+
+详情见 [CONTRIBUTING.md](https://github.com/decolua/9router/blob/main/CONTRIBUTING.md)。
+
+---
+
+## 需要更多帮助?
+
+- **文档:** [9router.com/docs](https://9router.com/docs)
+- **GitHub:** [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **故障排除:** [troubleshooting.md](troubleshooting.md)
diff --git a/gitbook/content/zh-CN/features/combos.md b/gitbook/content/zh-CN/features/combos.md
new file mode 100644
index 0000000..aa3456d
--- /dev/null
+++ b/gitbook/content/zh-CN/features/combos.md
@@ -0,0 +1,537 @@
+# 组合(Combos)- 自定义回退链
+
+创建自定义的模型组合并自动回退。组合让你根据成本、质量和可用性定义自己的路由策略。
+
+---
+
+## 什么是组合?
+
+组合是你在仪表盘中创建的 **自定义回退链**。它不是单一模型,而是定义一组顺序模型,由 9Router 依次尝试。
+
+**示例:**
+```
+组合名: premium-coding
+模型:
+ 1. cc/claude-opus-4-5-20251101 (首选)
+ 2. glm/glm-4.7 (#1 配额耗尽时)
+ 3. minimax/MiniMax-M2.1 (#2 配额耗尽时)
+```
+
+**CLI 中使用:**
+```
+Model: premium-coding
+```
+
+9Router 会按顺序自动尝试每个模型,直到成功为止。
+
+---
+
+## 为什么使用组合?
+
+### 1. 最大化订阅价值
+```
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ 先用订阅,低价备用,免费应急
+→ 充分利用你已付费的订阅
+```
+
+### 2. 最小化成本
+```
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+
+→ 从最便宜的付费选项开始(每 1M $0.60)
+→ 回退到更便宜的(每 1M $0.20)
+→ 应急免费层
+→ 总成本: 约 $5-10/月,而 ChatGPT API 需要 $2000
+```
+
+### 3. 保障 24/7 可用
+```
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7 → if/kimi-k2-thinking
+
+→ 末尾总是放免费层
+→ 永不耗尽配额
+→ 随时随地编码
+```
+
+### 4. 质量优化
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → gc/gemini-3-pro
+
+→ 优先最好的模型
+→ 回退到其他高端模型
+→ 整个回退链保持高质量
+```
+
+---
+
+## 如何创建组合
+
+### 步骤 1:打开仪表盘
+
+```
+http://localhost:20128
+→ 用密码登录
+```
+
+### 步骤 2:进入组合页面
+
+```
+仪表盘 → 组合 → 新建组合
+```
+
+### 步骤 3:配置组合
+
+**组合名:**
+```
+premium-coding
+```
+
+**描述(可选):**
+```
+订阅优先,低价备用,免费应急
+```
+
+**选择模型:**
+```
+1. cc/claude-opus-4-5-20251101
+2. glm/glm-4.7
+3. minimax/MiniMax-M2.1
+```
+
+**拖动排序** - 自上而下表示优先级。
+
+### 步骤 4:保存
+
+```
+点击 "Save Combo"
+→ 组合出现在模型列表中
+```
+
+### 步骤 5:在 CLI 中使用
+
+```
+Cursor/Cline/任意工具:
+ Model: premium-coding
+```
+
+---
+
+## 示例组合
+
+### 示例 1:Premium Coding(订阅 → 低价 → 免费)
+
+**目标**:最大化订阅价值,最小化额外成本。
+
+```
+仪表盘 → 组合 → 新建
+
+名称: premium-coding
+模型:
+ 1. cc/claude-opus-4-5-20251101
+ 2. glm/glm-4.7
+ 3. minimax/MiniMax-M2.1
+```
+
+**用法:**
+```
+Cursor IDE:
+ Model: premium-coding
+```
+
+**行为:**
+```
+早上(全新配额):
+ 请求 → cc/claude-opus-4-5 ✅
+
+下午(Claude 配额用完):
+ 请求 → glm/glm-4.7 ✅ (自动切换)
+
+晚上(GLM 配额用完):
+ 请求 → minimax/MiniMax-M2.1 ✅ (自动切换)
+```
+
+**月成本(100M tokens):**
+```
+80M 通过 Claude Code: $0(订阅)
+15M 通过 GLM: $9
+5M 通过 MiniMax: $1
+合计: $10 + 你的订阅
+```
+
+**节省**:相比 ChatGPT API($2000)约 99%。
+
+---
+
+### 示例 2:Budget Combo(低价 → 免费)
+
+**目标**:最小化成本,免费层作为备用。
+
+```
+仪表盘 → 组合 → 新建
+
+名称: budget-combo
+模型:
+ 1. glm/glm-4.7
+ 2. minimax/MiniMax-M2.1
+ 3. if/kimi-k2-thinking
+```
+
+**用法:**
+```
+Cline:
+ Provider: OpenAI Compatible
+ Base URL: http://localhost:20128/v1
+ Model: budget-combo
+```
+
+**行为:**
+```
+请求 → glm/glm-4.7
+ ✅ 每日配额可用 → 使用 GLM(每 1M $0.60)
+ ❌ 配额耗尽 → 尝试 MiniMax(每 1M $0.20)
+ ❌ MiniMax 配额用完 → 使用 iFlow(免费)
+```
+
+**月成本(100M tokens):**
+```
+70M 通过 GLM: $42
+20M 通过 MiniMax: $4
+10M 通过 iFlow: $0
+合计: $46,而 ChatGPT API 需 $2000
+```
+
+**节省**:97%。
+
+---
+
+### 示例 3:Free Combo(零成本)
+
+**目标**:100% 免费,永不付费。
+
+```
+仪表盘 → 组合 → 新建
+
+名称: free-combo
+模型:
+ 1. if/kimi-k2-thinking
+ 2. qw/qwen3-coder-plus
+ 3. kr/claude-sonnet-4.5
+```
+
+**用法:**
+```
+Claude Desktop:
+ Model: free-combo
+```
+
+**行为:**
+```
+请求 → if/kimi-k2-thinking
+ ✅ 可用 → 使用 iFlow
+ ❌ 错误 → 尝试 Qwen
+ ❌ 错误 → 尝试 Kiro
+```
+
+**月成本:**
+```
+100M tokens 通过免费提供商: $0
+合计: 永远 $0
+```
+
+**适用场景**:个人项目、学习、试验。
+
+---
+
+### 示例 4:Quality First(仅高端模型)
+
+**目标**:最高质量,无低价回退。
+
+```
+仪表盘 → 组合 → 新建
+
+名称: quality-first
+模型:
+ 1. cc/claude-opus-4-5-20251101
+ 2. cx/gpt-5.2-codex
+ 3. gc/gemini-3-pro-preview
+```
+
+**用法:**
+```
+Codex CLI:
+ export OPENAI_BASE_URL="http://localhost:20128"
+ Model: quality-first
+```
+
+**行为:**
+```
+请求 → cc/claude-opus-4-5
+ ❌ 配额用完 → cx/gpt-5.2-codex
+ ❌ 配额用完 → gc/gemini-3-pro-preview
+ ❌ 全部用完 → 返回错误(无低价回退)
+```
+
+**适用场景**:关键生产代码、复杂重构。
+
+---
+
+### 示例 5:Multi-Subscription(用足所有订阅)
+
+**目标**:在产生额外费用前用足所有订阅。
+
+```
+仪表盘 → 组合 → 新建
+
+名称: multi-sub
+模型:
+ 1. gc/gemini-3-flash-preview (每月免费 180K)
+ 2. cc/claude-opus-4-5-20251101 (Pro 订阅)
+ 3. cx/gpt-5.2-codex (Plus 订阅)
+ 4. gh/gpt-5 (Copilot 订阅)
+ 5. glm/glm-4.7 (低价备用)
+ 6. if/kimi-k2-thinking (免费应急)
+```
+
+**月成本(200M tokens):**
+```
+50M 通过 Gemini CLI: $0(免费层)
+80M 通过 Claude Code: $0(订阅)
+40M 通过 Codex: $0(订阅)
+20M 通过 Copilot: $0(订阅)
+8M 通过 GLM: $4.80
+2M 通过 iFlow: $0
+合计: $4.80 + 你已有的订阅
+```
+
+**结果**:190M tokens 来自订阅,只有 $4.80 额外费用。
+
+---
+
+### 示例 6:配额重置优化
+
+**目标**:根据重置时间分配使用。
+
+```
+仪表盘 → 组合 → 新建
+
+名称: reset-optimized
+模型:
+ 1. cc/claude-opus-4-5 (5h 重置, 早上用)
+ 2. gc/gemini-3-flash (每日 1K, 下午用)
+ 3. glm/glm-4.7 (每日 10AM 重置, 晚上用)
+ 4. minimax/MiniMax-M2.1 (5h 滚动, 夜里用)
+ 5. if/kimi-k2-thinking (无限, 应急)
+```
+
+**日常安排:**
+```
+08:00 - 13:00: Claude Code(全新 5h 配额)
+13:00 - 18:00: Gemini CLI(每日 1K 配额)
+18:00 - 22:00: GLM(次日 10AM 重置)
+22:00 - 08:00: MiniMax(5h 滚动)或 iFlow
+```
+
+**结果**:24/7 编码,成本极低。
+
+---
+
+## 在 CLI 工具中使用组合
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [从仪表盘获取]
+ Model: premium-coding
+```
+
+### Claude Desktop
+
+编辑 `~/.claude/config.json`:
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key",
+ "model": "budget-combo"
+}
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex --model quality-first "your prompt"
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [从仪表盘获取]
+Model: free-combo
+```
+
+### API 请求
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "premium-coding",
+ "messages": [
+ {"role": "user", "content": "Write a function to..."}
+ ],
+ "stream": true
+ }'
+```
+
+---
+
+## 最佳实践
+
+### 1. 总是包含免费层
+
+```
+✅ 好:
+cc/claude-opus → glm/glm-4.7 → if/kimi-k2-thinking
+
+❌ 不好:
+cc/claude-opus → glm/glm-4.7
+(无免费回退,可能耗尽配额)
+```
+
+**原因**:确保 24/7 可用,绝不会被配额卡住。
+
+### 2. 按成本排序(便宜 → 贵)
+
+```
+✅ 好:
+glm/glm-4.7 → minimax/MiniMax-M2.1 → cc/claude-opus
+
+❌ 不好:
+cc/claude-opus → glm/glm-4.7
+(在简单任务上浪费订阅配额)
+```
+
+**例外**:如果想充分利用订阅价值,把订阅放在最前面。
+
+### 3. 匹配质量要求
+
+```
+生产代码:
+cc/claude-opus → cx/gpt-5.2-codex → glm/glm-4.7
+
+简单任务:
+glm/glm-4.7 → if/kimi-k2-thinking
+
+试验:
+if/kimi-k2-thinking → qw/qwen3-coder-plus
+```
+
+### 4. 考虑配额重置时间
+
+```
+早上组合(配额刚刷新):
+cc/claude-opus → cx/gpt-5.2-codex
+
+晚上组合(配额大概率耗尽):
+glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+### 5. 为不同场景创建多个组合
+
+```
+premium-coding: 复杂任务
+budget-combo: 简单任务
+free-combo: 试验
+quality-first: 生产代码
+```
+
+**根据任务需求切换组合**。
+
+### 6. 监控组合性能
+
+```
+仪表盘 → 分析 → 组合使用:
+ premium-coding:
+ 80% 通过 cc/claude-opus(良好,使用订阅)
+ 15% 通过 glm/glm-4.7(可接受备用)
+ 5% 通过 minimax(罕见回退)
+```
+
+**优化**:回退使用过多时,提高主配额或重新排序模型。
+
+---
+
+## 高级配置
+
+### 为组合设置预算上限
+
+```
+仪表盘 → 组合 → 编辑 → 预算:
+ 每日上限: $5
+ 每月上限: $50
+```
+
+达到上限时,9Router 跳过付费模型,仅使用免费层。
+
+### 启用/禁用组合中的模型
+
+```
+仪表盘 → 组合 → 编辑 → 模型:
+ ✅ cc/claude-opus-4-5(启用)
+ ❌ glm/glm-4.7(暂时禁用)
+ ✅ if/kimi-k2-thinking(启用)
+```
+
+**用途**:暂时禁用昂贵模型而不删除组合。
+
+### 克隆已有组合
+
+```
+仪表盘 → 组合 → 克隆 "premium-coding"
+→ 生成带 "-copy" 后缀的副本
+→ 修改后另存为新组合
+```
+
+**用途**:为不同场景创建变体。
+
+---
+
+## 故障排除
+
+**问题:组合未出现在模型列表中**
+
+**方案:**
+1. 刷新仪表盘
+2. 检查组合已保存(绿色对勾)
+3. 重启 CLI 工具以刷新模型列表
+
+**问题:组合总是用最后一个模型(免费层)**
+
+**方案:**
+1. 检查主模型的配额(仪表盘 → 配额)
+2. 确认 API keys 有效(仪表盘 → 提供商)
+3. 检查是否超出预算上限
+
+**问题:组合成本超出预期**
+
+**方案:**
+1. 仪表盘 → 分析 → 查看组合使用情况
+2. 检查主模型是否配额耗尽
+3. 重新排序模型(更便宜的放前面)
+4. 设置预算上限
+
+---
+
+## 相关
+
+- [智能路由](./smart-routing.md) - 自动回退如何工作
+- [配额跟踪](./quota-tracking.md) - 监控使用与成本
diff --git a/gitbook/content/zh-CN/features/quota-tracking.md b/gitbook/content/zh-CN/features/quota-tracking.md
new file mode 100644
index 0000000..8763cb4
--- /dev/null
+++ b/gitbook/content/zh-CN/features/quota-tracking.md
@@ -0,0 +1,687 @@
+# 配额跟踪 & 使用监控
+
+实时跟踪 token 消耗、监控配额上限、估算成本,并在配额用尽前获得提醒。绝不浪费订阅配额,也不超出预算上限。
+
+---
+
+## 概览
+
+9Router 为所有提供商提供完善的配额跟踪:
+
+- **实时 token 消耗** - 查看每次请求使用的 tokens
+- **配额上限与剩余** - 跟踪使用 vs 上限
+- **重置倒计时** - 了解配额何时刷新
+- **成本估算** - 计算付费层支出
+- **月度报告** - 分析使用模式
+- **告警与通知** - 接近上限时收到警告
+
+---
+
+## 仪表盘总览
+
+### 配额摘要
+
+```
+仪表盘 → 主页 → 配额概览
+
+┌─────────────────────────────────────────────┐
+│ Claude Code (cc/) │
+│ ████████████░░░░░░░░ 2.5h / 5h (50%) │
+│ 重置剩余: 2h 30m │
+│ 成本: $0(订阅) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ Gemini CLI (gc/) │
+│ ████████░░░░░░░░░░░░ 450 / 1000 (45%) │
+│ 每日重置剩余: 18h 30m │
+│ 本月: 45K / 180K (25%) │
+│ 成本: $0(免费层) │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ GLM-4.7 (glm/) │
+│ ██████████████░░░░░░ 7M / 10M tokens (70%) │
+│ 重置: 每日 10:00 AM(5h 35m 后) │
+│ 今日成本: $4.20 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ MiniMax M2.1 (minimax/) │
+│ ████████████████░░░░ 4M / 5M tokens (80%) │
+│ 5h 滚动窗口 │
+│ 成本(5h): $0.80 │
+└─────────────────────────────────────────────┘
+
+┌─────────────────────────────────────────────┐
+│ iFlow (if/) │
+│ ████████████████████ 无限 │
+│ 成本: $0(永久免费) │
+└─────────────────────────────────────────────┘
+```
+
+---
+
+## 实时 Token 消耗
+
+### 按请求跟踪
+
+每次请求都会显示详细的 token 使用情况:
+
+```
+仪表盘 → 活动 → 最近请求
+
+请求 #1234
+模型: cc/claude-opus-4-5-20251101
+时间戳: 2026-02-04 04:15:32
+
+Tokens:
+ 输入: 1,250 tokens
+ 输出: 850 tokens
+ 合计: 2,100 tokens
+
+成本: $0(订阅配额)
+耗时: 3.2s
+状态: ✅ 成功
+```
+
+### 实时使用监控
+
+```
+仪表盘 → 实时监控
+
+当前请求:
+ 模型: glm/glm-4.7
+ 已流式输出 tokens: 450 / 预计 ~800
+ 当前成本: $0.0009
+ 耗时: 1.8s
+```
+
+### 按模型分解 Token
+
+```
+仪表盘 → 分析 → Token 使用
+
+今日(2026-02-04):
+ cc/claude-opus-4-5: 15M tokens($0,订阅)
+ glm/glm-4.7: 8M tokens($4.80)
+ if/kimi-k2-thinking: 3M tokens($0,免费)
+
+合计: 26M tokens
+成本: $4.80
+```
+
+---
+
+## 配额上限与重置时间
+
+### 订阅型提供商
+
+**Claude Code (Pro/Max)**
+```
+配额类型: 基于时间(5 小时滚动)
+上限: 5 小时使用时长
+重置: 5 小时滚动窗口 + 每周刷新
+跟踪: 每个模型的使用时间
+
+仪表盘显示:
+ Opus: 已用 2.5h / 5h
+ Sonnet: 已用 1.2h / 5h
+ Haiku: 已用 0.8h / 5h
+
+每周重置: 每周一 00:00 UTC
+```
+
+**OpenAI Codex (Plus/Pro)**
+```
+配额类型: 基于时间(5 小时滚动)
+上限: 5 小时(Plus)/ 10 小时(Pro)
+重置: 5 小时滚动窗口 + 每周刷新
+
+仪表盘显示:
+ GPT-5.2 Codex: 已用 3.5h / 5h
+ 重置剩余: 1h 30m
+```
+
+**Gemini CLI(免费)**
+```
+配额类型: 请求次数 + 月度 tokens
+每日上限: 1,000 次请求
+月度上限: 180,000 次补全
+重置: 每日 00:00 UTC + 每月 1 日
+
+仪表盘显示:
+ 今日: 450 / 1,000 次请求 (45%)
+ 本月: 45K / 180K 次补全 (25%)
+ 每日重置剩余: 18h 30m
+ 月度重置剩余: 26 天
+```
+
+**GitHub Copilot**
+```
+配额类型: 月度使用量
+上限: 因套餐而异
+重置: 每月 1 日
+
+仪表盘显示:
+ 使用: 月度配额 60%
+ 重置: 2026 年 3 月 1 日(25 天后)
+```
+
+### 低价提供商
+
+**GLM-4.7**
+```
+配额类型: 每日 token 上限
+上限: 10M tokens/天(Coding Plan)
+重置: 每日 10:00 AM 北京时间(UTC+8)
+
+仪表盘显示:
+ 已用: 7M / 10M tokens (70%)
+ 剩余: 3M tokens
+ 重置剩余: 5h 35m
+ 今日成本: $4.20
+```
+
+**MiniMax M2.1**
+```
+配额类型: 5 小时滚动窗口
+上限: 每 5 小时 5M tokens
+重置: 连续滚动窗口
+
+仪表盘显示:
+ 已用(5h): 4M / 5M tokens (80%)
+ 最早一次使用过期: 45m
+ 成本(5h): $0.80
+```
+
+**Kimi K2**
+```
+配额类型: 月度订阅
+上限: 10M tokens/月($9 固定)
+重置: 订阅日每月一次
+
+仪表盘显示:
+ 已用: 6M / 10M tokens (60%)
+ 重置: 2026 年 2 月 15 日(11 天后)
+ 成本: $9/月(预付)
+```
+
+### 免费提供商
+
+**iFlow / Qwen / Kiro**
+```
+配额类型: 无限(限速)
+上限: 无硬上限
+重置: 不适用
+
+仪表盘显示:
+ 今日已用: 5M tokens
+ 成本: $0(永久免费)
+ 状态: ✅ 可用
+```
+
+---
+
+## 成本估算
+
+### 实时成本跟踪
+
+```
+仪表盘 → 成本 → 今日
+
+订阅型提供商: $0
+ Claude Code: 15M tokens($0,包含)
+ Gemini CLI: 3M tokens($0,免费层)
+
+付费提供商: $4.80
+ GLM-4.7: 8M tokens($4.80)
+ 输入: 6M × $0.60/1M = $3.60
+ 输出: 2M × $2.20/1M = $4.40
+ 合计: $4.80
+
+免费提供商: $0
+ iFlow: 3M tokens($0)
+
+今日合计: $4.80
+```
+
+### 月度支出报告
+
+```
+仪表盘 → 成本 → 本月(2026 年 2 月)
+
+第 1 周(2 月 1-7 日):
+ 订阅: $0(80M tokens)
+ 付费: $15.20(25M tokens)
+ 免费: $0(10M tokens)
+ 合计: $15.20
+
+第 2 周(2 月 8-14 日):
+ 订阅: $0(75M tokens)
+ 付费: $12.80(20M tokens)
+ 免费: $0(8M tokens)
+ 合计: $12.80
+
+本月至今: $28.00
+预计(30 天): ~$120
+
+按提供商分解:
+ GLM-4.7: $22.00 (78%)
+ MiniMax M2.1: $6.00 (22%)
+
+每 1M tokens 平均成本: $0.62
+相比 ChatGPT API 节省: 97%($4,000 → $120)
+```
+
+### 成本预测
+
+```
+仪表盘 → 成本 → 预测
+
+基于近 7 天使用:
+ 日均: 50M tokens
+ 日成本: $4.50
+
+月度预测:
+ Tokens: 1,500M (1.5B)
+ 成本: $135
+
+分解:
+ 订阅: 900M tokens($0)
+ GLM-4.7: 450M tokens($90)
+ MiniMax: 120M tokens($24)
+ 免费: 30M tokens($0)
+
+预算状态:
+ 每日上限: $5 → 今日已用 90%
+ 每月上限: $150 → 预计 90%
+ ⚠️ 警告: 可能超出每月预算
+```
+
+---
+
+## 使用仪表盘
+
+### 总览统计
+
+```
+仪表盘 → 分析 → 总览
+
+今日(2026-02-04):
+ 请求: 1,234
+ Tokens: 26M
+ 成本: $4.80
+ 平均响应时间: 2.1s
+
+本周:
+ 请求: 8,456
+ Tokens: 180M
+ 成本: $28.00
+ 成功率: 99.2%
+
+本月:
+ 请求: 15,234
+ Tokens: 320M
+ 成本: $52.00
+ Top 模型: cc/claude-opus-4-5 (45%)
+```
+
+### 按模型使用
+
+```
+仪表盘 → 分析 → 模型
+
+Top 模型(本月):
+1. cc/claude-opus-4-5: 145M tokens (45%)
+2. glm/glm-4.7: 95M tokens (30%)
+3. if/kimi-k2-thinking: 50M tokens (16%)
+4. minimax/MiniMax-M2.1: 20M tokens (6%)
+5. gc/gemini-3-flash: 10M tokens (3%)
+
+成本分解:
+ cc/claude-opus: $0(订阅)
+ glm/glm-4.7: $45.00
+ if/kimi-k2-thinking: $0(免费)
+ minimax/MiniMax-M2.1: $7.00
+ gc/gemini-3-flash: $0(免费)
+```
+
+### 按时间使用
+
+```
+仪表盘 → 分析 → 时间线
+
+按小时使用(今日):
+00:00 - 01:00: 0.5M tokens
+01:00 - 02:00: 0.2M tokens
+...
+08:00 - 09:00: 3.2M tokens(峰值)
+09:00 - 10:00: 2.8M tokens
+...
+23:00 - 00:00: 0.8M tokens
+
+峰值时段: 08:00 - 12:00(早上编码)
+低谷时段: 00:00 - 06:00(夜间)
+```
+
+### 按组合使用
+
+```
+仪表盘 → 分析 → 组合
+
+premium-coding:
+ 请求: 456
+ Tokens: 12M
+ 成本: $2.40
+
+ 分解:
+ cc/claude-opus: 8M tokens (67%, $0)
+ glm/glm-4.7: 3M tokens (25%, $1.80)
+ minimax/MiniMax-M2.1: 1M tokens (8%, $0.20)
+
+budget-combo:
+ 请求: 234
+ Tokens: 6M
+ 成本: $1.20
+
+ 分解:
+ glm/glm-4.7: 4M tokens (67%, $2.40)
+ if/kimi-k2-thinking: 2M tokens (33%, $0)
+```
+
+---
+
+## 告警与通知
+
+### 配额告警
+
+```
+仪表盘 → 设置 → 告警
+
+配额预警:
+ ✅ 配额使用 80% 时告警
+ ✅ 配额使用 90% 时告警
+ ✅ 配额耗尽时告警
+ ✅ 配额重置时通知
+
+发送方式:
+ ✅ 仪表盘通知
+ ✅ 邮件(可选)
+ ✅ Webhook(可选)
+```
+
+**通知示例:**
+```
+⚠️ Claude Code 配额已用 80%
+ 剩余 2.5h(1h 30m 后重置)
+
+⚠️ GLM-4.7 配额已用 90%
+ 剩余 1M tokens(5h 后重置)
+
+✅ Gemini CLI 配额已重置
+ 1,000 次请求可用(每日上限)
+```
+
+### 预算告警
+
+```
+仪表盘 → 设置 → 预算告警
+
+每日预算: $5
+ ✅ 80%($4)告警
+ ✅ 100%($5)告警
+ ✅ 超额时自动切换到免费层
+
+每月预算: $150
+ ✅ 50%($75)告警
+ ✅ 80%($120)告警
+ ✅ 100%($150)告警
+```
+
+**通知示例:**
+```
+⚠️ 每日预算已用 80%
+ 今日花费 $4.00 / $5.00
+
+⚠️ 每月预算达到 50%
+ 本月花费 $75 / $150
+ 预计: $135(预算内)
+
+🚨 每日预算超额
+ 今日花费 $5.20 / $5.00
+ 已自动切换到免费层
+```
+
+### 成本异常检测
+
+```
+仪表盘 → 设置 → 异常检测
+
+✅ 检测异常支出模式
+✅ 成本峰值告警(>2× 日均)
+✅ 配额耗尽模式警告
+
+告警示例:
+⚠️ 检测到成本峰值
+ 今日: $12.50(2.5× 日均)
+ 原因: GLM-4.7 高用量(20M tokens)
+ 建议: 检查主模型是否配额耗尽
+```
+
+---
+
+## 最佳实践
+
+### 1. 每日监控配额
+
+```
+日常:
+1. 查看仪表盘配额概览(30 秒)
+2. 检查重置时间
+3. 根据配额可用性规划使用
+```
+
+**示例:**
+```
+早晨检查:
+ ✅ Claude Code: 5h 可用(刚重置)
+ ✅ Gemini CLI: 1K 请求可用
+ ⚠️ GLM-4.7: 剩 2M tokens(10AM 重置)
+
+行动: 早上工作用 Claude Code
+```
+
+### 2. 设置预算上限
+
+```
+仪表盘 → 设置 → 预算:
+ 每日: $5(防止超支)
+ 每月: $150(与预算对齐)
+```
+
+**结果**:达到上限时自动切换到免费层。
+
+### 3. 优化组合使用
+
+```
+仪表盘 → 分析 → 组合:
+ 查看哪些模型用得最多
+ 调整组合顺序以最小化成本
+```
+
+**示例:**
+```
+当前: cc/claude-opus → glm/glm-4.7
+ 80% 通过 Claude(好)
+ 20% 通过 GLM($12/月)
+
+优化后: gc/gemini-3-flash → cc/claude-opus → glm/glm-4.7
+ 50% 通过 Gemini(免费)
+ 40% 通过 Claude(订阅)
+ 10% 通过 GLM($6/月)
+
+节省: $6/月
+```
+
+### 4. 跟踪重置时间
+
+```
+仪表盘 → 配额 → 重置日程:
+ Claude Code: 5h 滚动 + 每周一
+ Gemini CLI: 每日 00:00 UTC + 每月 1 日
+ GLM-4.7: 每日 10:00 AM 北京时间
+ MiniMax: 5h 滚动窗口
+```
+
+**策略**:配额刚刷新时使用对应提供商。
+
+### 5. 查看月度报告
+
+```
+仪表盘 → 分析 → 月度报告:
+ 总 tokens: 1.5B
+ 总成本: $120
+ 节省: 相比 ChatGPT API 节省 97%
+
+洞察:
+ - 60% 用量来自订阅($0)
+ - 30% 通过 GLM($90)
+ - 10% 通过免费层($0)
+
+优化:
+ - 增加 Gemini CLI 用量(免费)
+ - 减少 GLM 用量(更贵)
+```
+
+---
+
+## API 访问
+
+### 获取配额状态
+
+```bash
+GET http://localhost:20128/api/quota
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "providers": [
+ {
+ "id": "cc",
+ "name": "Claude Code",
+ "quota": {
+ "used": 2.5,
+ "limit": 5,
+ "unit": "hours",
+ "percentage": 50
+ },
+ "reset": {
+ "type": "rolling",
+ "window": "5h",
+ "nextReset": "2026-02-04T06:45:00Z"
+ },
+ "cost": {
+ "today": 0,
+ "month": 0,
+ "currency": "USD"
+ }
+ },
+ {
+ "id": "glm",
+ "name": "GLM-4.7",
+ "quota": {
+ "used": 7000000,
+ "limit": 10000000,
+ "unit": "tokens",
+ "percentage": 70
+ },
+ "reset": {
+ "type": "daily",
+ "time": "10:00 AM UTC+8",
+ "nextReset": "2026-02-04T10:00:00+08:00"
+ },
+ "cost": {
+ "today": 4.20,
+ "month": 52.00,
+ "currency": "USD"
+ }
+ }
+ ]
+}
+```
+
+### 获取使用统计
+
+```bash
+GET http://localhost:20128/api/usage?period=today
+Authorization: Bearer your-api-key
+
+Response:
+{
+ "period": "today",
+ "date": "2026-02-04",
+ "summary": {
+ "requests": 1234,
+ "tokens": 26000000,
+ "cost": 4.80
+ },
+ "byModel": [
+ {
+ "model": "cc/claude-opus-4-5",
+ "requests": 456,
+ "tokens": 15000000,
+ "cost": 0
+ },
+ {
+ "model": "glm/glm-4.7",
+ "requests": 234,
+ "tokens": 8000000,
+ "cost": 4.80
+ }
+ ]
+}
+```
+
+---
+
+## 故障排除
+
+**问题:配额显示 0% 但请求失败**
+
+**方案:**
+1. 检查提供商连接(仪表盘 → 提供商)
+2. 确认 API keys 有效
+3. 检查提供商是否宕机(状态页)
+4. 尝试重新连接 OAuth 提供商
+
+**问题:成本估算不正确**
+
+**方案:**
+1. 仪表盘 → 设置 → 定价
+2. 确认每个提供商的定价与当前一致
+3. 若提供商调整费率,更新定价
+4. 若差异持续,联系支持
+
+**问题:重置时间没有更新**
+
+**方案:**
+1. 刷新仪表盘(F5)
+2. 检查系统时间是否正确
+3. 确认时区设置
+4. 若问题持续,重启 9Router
+
+**问题:未收到告警**
+
+**方案:**
+1. 仪表盘 → 设置 → 告警
+2. 确认邮箱地址正确
+3. 检查垃圾邮件夹
+4. 测试通知(Send Test 按钮)
+
+---
+
+## 相关
+
+- [智能路由](./smart-routing.md) - 基于配额自动回退
+- [组合](./combos.md) - 创建自定义回退链
diff --git a/gitbook/content/zh-CN/features/smart-routing.md b/gitbook/content/zh-CN/features/smart-routing.md
new file mode 100644
index 0000000..4a78ebe
--- /dev/null
+++ b/gitbook/content/zh-CN/features/smart-routing.md
@@ -0,0 +1,407 @@
+# 智能路由 & 自动回退
+
+9Router 通过 3 层回退系统,自动将你的请求路由到最佳可用提供商。绝不再因配额限制或速率限制而中断编码。
+
+---
+
+## 工作原理
+
+9Router 使用智能路由,最大化已有订阅价值、最小化成本,并保障 24/7 可用:
+
+```
+请求 → 9Router → 检查第 1 层 (订阅)
+ ↓ 配额耗尽
+ 检查第 2 层 (低价)
+ ↓ 预算上限
+ 检查第 3 层 (免费)
+ ↓
+ 响应
+```
+
+### 3 层回退系统
+
+**第 1 层:订阅(主力)**
+- Claude Code(Pro/Max)
+- OpenAI Codex(Plus/Pro)
+- Gemini CLI(每月免费 180K)
+- GitHub Copilot
+- Antigravity(Google)
+
+**目标**:充分挖掘你已付费订阅的价值。
+
+**第 2 层:低价(备用)**
+- GLM-4.7(输入每 1M $0.60)
+- MiniMax M2.1(输入每 1M $0.20)
+- Kimi K2($9/月固定)
+
+**目标**:订阅配额用完后的超低价备用(比 ChatGPT API 便宜 ~90%)。
+
+**第 3 层:免费(应急)**
+- iFlow(8 个模型)
+- Qwen(3 个模型)
+- Kiro(Claude 免费)
+
+**目标**:零成本回退,实现无限编码。
+
+---
+
+## 自动切换
+
+9Router 实时监控配额,自动切换提供商:
+
+### 场景 1:订阅配额耗尽
+
+```
+用户请求 → cc/claude-opus-4-5
+ ↓ 配额耗尽(达到 5 小时限制)
+ 自动切换 → glm/glm-4.7
+ ↓ 每日配额耗尽
+ 自动切换 → minimax/MiniMax-M2.1
+ ↓ 5 小时配额耗尽
+ 自动切换 → if/kimi-k2-thinking (免费)
+ ↓
+ 响应已送达 ✅
+```
+
+**结果**:零停机,无缝体验。
+
+### 场景 2:速率限制
+
+```
+用户请求 → cx/gpt-5.2-codex
+ ↓ 速率受限(请求过多)
+ 自动切换 → glm/glm-4.7
+ ↓
+ 响应已送达 ✅
+```
+
+### 场景 3:提供商不可用
+
+```
+用户请求 → cc/claude-opus-4-5
+ ↓ 提供商错误(503)
+ 自动切换 → 下一个可用模型
+ ↓
+ 响应已送达 ✅
+```
+
+---
+
+## 模型选择逻辑
+
+9Router 基于以下因素选择最佳模型:
+
+1. **配额可用性** - 检查提供商是否仍有剩余配额
+2. **成本层级** - 优先订阅 → 低价 → 免费
+3. **重置时间** - 考虑配额何时重置
+4. **提供商健康度** - 跳过有错误的提供商
+
+### 优先级示例
+
+对 `cc/claude-opus-4-5` 的请求:
+
+```
+1. 检查 Claude Code 配额
+ ✅ 可用 → 使用 cc/claude-opus-4-5
+ ❌ 耗尽 → 继续步骤 2
+
+2. 检查回退层(若已配置)
+ ✅ GLM 配额可用 → 使用 glm/glm-4.7
+ ❌ 耗尽 → 继续步骤 3
+
+3. 检查免费层
+ ✅ iFlow 可用 → 使用 if/kimi-k2-thinking
+ ❌ 全部耗尽 → 返回配额错误
+```
+
+---
+
+## 配置选项
+
+### 仪表盘设置
+
+**1. 启用/禁用自动回退**
+
+```
+仪表盘 → 设置 → 智能路由
+→ 切换 "Auto Fallback" ON/OFF
+```
+
+- **ON**(默认):自动层级切换
+- **OFF**:严格模式,主模型不可用时返回错误
+
+**2. 设置预算上限**
+
+```
+仪表盘 → 设置 → 预算控制
+→ 每日上限: $5
+→ 每月上限: $50
+```
+
+预算耗尽时,9Router 自动切换到免费层。
+
+**3. 配置回退顺序**
+
+```
+仪表盘 → 设置 → 回退优先级
+→ 拖动以重新排序每层内的提供商
+```
+
+自定义顺序示例:
+```
+第 1 层: Gemini CLI → Claude Code → Codex
+第 2 层: MiniMax → GLM → Kimi
+第 3 层: iFlow → Kiro → Qwen
+```
+
+**4. 配额重置通知**
+
+```
+仪表盘 → 设置 → 通知
+→ 配额重置时邮件提醒
+→ 配额使用 80% 时告警
+```
+
+---
+
+## 示例
+
+### 示例 1:基础自动回退
+
+**设置:**
+```
+Model: cc/claude-opus-4-5-20251101
+Fallback: 自动(默认 3 层)
+```
+
+**行为:**
+```
+早上(全新配额):
+ 请求 → cc/claude-opus-4-5 ✅
+
+下午(配额耗尽):
+ 请求 → glm/glm-4.7 ✅ (自动切换)
+
+晚上(GLM 配额用完):
+ 请求 → minimax/MiniMax-M2.1 ✅ (自动切换)
+
+深夜(付费配额全部耗尽):
+ 请求 → if/kimi-k2-thinking ✅ (免费层)
+```
+
+**成本**:额外约 $5-10/月(大部分由订阅覆盖)。
+
+### 示例 2:预算优先路由
+
+**设置:**
+```
+仪表盘 → 设置:
+ 每日预算: $2
+ 每月预算: $20
+ Fallback: 启用
+```
+
+**行为:**
+```
+1-15 日(预算内):
+ 请求 → glm/glm-4.7 (低价层)
+ 成本: $1.50/天
+
+第 16 日(达到预算):
+ 请求 → if/kimi-k2-thinking (免费层)
+ 成本: $0
+
+下月(预算重置):
+ 请求 → 重新使用 glm/glm-4.7
+```
+
+**结果**:绝不超过 $20/月,始终可用。
+
+### 示例 3:仅订阅模式
+
+**设置:**
+```
+仪表盘 → 设置:
+ Auto Fallback: OFF
+ Strict mode: ON
+```
+
+**行为:**
+```
+请求 → cc/claude-opus-4-5
+ ✅ 配额可用 → 成功
+ ❌ 配额耗尽 → 返回错误(无回退)
+```
+
+**适用场景**:只想用付费订阅,绝不产生额外成本。
+
+### 示例 4:仅免费模式
+
+**设置:**
+```
+Model: if/kimi-k2-thinking
+Fallback: qw/qwen3-coder-plus → kr/claude-sonnet-4.5
+```
+
+**行为:**
+```
+所有请求 → 仅免费层
+成本: 永远 $0
+```
+
+**适用场景**:个人项目、学习、试验。
+
+---
+
+## 最佳实践
+
+### 1. 最大化订阅价值
+
+```
+策略:
+- 将订阅模型设为第 1 层
+- 在仪表盘监控配额使用
+- 仅在订阅耗尽时使用低价层
+```
+
+**示例组合:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 2. 成本优化
+
+```
+策略:
+- 先用 Gemini CLI 免费层(每月 180K)
+- 回退到 GLM/MiniMax(超低价)
+- 应急: iFlow(免费)
+```
+
+**示例组合:**
+```
+gc/gemini-3-flash-preview → glm/glm-4.7 → if/kimi-k2-thinking
+```
+
+### 3. 质量优先
+
+```
+策略:
+- 使用最佳模型(Claude Opus、GPT-5.2)
+- 回退到优秀的低价模型(GLM-4.7)
+- 最后手段: 免费层
+```
+
+**示例组合:**
+```
+cc/claude-opus-4-5 → cx/gpt-5.2-codex → glm/glm-4.7
+```
+
+### 4. 24/7 可用性
+
+```
+策略:
+- 回退链中总是包含免费层
+- 监控配额重置时间
+- 在多个提供商间分散使用
+```
+
+**示例组合:**
+```
+cc/claude-opus-4-5 → glm/glm-4.7 → minimax/MiniMax-M2.1 → if/kimi-k2-thinking
+```
+
+**结果**:永不耗尽配额,随时编码。
+
+---
+
+## 配额重置策略
+
+围绕配额重置时间规划使用:
+
+| 提供商 | 配额重置 | 策略 |
+|----------|-------------|----------|
+| **Claude Code** | 5 小时 + 每周 | 早上使用,配额最新鲜 |
+| **Codex** | 5 小时 + 每周 | Claude 配额用完后使用 |
+| **Gemini CLI** | 每日(1K)+ 每月(180K) | 全天均匀使用 |
+| **GLM-4.7** | 每日 10:00 AM | 晚上使用,次日上午重置 |
+| **MiniMax M2.1** | 5 小时滚动 | 任意时间用,跟踪滚动窗口 |
+| **iFlow/Qwen/Kiro** | 无限制 | 应急备用 |
+
+**日常安排示例:**
+```
+08:00 - 13:00: Claude Code(全新 5h 配额)
+13:00 - 18:00: Gemini CLI(每日 1K 配额)
+18:00 - 22:00: GLM-4.7(便宜,10AM 重置)
+22:00 - 08:00: MiniMax 或 iFlow(5h 滚动 或 免费)
+```
+
+---
+
+## 监控与告警
+
+### 仪表盘配额跟踪
+
+```
+仪表盘 → 配额概览:
+ Claude Code: 剩余 2.5h / 5h (50%)
+ Gemini CLI: 今日 450 / 1000 次请求
+ GLM-4.7: 5M / 10M tokens (8h 后重置)
+ MiniMax: 3M / 5M tokens (5h 滚动)
+```
+
+### 实时通知
+
+```
+仪表盘 → 通知:
+ ⚠️ Claude Code 配额使用 80%(剩 1h)
+ ✅ GLM-4.7 配额已重置(10M tokens 可用)
+ 💰 每日预算使用 50%($2.50 / $5)
+```
+
+### 使用分析
+
+```
+仪表盘 → 分析:
+ 今日: 50M tokens
+ - 30M 通过 Claude Code(订阅)
+ - 15M 通过 GLM-4.7($9)
+ - 5M 通过 iFlow(免费)
+
+ 成本: $9(对比 ChatGPT API $1000)
+ 节省: 99%
+```
+
+---
+
+## 故障排除
+
+**问题:"All providers quota exhausted"**
+
+**方案:**
+1. 查看仪表盘配额跟踪
+2. 等待配额重置(查看倒计时)
+3. 在回退链中加入免费层
+4. 或提高预算上限
+
+**问题:"Too many fallback switches"**
+
+**方案:**
+1. 检查主提供商是否宕机
+2. 提高配额上限(升级订阅)
+3. 使用更便宜的主模型(用 GLM 代替 Claude)
+
+**问题:"Unexpected costs"**
+
+**方案:**
+1. 仪表盘 → 分析 → 查看使用情况
+2. 设置每日/每月预算上限
+3. 非关键任务切换到免费层
+4. 使用带免费回退的组合
+
+---
+
+## 相关
+
+- [组合](./combos.md) - 创建自定义回退链
+- [配额跟踪](./quota-tracking.md) - 监控使用与成本
diff --git a/gitbook/content/zh-CN/getting-started/installation.md b/gitbook/content/zh-CN/getting-started/installation.md
new file mode 100644
index 0000000..07160d9
--- /dev/null
+++ b/gitbook/content/zh-CN/getting-started/installation.md
@@ -0,0 +1,478 @@
+# 安装
+
+9Router 的详细安装指南,附故障排除技巧。
+
+---
+
+## 要求
+
+### 系统要求
+
+- **Node.js**:版本 20.0.0 或更高
+- **npm**:版本 10.0.0 或更高(随 Node.js 安装)
+- **OS**:macOS、Linux、Windows(推荐 WSL)
+- **磁盘空间**:安装约需 200MB
+
+### 查看版本
+
+```bash
+node --version
+# 应显示 v20.x.x 或更高
+
+npm --version
+# 应显示 10.x.x 或更高
+```
+
+**没有 Node.js?** 从 [nodejs.org](https://nodejs.org/) 安装
+
+---
+
+## 安装方式
+
+### 方式 1:全局安装(推荐)
+
+全局安装,任何位置都能使用:
+
+```bash
+npm install -g 9router
+```
+
+**启动 9Router:**
+
+```bash
+9router
+```
+
+**优势:**
+- ✅ 任意目录均可运行
+- ✅ 命令简单:`9router`
+- ✅ 通过 `npm update -g 9router` 自动更新
+
+### 方式 2:本地安装
+
+在特定项目中安装:
+
+```bash
+mkdir my-9router
+cd my-9router
+npm install 9router
+```
+
+**启动 9Router:**
+
+```bash
+npx 9router
+```
+
+**优势:**
+- ✅ 项目隔离
+- ✅ 项目级版本控制
+- ✅ 不污染全局命名空间
+
+### 方式 3:源码安装(开发用)
+
+从 GitHub 克隆并构建:
+
+```bash
+git clone https://github.com/decolua/9router.git
+cd 9router/app
+npm install
+npm run build
+npm start
+```
+
+**优势:**
+- ✅ 最新开发特性
+- ✅ 可参与开发
+- ✅ 可自定义修改
+
+---
+
+## 首次运行
+
+### 启动服务器
+
+```bash
+9router
+```
+
+**发生了什么:**
+1. 服务器启动在 `http://localhost:20128`
+2. 仪表盘在浏览器中自动打开
+3. 数据目录创建在 `~/.9router`
+4. API key 自动生成
+
+### 仪表盘登录
+
+**默认凭据:**
+- 密码:`123456`
+
+**⚠️ 立即修改密码:**
+1. 登录仪表盘
+2. 设置 → 修改密码
+3. 使用强密码
+
+### 获取 API Key
+
+```
+仪表盘 → 设置 → API Keys
+→ 复制你的 API key
+→ 在 CLI 工具中使用
+```
+
+**API key 格式示例:**
+```
+9r_1234567890abcdef1234567890abcdef
+```
+
+---
+
+## 验证安装
+
+### 检查服务器状态
+
+```bash
+curl http://localhost:20128/health
+```
+
+**预期响应:**
+```json
+{
+ "status": "ok",
+ "version": "1.0.0"
+}
+```
+
+### 列出可用模型
+
+```bash
+curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+```
+
+**预期响应:**
+```json
+{
+ "object": "list",
+ "data": [
+ {
+ "id": "cc/claude-opus-4-5-20251101",
+ "object": "model",
+ "created": 1234567890,
+ "owned_by": "claude-code"
+ }
+ ]
+}
+```
+
+### 测试 Chat Completion
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Authorization: Bearer your-api-key" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "cc/claude-opus-4-5-20251101",
+ "messages": [
+ {"role": "user", "content": "Hello!"}
+ ]
+ }'
+```
+
+---
+
+## 配置
+
+### 环境变量
+
+创建 `.env` 文件或设置环境变量:
+
+```bash
+# Security (REQUIRED in production)
+export JWT_SECRET="your-secure-secret-change-this"
+export INITIAL_PASSWORD="your-password"
+
+# Storage
+export DATA_DIR="~/.9router"
+
+# Server
+export PORT="20128"
+export NODE_ENV="production"
+
+# Logging
+export ENABLE_REQUEST_LOGS="false"
+```
+
+### 数据目录
+
+**默认位置:** `~/.9router`
+
+**内容:**
+```
+~/.9router/
+ ├── db.json # 数据库(提供商、组合、使用)
+ ├── api-keys.json # API keys
+ └── logs/ # 请求日志(若启用)
+```
+
+**修改位置:**
+
+```bash
+export DATA_DIR="/custom/path"
+9router
+```
+
+### 端口配置
+
+**默认端口:** `20128`
+
+**修改端口:**
+
+```bash
+export PORT="3000"
+9router
+```
+
+**或用命令行:**
+
+```bash
+9router --port 3000
+```
+
+---
+
+## 故障排除
+
+### 端口已被占用
+
+**错误:**
+```
+Error: listen EADDRINUSE: address already in use :::20128
+```
+
+**方案 1:杀掉占用进程**
+
+```bash
+# 找到使用 20128 端口的进程
+lsof -i :20128
+
+# 杀掉进程
+kill -9
+```
+
+**方案 2:使用其他端口**
+
+```bash
+9router --port 3000
+```
+
+### 权限被拒绝
+
+**错误:**
+```
+Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/9router'
+```
+
+**方案:使用 sudo(不推荐)或修复 npm 权限**
+
+```bash
+# 修复 npm 权限(推荐)
+mkdir ~/.npm-global
+npm config set prefix '~/.npm-global'
+echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
+source ~/.bashrc
+
+# 然后重新安装
+npm install -g 9router
+```
+
+### Node.js 版本过低
+
+**错误:**
+```
+Error: The engine "node" is incompatible with this module
+```
+
+**方案:更新 Node.js**
+
+```bash
+# 使用 nvm(推荐)
+nvm install 20
+nvm use 20
+
+# 或从 nodejs.org 下载
+```
+
+### 仪表盘无法打开
+
+**问题:** 仪表盘没有自动打开
+
+**方案 1:手动打开**
+
+```
+http://localhost:20128
+```
+
+**方案 2:检查防火墙**
+
+```bash
+# macOS: 在 System Preferences → Security 中允许 Node.js
+# Linux: 检查 iptables
+# Windows: 检查 Windows Firewall
+```
+
+### 无法连接提供商
+
+**问题:** OAuth 登录失败或 API key 无效
+
+**方案 1:检查网络连接**
+
+```bash
+ping google.com
+```
+
+**方案 2:检查提供商状态**
+
+- Claude Code: [status.anthropic.com](https://status.anthropic.com)
+- OpenAI: [status.openai.com](https://status.openai.com)
+- Gemini: [status.cloud.google.com](https://status.cloud.google.com)
+
+**方案 3:重新生成 API key**
+
+```
+仪表盘 → 提供商 → 断开 → 重新连接
+```
+
+### 内存占用过高
+
+**问题:** 9Router 占用过多 RAM
+
+**方案:重启服务器**
+
+```bash
+# 停止
+pkill -f 9router
+
+# 启动
+9router
+```
+
+**或用 PM2 自动重启:**
+
+```bash
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+```
+
+---
+
+## 部署选项
+
+### 本地开发
+
+```bash
+npm install -g 9router
+9router
+```
+
+**适用场景:** 个人编码、测试
+
+### VPS/云服务器
+
+```bash
+# 安装
+npm install -g 9router
+
+# 配置
+export JWT_SECRET="your-secure-secret"
+export INITIAL_PASSWORD="your-password"
+export NODE_ENV="production"
+
+# 用 PM2 启动
+npm install -g pm2
+pm2 start 9router --name 9router
+pm2 save
+pm2 startup
+```
+
+**适用场景:** 团队访问、远程编码
+
+### Docker
+
+```bash
+docker pull 9router/9router:latest
+
+docker run -d \
+ -p 20128:20128 \
+ -e JWT_SECRET="your-secure-secret" \
+ -e INITIAL_PASSWORD="your-password" \
+ -v 9router-data:/root/.9router \
+ --name 9router \
+ 9router/9router:latest
+```
+
+**适用场景:** 容器化部署、Kubernetes
+
+### 反向代理(Nginx)
+
+```nginx
+server {
+ listen 80;
+ server_name your-domain.com;
+
+ location / {
+ proxy_pass http://localhost:20128;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+
+ # SSE support for streaming
+ proxy_buffering off;
+ proxy_read_timeout 86400;
+ }
+}
+```
+
+**适用场景:** HTTPS、自定义域名、负载均衡
+
+---
+
+## 卸载
+
+### 移除全局安装
+
+```bash
+npm uninstall -g 9router
+```
+
+### 移除数据目录
+
+```bash
+rm -rf ~/.9router
+```
+
+### 移除配置
+
+```bash
+# 从 shell 配置中移除环境变量
+nano ~/.bashrc # 或 ~/.zshrc
+# 删除 9router 相关的 export
+```
+
+---
+
+## 下一步
+
+- [入门指南](../getting-started.md) - 连接提供商并开始编码
+- [功能特性](../features/) - 探索配额跟踪、组合、部署
+- [故障排除](../troubleshooting.md) - 解决常见问题
+
+---
+
+## 需要帮助?
+
+- **网站**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/zh-CN/getting-started/quick-start.md b/gitbook/content/zh-CN/getting-started/quick-start.md
new file mode 100644
index 0000000..42207ce
--- /dev/null
+++ b/gitbook/content/zh-CN/getting-started/quick-start.md
@@ -0,0 +1,247 @@
+# 入门指南
+
+5 分钟启动 9Router,开始智能路由 AI 请求。
+
+---
+
+## 快速开始
+
+### 1. 安装
+
+```bash
+npm install -g 9router
+```
+
+**要求:** Node.js 20+([安装详情](getting-started/installation.md))
+
+### 2. 启动
+
+```bash
+9router
+```
+
+🎉 **仪表盘自动打开** 地址为 `http://localhost:20128`
+
+- 默认密码:`123456`(在仪表盘中修改)
+- API key 自动生成
+- 可立即连接提供商
+
+### 3. 连接提供商
+
+有 3 种方式连接提供商:
+
+#### 方式 A:OAuth(订阅型提供商)
+
+**适用于:** Claude Code、Codex、Gemini CLI、GitHub Copilot
+
+```
+仪表盘 → 提供商 → 连接 [提供商]
+→ OAuth 登录 → 自动刷新 token
+→ 启用配额跟踪
+```
+
+**示例:Claude Code**
+1. 点击 "Connect Claude Code"
+2. 用你的 Claude 账户登录
+3. 授权 9Router
+4. ✅ 完成!使用模型:`cc/claude-opus-4-5-20251101`
+
+#### 方式 B:API Key(低价提供商)
+
+**适用于:** GLM、MiniMax、Kimi、OpenRouter
+
+```
+仪表盘 → 提供商 → 添加 API Key
+→ 选择提供商
+→ 粘贴 API key
+→ 保存
+```
+
+**示例:GLM-4.7**
+1. 在 [Zhipu AI](https://open.bigmodel.cn/) 注册
+2. 从 Coding Plan 获取 API key
+3. 仪表盘 → 添加 API Key → 提供商:`glm` → 粘贴 key
+4. ✅ 完成!使用模型:`glm/glm-4.7`
+
+#### 方式 C:免费提供商(零成本)
+
+**适用于:** iFlow、Qwen、Kiro
+
+```
+仪表盘 → 提供商 → 连接 [免费提供商]
+→ 设备码或 OAuth
+→ 无限使用
+```
+
+**示例:iFlow**
+1. 点击 "Connect iFlow"
+2. 用 iFlow 账户登录
+3. 授权
+4. ✅ 完成!使用 8 个模型:`if/kimi-k2-thinking`、`if/qwen3-coder-plus` 等
+
+---
+
+## 4. 在 CLI 工具中使用
+
+将你的编码工具指向 9Router:
+
+### Cursor IDE
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [从 9router 仪表盘获取]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### Claude Desktop
+
+编辑 `~/.claude/config.json`:
+
+```json
+{
+ "anthropic_api_base": "http://localhost:20128/v1",
+ "anthropic_api_key": "your-9router-api-key"
+}
+```
+
+### Cline / Continue / RooCode
+
+```
+Provider: OpenAI Compatible
+Base URL: http://localhost:20128/v1
+API Key: [从仪表盘获取]
+Model: cc/claude-opus-4-5-20251101
+```
+
+### Codex CLI
+
+```bash
+export OPENAI_BASE_URL="http://localhost:20128"
+export OPENAI_API_KEY="your-9router-api-key"
+
+codex "your prompt"
+```
+
+---
+
+## 5. 创建智能组合(可选)
+
+组合(Combos)可在多个模型之间实现自动回退:
+
+```
+仪表盘 → 组合 → 新建
+
+名称: premium-coding
+模型:
+ 1. cc/claude-opus-4-5-20251101 (订阅主力)
+ 2. glm/glm-4.7 (低价备用, $0.6/1M)
+ 3. if/kimi-k2-thinking (免费回退)
+
+CLI 中使用: premium-coding
+```
+
+**工作原理:**
+1. 先尝试 Claude Opus(你的订阅)
+2. 配额耗尽 → GLM-4.7(超低价)
+3. 预算上限 → iFlow(免费)
+4. 零停机,自动切换!
+
+---
+
+## 可用模型
+
+### 订阅型模型(优先使用)
+
+**Claude Code (`cc/`)** - Pro/Max 订阅:
+- `cc/claude-opus-4-5-20251101` - Claude 4.5 Opus
+- `cc/claude-sonnet-4-5-20250929` - Claude 4.5 Sonnet
+- `cc/claude-haiku-4-5-20251001` - Claude 4.5 Haiku
+
+**Codex (`cx/`)** - Plus/Pro 订阅:
+- `cx/gpt-5.2-codex` - GPT 5.2 Codex
+- `cx/gpt-5.1-codex-max` - GPT 5.1 Codex Max
+
+**Gemini CLI (`gc/`)** - 每月免费 180K:
+- `gc/gemini-3-flash-preview` - Gemini 3 Flash Preview
+- `gc/gemini-2.5-pro` - Gemini 2.5 Pro
+
+**GitHub Copilot (`gh/`)** - 订阅:
+- `gh/gpt-5` - GPT-5
+- `gh/claude-4.5-sonnet` - Claude 4.5 Sonnet
+
+### 低价模型(备用)
+
+**GLM (`glm/`)** - 每 1M $0.6/$2.2:
+- `glm/glm-4.7` - GLM 4.7(每日 10AM 重置)
+
+**MiniMax (`minimax/`)** - 每 1M $0.20/$1.00:
+- `minimax/MiniMax-M2.1` - MiniMax M2.1(5h 重置)
+
+**Kimi (`kimi/`)** - $9/月(10M tokens):
+- `kimi/kimi-latest` - Kimi Latest
+
+### 免费模型(应急)
+
+**iFlow (`if/`)** - 8 个免费模型:
+- `if/kimi-k2-thinking` - Kimi K2 Thinking
+- `if/qwen3-coder-plus` - Qwen3 Coder Plus
+- `if/glm-4.7` - GLM 4.7
+- `if/deepseek-r1` - DeepSeek R1
+
+**Qwen (`qw/`)** - 3 个免费模型:
+- `qw/qwen3-coder-plus` - Qwen3 Coder Plus
+- `qw/qwen3-coder-flash` - Qwen3 Coder Flash
+
+**Kiro (`kr/`)** - 2 个免费模型:
+- `kr/claude-sonnet-4.5` - Claude Sonnet 4.5
+- `kr/claude-haiku-4.5` - Claude Haiku 4.5
+
+---
+
+## 成本优化策略
+
+### 月度预算:$10-20/月
+
+```
+1. 用 Gemini CLI 免费层(每月 180K)处理快速任务
+2. 用足 Claude Code 订阅配额(你已经付费了)
+3. 配额用完后回退到 GLM(每 1M $0.6)
+4. 应急: MiniMax M2.1(每 1M $0.20)或 iFlow(免费)
+
+真实案例(每月 100M tokens):
+ 60M 通过 Gemini CLI: $0(免费层)
+ 30M 通过 Claude Code: $0(你已有的订阅)
+ 8M 通过 GLM: $4.80
+ 2M 通过 MiniMax: $0.40
+ 合计: $5.20/月 + 已有订阅
+```
+
+### 配额重置策略
+
+```
+日常安排:
+1. 早上: 全新的 Claude Code 配额(5h 重置)
+2. 下午: 切换到 Gemini CLI(每日 1K)
+3. 晚上: GLM 每日配额(次日 10AM 重置)
+4. 深夜: MiniMax(5h 滚动)或 iFlow(免费)
+
+→ 24/7 编码,几乎零额外成本!
+```
+
+---
+
+## 下一步
+
+- [安装详情](getting-started/installation.md) - 要求与故障排除
+- [功能特性](features/) - 探索配额跟踪、组合、部署
+- [常见问题](faq.md) - 常见问题与解答
+- [故障排除](troubleshooting.md) - 解决常见问题
+
+---
+
+## 需要帮助?
+
+- **网站**: [9router.com](https://9router.com)
+- **GitHub**: [github.com/decolua/9router](https://github.com/decolua/9router)
+- **Issues**: [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
diff --git a/gitbook/content/zh-CN/index.md b/gitbook/content/zh-CN/index.md
new file mode 100644
index 0000000..8999837
--- /dev/null
+++ b/gitbook/content/zh-CN/index.md
@@ -0,0 +1,164 @@
+# 欢迎使用 9Router
+
+**免费使用 Claude、Codex、Gemini • 超低价替代方案,每 1M token 仅需 $0.20**
+
+9Router 是一款 AI 模型路由工具,通过智能路由和自动回退机制,最大化你的订阅价值并最小化成本。
+
+---
+
+## 什么是 9Router?
+
+9Router 是一款智能代理,位于你的编码工具(Cursor、Cline、Claude Desktop)与 AI 提供商之间。它会根据配额、成本和可用性,自动将请求路由到最合适的模型。
+
+**告别浪费:**
+- ❌ 订阅配额每月未用完就过期
+- ❌ 速率限制让你写代码写到一半被卡住
+- ❌ 昂贵的 API(每个提供商每月 $20-50)
+- ❌ 在不同提供商之间手动切换
+
+**开始最大化价值:**
+- ✅ **充分利用订阅** - 跟踪并用完 Claude Code、Codex、Gemini 的每一点配额
+- ✅ **免费可用** - 通过 CLI 访问 iFlow、Qwen、Kiro 模型
+- ✅ **超低价备用** - GLM(每 1M $0.6)、MiniMax M2.1(每 1M $0.20)
+- ✅ **智能回退** - 订阅 → 低价 → 免费,自动切换
+
+---
+
+## 核心特性
+
+### 🔄 智能三层回退
+
+```
+一次配置,永不停码:
+
+第 1 层(订阅): Claude Code → Codex → Gemini
+ ↓ 配额耗尽
+第 2 层(低价): GLM-4.7 → MiniMax M2.1 → Kimi
+ ↓ 预算上限
+第 3 层(免费): iFlow → Qwen → Kiro
+
+→ 自动切换,零停机!
+```
+
+### 📊 配额跟踪
+
+- 每个提供商的实时 token 消耗
+- 重置倒计时(5 小时、每日、每周、每月)
+- 付费层级的成本估算
+- 每月支出报告
+
+### 🎯 通用 CLI 支持
+
+适用于所有支持自定义 OpenAI endpoint 的工具:
+
+✅ **Cursor** • **Cline** • **Claude Desktop** • **Codex** • **RooCode** • **Continue** • **任何 OpenAI 兼容工具**
+
+### 💰 成本优化
+
+**真实案例(每月 100M tokens):**
+```
+60M 通过 Gemini CLI: $0(免费层)
+30M 通过 Claude Code: $0(你已有的订阅)
+8M 通过 GLM: $4.80
+2M 通过 MiniMax: $0.40
+合计: $5.20/月,而 ChatGPT API 需要 $2000!
+```
+
+---
+
+## 为什么选择 9Router?
+
+### 最大化订阅价值
+
+已经在为 Claude Code(每月 $20-100)或 Codex(每月 $20-200)付费?那就用足它:
+
+- 实时跟踪配额使用
+- 配额重置时(5 小时、每周)自动切换
+- 在过期前用掉每一个 token
+- Gemini CLI:每月 180K 次补全 **免费**
+
+### 超低价备用
+
+订阅配额用完时,只需花几分钱:
+
+| 提供商 | 每 1M tokens 成本 | 重置时间 |
+|----------|-------------------|-------|
+| **GLM-4.7** | 输入 $0.60 / 输出 $2.20 | 每日 10:00 AM |
+| **MiniMax M2.1** | 输入 $0.20 / 输出 $1.00 | 5 小时滚动 |
+| **Kimi K2** | $9/月(10M tokens) | 每月 |
+
+**比 ChatGPT API(每 1M $20)便宜约 90%!**
+
+### 永久免费回退
+
+当其他一切都受配额限制时的应急备用:
+
+- **iFlow**:8 个模型(Kimi K2、Qwen3 Coder Plus、GLM 4.7、MiniMax M2)
+- **Qwen**:3 个模型(Qwen3 Coder Plus/Flash、Vision)
+- **Kiro**:Claude Sonnet 4.5、Haiku 4.5(AWS Builder ID)
+
+---
+
+## 快速开始
+
+2 分钟即可上手:
+
+```bash
+# 全局安装
+npm install -g 9router
+
+# 启动(仪表盘自动打开)
+9router
+```
+
+🎉 **仪表盘自动打开** → 连接提供商 → 开始编码!
+
+**在你的 CLI 工具中使用:**
+
+```
+Endpoint: http://localhost:20128/v1
+API Key: [从仪表盘获取]
+Model: cc/claude-opus-4-5-20251101
+```
+
+[→ 完整入门指南](getting-started.md)
+
+---
+
+## 使用场景
+
+### 个人开发者
+
+- 最大化你的 Claude Code/Codex 订阅
+- 使用 Gemini CLI 免费层(每月 180K)
+- 回退到超低价模型(每 1M $0.20)
+- 24/7 编码不受速率限制
+
+### 团队
+
+- 部署在 VPS/云服务器上共享访问
+- 实时跟踪团队支出
+- 为每层设置预算上限
+- 集中管理提供商
+
+### 移动/远程编码
+
+- 使用云端部署(https://9router.com)
+- 从 iPad、手机、任何地方访问
+- 没有 localhost 限制
+- Cloudflare 边缘网络(300+ 节点)
+
+---
+
+## 接下来做什么?
+
+- [入门指南](getting-started.md) - 5 分钟内完成安装和配置
+- [安装指南](getting-started/installation.md) - 详细的设置说明
+- [功能特性](features/) - 探索所有能力
+- [常见问题](faq.md) - 常见问题解答
+
+---
+
+
+ 用 ❤️ 为最大化 AI 价值的开发者打造
+
diff --git a/gitbook/content/zh-CN/integration/claude-code.md b/gitbook/content/zh-CN/integration/claude-code.md
new file mode 100644
index 0000000..4c0dcd4
--- /dev/null
+++ b/gitbook/content/zh-CN/integration/claude-code.md
@@ -0,0 +1,109 @@
+# Claude Code 集成
+
+将 9Router 与 Claude Code CLI 集成,通过 9Router 的智能路由系统转发你的 Anthropic API 请求。
+
+## 前置要求
+
+- 已安装 Claude Code CLI
+- 9Router 本地运行或已配置云端 endpoint
+- 来自 9Router 仪表盘的 API key
+
+## 设置
+
+### 1. 配置环境变量
+
+在 shell 配置文件(`~/.bashrc`、`~/.zshrc` 或 `~/.bash_profile`)中设置以下环境变量:
+
+```bash
+# 9Router 的 Base URL
+export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
+
+# 可选: 为别名设置默认模型
+export ANTHROPIC_DEFAULT_OPUS_MODEL="cc/claude-opus-4-5-20251101"
+export ANTHROPIC_DEFAULT_SONNET_MODEL="cc/claude-sonnet-4-5-20250929"
+export ANTHROPIC_DEFAULT_HAIKU_MODEL="cc/claude-haiku-4-5-20251001"
+```
+
+### 2. 重新加载 Shell 配置
+
+```bash
+source ~/.zshrc # 或 ~/.bashrc
+```
+
+### 3. 验证配置
+
+检查环境变量是否设置正确:
+
+```bash
+echo $ANTHROPIC_BASE_URL
+```
+
+## 模型别名
+
+Claude Code 支持以下模型别名,映射到 9Router 模型:
+
+| 别名 | 模型 | 环境变量 |
+|-------|-------|---------------------|
+| `opus` | Claude Opus 4.5 | `ANTHROPIC_DEFAULT_OPUS_MODEL` |
+| `sonnet` | Claude Sonnet 4.5 | `ANTHROPIC_DEFAULT_SONNET_MODEL` |
+| `haiku` | Claude Haiku 4.5 | `ANTHROPIC_DEFAULT_HAIKU_MODEL` |
+
+## 使用示例
+
+### 使用模型别名
+
+```bash
+# 使用 Opus 模型
+claude --model opus "Explain quantum computing"
+
+# 使用 Sonnet 模型
+claude --model sonnet "Write a Python function"
+
+# 使用 Haiku 模型
+claude --model haiku "Quick code review"
+```
+
+### 使用完整模型名
+
+```bash
+claude --model cc/claude-opus-4-5-20251101 "Your prompt here"
+```
+
+## 配置文件
+
+Claude Code 将配置存储在 `~/.claude/settings.json`。如有需要可手动编辑:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "defaultModel": "sonnet"
+}
+```
+
+## 故障排除
+
+### 连接问题
+
+遇到连接错误时:
+
+1. 确认 9Router 正在运行:`curl http://localhost:20128/health`
+2. 检查环境变量设置是否正确
+3. 确保防火墙没有阻止 20128 端口
+
+### 模型未找到
+
+出现 "model not found" 错误时:
+
+1. 确认模型名与 9Router 配置一致
+2. 检查 9Router 仪表盘中提供商连接是否激活
+3. 确认所连接的提供商中包含该模型
+
+## 云端 Endpoint
+
+使用 9Router 云端 endpoint 而非 localhost:
+
+```bash
+export ANTHROPIC_BASE_URL="https://9router.com"
+```
+
+确保已在 9Router 云端仪表盘中配置 API key。
diff --git a/gitbook/content/zh-CN/integration/cline.md b/gitbook/content/zh-CN/integration/cline.md
new file mode 100644
index 0000000..1a023ba
--- /dev/null
+++ b/gitbook/content/zh-CN/integration/cline.md
@@ -0,0 +1,201 @@
+# Cline 集成
+
+将 9Router 与 Cline VSCode 扩展集成,通过 9Router 的智能路由系统转发你的 AI 请求。
+
+## 前置要求
+
+- 已安装 Visual Studio Code
+- 从 VSCode 市场安装了 Cline 扩展
+- 9Router 本地运行或已配置云端 endpoint
+- 来自 9Router 仪表盘的 API key
+
+## 设置
+
+### 1. 打开 Cline 设置
+
+1. 打开 Visual Studio Code
+2. 打开 Cline 扩展面板(点击侧边栏的 Cline 图标)
+3. 点击 Cline 面板中的 **Settings**(齿轮图标)
+
+### 2. 选择 API Provider
+
+1. 在 Cline 设置中找到 **API Provider** 下拉菜单
+2. 从列表中选择 **Ollama**
+ - 注意:我们使用 Ollama provider 类型,因为它与 OpenAI 风格 API 兼容
+
+### 3. 配置 Base URL
+
+将 base URL 设为你的 9Router endpoint:
+
+**本地 9Router:**
+```
+http://localhost:20128/v1
+```
+
+**云端 9Router:**
+```
+https://9router.com
+```
+
+**步骤:**
+1. 在 **Base URL** 字段中输入你的 9Router endpoint
+2. 末尾必须包含 `/v1`
+
+### 4. 添加 API Key
+
+1. 在 **API Key** 字段中输入你的 9Router API key
+2. 可在 9Router 仪表盘 **Settings → API Keys** 中找到 API key
+3. key 应以 `sk-9router-` 开头
+
+### 5. 选择模型
+
+1. 在 **Model** 下拉菜单中,可以:
+ - 从可用模型中选择(若 Cline 自动检测)
+ - 或手动输入 9Router 配置中的模型名
+
+2. 常见模型名:
+ - `gpt-4`
+ - `gpt-4o`
+ - `claude-opus-4-5`
+ - `claude-sonnet-4-5`
+ - `gemini-2.0-flash`
+
+### 6. 保存配置
+
+点击 **Save** 或关闭设置面板。Cline 会自动保存你的配置。
+
+## 配置示例
+
+你的 Cline 设置应如下所示:
+
+```
+API Provider: Ollama
+Base URL: http://localhost:20128/v1
+API Key: sk-9router-xxxxxxxxxxxxx
+Model: gpt-4
+```
+
+## 可用模型
+
+你可以使用 9Router 仪表盘中配置的任意模型。常见示例:
+
+| 模型名 | 提供商 | 描述 |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## 使用
+
+### 与 AI 对话
+
+1. 在 VSCode 中打开 Cline 面板
+2. 在聊天输入框中输入消息
+3. 按 Enter 发送
+4. Cline 会通过 9Router 处理你的请求
+
+### 生成代码
+
+1. 让 Cline 生成代码:"创建一个登录表单的 React 组件"
+2. Cline 会通过 9Router 生成代码
+3. 检查并接受生成的代码
+
+### 代码解释
+
+1. 在编辑器中选中代码
+2. 让 Cline:"解释这段代码"
+3. 通过 9Router 获得 AI 驱动的解释
+
+### 文件操作
+
+1. 让 Cline 创建、修改或删除文件
+2. Cline 会通过 9Router 理解上下文并进行修改
+3. 在接受前检查变更
+
+## 故障排除
+
+### "Connection Failed" 错误
+
+1. 确认 9Router 正在运行:`curl http://localhost:20128/health`
+2. 确认 base URL 正确且包含 `/v1`
+3. 确保防火墙没有阻止 20128 端口
+4. 尝试重启 VSCode
+
+### "Invalid API Key" 错误
+
+1. 在 9Router 仪表盘中确认 API key
+2. 确保复制了包含 `sk-9router-` 前缀在内的完整 key
+3. 检查 API key 是否过期
+4. 尝试重新生成 API key
+
+### "Model Not Found" 错误
+
+1. 确认模型名与 9Router 配置完全一致
+2. 检查 9Router 仪表盘中提供商连接是否激活
+3. 确认连接的提供商中包含该模型
+4. 尝试使用完整模型名(例如用 `openai/gpt-4` 代替 `gpt-4`)
+
+### Cline 无响应
+
+1. 查看 Cline 输出面板中的错误信息
+2. 确认 9Router 实例正在运行且健康
+3. 重新加载 VSCode 窗口(Cmd/Ctrl + Shift + P → "Reload Window")
+4. 检查 9Router 日志是否有错误
+
+## 高级配置
+
+### 使用云端 Endpoint
+
+使用 9Router 云端 endpoint 而非 localhost:
+
+1. 在 Cline 设置中将 Base URL 设为:`https://9router.com`
+2. 确保已在 9Router 云端仪表盘中配置 API key
+3. 确保云端 endpoint 已激活且可访问
+
+### 多个模型
+
+可以快速切换模型:
+
+1. 打开 Cline 设置
+2. 将 **Model** 字段改为另一个模型
+3. 保存并继续使用新模型对话
+
+### 自定义超时
+
+如果大请求出现超时:
+
+1. 打开 VSCode 设置(Cmd/Ctrl + ,)
+2. 搜索 "Cline timeout"
+3. 提高超时值(默认通常为 30 秒)
+
+## 最佳实践
+
+1. **使用合适的模型**:简单任务用更快的模型(如 Haiku 或 Flash),复杂任务用更强的模型(如 Opus 或 GPT-4)
+2. **监控使用**:在 9Router 仪表盘查看用量统计和成本
+3. **管理上下文**:保持对话聚焦以减少 token 用量
+4. **切换模型**:根据任务复杂度切换模型,优化成本和性能
+5. **API Key 安全**:绝不将 API key 提交到版本控制
+
+## 与 9Router 功能的集成
+
+### 模型路由
+
+9Router 会根据以下因素自动将请求路由到最佳提供商:
+- 模型可用性
+- 提供商健康状态
+- 成本优化
+- 负载均衡
+
+### 回退支持
+
+某个提供商失败时,9Router 会自动回退到仪表盘中配置的备用提供商。
+
+### 使用跟踪
+
+通过 9Router 仪表盘监控你的 Cline 使用:
+- 请求总数
+- Token 使用
+- 每个模型的成本
+- 提供商分布
diff --git a/gitbook/content/zh-CN/integration/codex.md b/gitbook/content/zh-CN/integration/codex.md
new file mode 100644
index 0000000..84e307d
--- /dev/null
+++ b/gitbook/content/zh-CN/integration/codex.md
@@ -0,0 +1,136 @@
+# OpenAI Codex CLI 集成
+
+将 9Router 与 OpenAI Codex CLI 集成,通过 9Router 的智能路由系统转发你的 OpenAI API 请求。
+
+## 前置要求
+
+- 已安装 OpenAI Codex CLI
+- 9Router 本地运行或已配置云端 endpoint
+- 来自 9Router 仪表盘的 API key
+
+## 设置
+
+### 1. 配置环境变量
+
+在 shell 配置文件(`~/.bashrc`、`~/.zshrc` 或 `~/.bash_profile`)中设置以下环境变量:
+
+```bash
+# 9Router 的 Base URL
+export OPENAI_BASE_URL="http://localhost:20128/v1"
+
+# 来自 9Router 仪表盘的 API Key
+export OPENAI_API_KEY="your-9router-api-key"
+```
+
+### 2. 重新加载 Shell 配置
+
+```bash
+source ~/.zshrc # 或 ~/.bashrc
+```
+
+### 3. 验证配置
+
+检查环境变量是否设置正确:
+
+```bash
+echo $OPENAI_BASE_URL
+echo $OPENAI_API_KEY
+```
+
+## 可用模型
+
+9Router 提供以下 Codex 模型:
+
+| 模型 ID | 描述 |
+|----------|-------------|
+| `cx/gpt-5.2-codex` | GPT-5.2 Codex - 最新版本 |
+| `cx/gpt-5.1-codex-max` | GPT-5.1 Codex Max - 扩展上下文 |
+
+## 使用示例
+
+### 基础用法
+
+```bash
+# 使用 GPT-5.2 Codex
+codex --model cx/gpt-5.2-codex "Write a function to sort an array"
+
+# 使用 GPT-5.1 Codex Max
+codex --model cx/gpt-5.1-codex-max "Explain this complex algorithm"
+```
+
+### 代码生成
+
+```bash
+codex --model cx/gpt-5.2-codex "Create a REST API endpoint for user authentication"
+```
+
+### 代码解释
+
+```bash
+codex --model cx/gpt-5.1-codex-max "Explain what this code does: $(cat myfile.js)"
+```
+
+## 配置文件
+
+也可以通过配置文件配置 Codex CLI。创建或编辑 `~/.codex/config.json`:
+
+```json
+{
+ "baseUrl": "http://localhost:20128/v1",
+ "apiKey": "your-9router-api-key",
+ "defaultModel": "cx/gpt-5.2-codex"
+}
+```
+
+## 故障排除
+
+### 认证错误
+
+遇到认证错误时:
+
+1. 在 9Router 仪表盘中确认 API key 正确
+2. 检查 `OPENAI_API_KEY` 环境变量已设置
+3. 确认 API key 未过期
+
+### 连接问题
+
+遇到连接错误时:
+
+1. 确认 9Router 正在运行:`curl http://localhost:20128/health`
+2. 检查环境变量设置是否正确
+3. 确保防火墙没有阻止 20128 端口
+
+### 模型不可用
+
+出现 "model not available" 错误时:
+
+1. 确认模型名与 9Router 配置一致
+2. 检查 9Router 仪表盘中 OpenAI 提供商连接是否激活
+3. 确认连接的提供商中包含该模型
+
+## 云端 Endpoint
+
+使用 9Router 云端 endpoint 而非 localhost:
+
+```bash
+export OPENAI_BASE_URL="https://9router.com"
+```
+
+确保已在 9Router 云端仪表盘中配置 API key。
+
+## 高级配置
+
+### 自定义超时
+
+```bash
+export OPENAI_TIMEOUT=60 # 秒
+```
+
+### Debug 模式
+
+启用 debug 模式查看详细请求/响应日志:
+
+```bash
+export CODEX_DEBUG=true
+codex --model cx/gpt-5.2-codex "Your prompt"
+```
diff --git a/gitbook/content/zh-CN/integration/continue.md b/gitbook/content/zh-CN/integration/continue.md
new file mode 100644
index 0000000..fdc3ac3
--- /dev/null
+++ b/gitbook/content/zh-CN/integration/continue.md
@@ -0,0 +1,249 @@
+# Continue VSCode 扩展集成
+
+将 9Router 与 Continue 扩展集成,直接在 Visual Studio Code 中获得 AI 协助。
+
+## 前置要求
+
+- 已安装 Visual Studio Code
+- 从 VSCode 市场安装了 Continue 扩展
+- 来自 [仪表盘](https://9router.com/dashboard) 的 9Router API key
+- 9Router 正在运行(本地或云端)
+
+## 配置步骤
+
+### 1. 打开 Continue 配置
+
+1. 打开 VSCode
+2. 按 `Cmd+Shift+P` (Mac) 或 `Ctrl+Shift+P` (Windows/Linux)
+3. 输入 "Continue: Open Config" 并选择
+4. 这会打开 `~/.continue/config.json`
+
+### 2. 添加 9Router 模型配置
+
+将以下配置添加到 `config.json`:
+
+**单模型设置:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**多模型设置:**
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Claude Opus (Best)",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Sonnet (Balanced)",
+ "provider": "openai",
+ "model": "cc/claude-sonnet-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - DeepSeek Chat (Code)",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ },
+ {
+ "title": "9Router - Claude Haiku (Fast)",
+ "provider": "openai",
+ "model": "cc/claude-haiku-4-20250514",
+ "apiKey": "your-api-key-from-dashboard",
+ "apiBase": "http://localhost:20128/v1"
+ }
+ ]
+}
+```
+
+**云端 9Router:**
+将 `apiBase` 替换为:
+```json
+"apiBase": "https://9router.com/v1"
+```
+
+### 3. 保存并重新加载
+
+1. 保存配置文件
+2. 重新加载 VSCode 窗口:`Cmd+Shift+P` → "Developer: Reload Window"
+3. Continue 扩展会加载新配置
+
+### 4. 选择模型
+
+1. 打开 Continue 侧边栏(点击左侧 Continue 图标)
+2. 点击顶部模型选择下拉菜单
+3. 选择你偏好的 9Router 模型
+
+## 可用模型
+
+### Claude 模型(Anthropic)
+- `cc/claude-opus-4-5-20251101` - 最强,适合复杂任务
+- `cc/claude-sonnet-4-20250514` - 性能与速度平衡
+- `cc/claude-haiku-4-20250514` - 最快,适合简单任务
+
+### DeepSeek 模型
+- `cx/deepseek-chat` - 出色的代码生成
+- `cx/deepseek-reasoner` - 复杂问题求解
+
+### GLM 模型(Zhipu AI)
+- `glm/glm-4-plus` - 高级中文与英文
+- `glm/glm-4-flash` - 快速响应
+
+## 使用示例
+
+### 代码解释
+1. 在编辑器中选中代码
+2. 打开 Continue 侧边栏
+3. 输入:"Explain this code"
+4. 模型:`cc/claude-sonnet-4-20250514`
+
+### 代码生成
+1. 打开 Continue 侧边栏
+2. 输入:"Create a React component for user profile card"
+3. 模型:`cx/deepseek-chat`
+
+### 重构
+1. 选中要重构的代码
+2. 输入:"Refactor this to use async/await"
+3. 模型:`cc/claude-sonnet-4-20250514`
+
+### Bug 修复
+1. 选中有问题的代码
+2. 输入:"Find and fix the bug in this code"
+3. 模型:`cx/deepseek-reasoner`
+
+## 高级配置
+
+### 自定义系统 Prompt
+
+为特定行为添加自定义系统 prompt:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Code Expert",
+ "provider": "openai",
+ "model": "cx/deepseek-chat",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "systemMessage": "You are an expert programmer. Always provide clean, well-documented code with best practices."
+ }
+ ]
+}
+```
+
+### Temperature 与参数
+
+通过参数调整模型行为:
+
+```json
+{
+ "models": [
+ {
+ "title": "9Router - Creative Writer",
+ "provider": "openai",
+ "model": "cc/claude-opus-4-5-20251101",
+ "apiKey": "your-api-key",
+ "apiBase": "http://localhost:20128/v1",
+ "temperature": 0.9,
+ "topP": 0.95
+ }
+ ]
+}
+```
+
+### Context Provider
+
+配置 Continue 发送给模型的上下文:
+
+```json
+{
+ "contextProviders": [
+ {
+ "name": "code",
+ "params": {
+ "maxLines": 100
+ }
+ },
+ {
+ "name": "diff",
+ "params": {}
+ },
+ {
+ "name": "terminal",
+ "params": {}
+ }
+ ]
+}
+```
+
+## 键盘快捷键
+
+- `Cmd+L` (Mac) / `Ctrl+L` (Windows/Linux) - 打开 Continue 聊天
+- `Cmd+I` (Mac) / `Ctrl+I` (Windows/Linux) - 内联编辑
+- `Cmd+Shift+R` (Mac) / `Ctrl+Shift+R` (Windows/Linux) - 重新生成响应
+
+## 故障排除
+
+### 模型无响应
+- 确认 9Router 正在运行:`curl http://localhost:20128/health`
+- 检查 config.json 中的 API key
+- 查看 VSCode 开发者控制台错误:`Help` → `Toggle Developer Tools`
+
+### 选错模型
+- 点击 Continue 侧边栏的模型下拉菜单
+- 选择正确的 9Router 模型
+- 模型名必须完全匹配(大小写敏感)
+
+### 配置未加载
+- 确认 JSON 语法有效(使用 JSON 验证工具)
+- 检查文件位置:`~/.continue/config.json`
+- 修改后重新加载 VSCode 窗口
+
+### 性能缓慢
+- 切换到更快的模型(haiku、flash)
+- 在 contextProviders 中减少上下文大小
+- 检查到 9Router 的网络延迟
+
+## 最佳实践
+
+### 模型选择策略
+- **快速编辑**:使用 `cc/claude-haiku-4-20250514`
+- **代码生成**:使用 `cx/deepseek-chat`
+- **复杂重构**:使用 `cc/claude-opus-4-5-20251101`
+- **问题求解**:使用 `cx/deepseek-reasoner`
+
+### 上下文管理
+- 提问前只选中相关代码
+- 使用具体、清晰的 prompt
+- 将复杂任务拆分为小步骤
+
+### 成本优化
+- 简单任务使用更快/更便宜的模型
+- 尽可能限制上下文大小
+- 缓存常用响应
+
+## 下一步
+
+- [配置 Cursor](cursor.md) 以增强 IDE 集成
+- [设置 Roo](roo.md) AI 助手
+- [探索 CLI 用法](../cli/basic-usage.md)
+- [了解模型选择](../models/overview.md)
diff --git a/gitbook/content/zh-CN/integration/cursor.md b/gitbook/content/zh-CN/integration/cursor.md
new file mode 100644
index 0000000..2b2c48b
--- /dev/null
+++ b/gitbook/content/zh-CN/integration/cursor.md
@@ -0,0 +1,149 @@
+# Cursor 集成
+
+将 9Router 与 Cursor IDE 集成,通过 9Router 的智能路由系统转发你的 AI 请求。
+
+## 前置要求
+
+- 已安装 Cursor IDE
+- Cursor Pro 账户(使用自定义 API endpoint 必需)
+- 已配置 9Router 云端 endpoint
+- 来自 9Router 仪表盘的 API key
+
+## ⚠️ 重要说明
+
+> **必须使用云端 Endpoint**:Cursor 会通过自己的服务器转发请求,不支持 localhost endpoint。你必须使用 9Router 云端 endpoint:`https://9router.com`
+
+> **必须有 Cursor Pro**:此功能需要 Cursor Pro 账户才能使用自定义 API endpoint。
+
+## 设置
+
+### 1. 打开 Cursor 设置
+
+1. 打开 Cursor IDE
+2. 进入 **Settings**(Cmd/Ctrl + ,)
+3. 导航到 **Models** 部分
+
+### 2. 启用 OpenAI API
+
+1. 找到 **OpenAI API key** 选项
+2. 启用开关以激活自定义 API 配置
+
+### 3. 配置 Base URL
+
+将 base URL 设为 9Router 云端 endpoint:
+
+```
+https://9router.com
+```
+
+**步骤:**
+1. 在 Models 设置中找到 **Base URL** 字段
+2. 输入:`https://9router.com`
+3. 点击 **Save**
+
+### 4. 添加 API Key
+
+1. 在 **API Key** 字段中输入你的 9Router API key
+2. 可在 9Router 仪表盘 **Settings → API Keys** 中找到 API key
+3. 点击 **Save**
+
+### 5. 添加自定义模型
+
+1. 点击 **View All Models** 按钮
+2. 点击 **Add Custom Model**
+3. 输入 9Router 配置中的模型名(例如 `gpt-4`、`claude-opus-4-5` 等)
+4. 点击 **Add**
+
+### 6. 选择模型
+
+1. 在 Cursor 聊天界面,点击模型选择下拉菜单
+2. 从列表中选择你的自定义模型
+3. 开始在 Cursor 中使用 9Router!
+
+## 配置示例
+
+你的 Cursor 设置应如下所示:
+
+```
+OpenAI API: ✓ 已启用
+Base URL: https://9router.com
+API Key: sk-9router-xxxxxxxxxxxxx
+Custom Models: gpt-4, claude-opus-4-5, gemini-2.0-flash
+```
+
+## 可用模型
+
+你可以使用 9Router 仪表盘中配置的任意模型。常见示例:
+
+| 模型名 | 提供商 | 描述 |
+|------------|----------|-------------|
+| `gpt-4` | OpenAI | GPT-4 Turbo |
+| `gpt-4o` | OpenAI | GPT-4 Optimized |
+| `claude-opus-4-5` | Anthropic | Claude Opus 4.5 |
+| `claude-sonnet-4-5` | Anthropic | Claude Sonnet 4.5 |
+| `gemini-2.0-flash` | Google | Gemini 2.0 Flash |
+
+## 使用
+
+### 聊天界面
+
+1. 打开 Cursor 聊天(Cmd/Ctrl + L)
+2. 从下拉菜单中选择模型
+3. 通过 9Router 与 AI 对话
+
+### 内联代码生成
+
+1. 在编辑器中选中代码
+2. 按 Cmd/Ctrl + K
+3. 输入 prompt
+4. Cursor 会通过 9Router 生成代码
+
+### 代码解释
+
+1. 在编辑器中选中代码
+2. 按 Cmd/Ctrl + L
+3. 询问 "Explain this code"
+4. 通过 9Router 获得 AI 驱动的解释
+
+## 故障排除
+
+### "Invalid API Key" 错误
+
+1. 在 9Router 仪表盘中确认 API key
+2. 确保复制了包含 `sk-9router-` 前缀在内的完整 key
+3. 检查 API key 是否过期
+4. 尝试重新生成 API key
+
+### "Model Not Found" 错误
+
+1. 确认模型名与 9Router 配置完全一致
+2. 检查 9Router 仪表盘中提供商连接是否激活
+3. 确认连接的提供商中包含该模型
+4. 尝试使用完整模型名(例如用 `openai/gpt-4` 代替 `gpt-4`)
+
+### 连接问题
+
+1. 确认使用的是云端 endpoint:`https://9router.com`
+2. 检查网络连接
+3. 确认 9Router 云端服务运行正常
+4. 若启用了 VPN 或代理,尝试关闭
+
+### Localhost 无法使用
+
+> **请记住**:Cursor 不支持 localhost endpoint。你必须使用云端 endpoint `https://9router.com`。如果需要使用本地 9Router 实例,可以考虑使用 ngrok 之类的隧道服务把本地 endpoint 暴露到公网。
+
+## 云端 Endpoint 设置
+
+如果你在本地运行 9Router 并希望搭配 Cursor 使用:
+
+1. 在 9Router 设置中启用云端 endpoint
+2. 在 9Router 仪表盘中配置云端 endpoint URL
+3. 在 Cursor 设置中使用该云端 URL
+4. 确保本地 9Router 实例可从互联网访问
+
+## 最佳实践
+
+1. **使用模型别名**:为常用模型在 9Router 中创建简短别名
+2. **监控使用**:在 9Router 仪表盘查看用量统计和成本
+3. **轮换 API Keys**:为安全起见定期轮换 API key
+4. **测试模型**:尝试不同模型,找到最适合你场景的那个
diff --git a/gitbook/content/zh-CN/integration/other-tools.md b/gitbook/content/zh-CN/integration/other-tools.md
new file mode 100644
index 0000000..8469230
--- /dev/null
+++ b/gitbook/content/zh-CN/integration/other-tools.md
@@ -0,0 +1,416 @@
+# 其他工具集成
+
+9Router 兼容任何支持 OpenAI API 格式的工具。本指南介绍各种工具和自定义应用的通用集成模式。
+
+## 概览
+
+9Router 提供 OpenAI 兼容的 API endpoint,可与以下场景配合使用:
+- 自定义脚本与应用
+- API 客户端与测试工具
+- CLI 工具与实用程序
+- 第三方集成
+- 开发框架
+
+## 通用设置模式
+
+任何 OpenAI 兼容的工具都可以通过以下设置连接到 9Router:
+
+**本地 9Router:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+Model: 任意 9Router 模型(cc/*, cx/*, glm/*, 等)
+```
+
+**云端 9Router:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+Model: 任意 9Router 模型(cc/*, cx/*, glm/*, 等)
+```
+
+## 可用模型
+
+### Claude 模型(Anthropic)
+- `cc/claude-opus-4-5-20251101`
+- `cc/claude-sonnet-4-20250514`
+- `cc/claude-haiku-4-20250514`
+
+### DeepSeek 模型
+- `cx/deepseek-chat`
+- `cx/deepseek-reasoner`
+
+### GLM 模型(Zhipu AI)
+- `glm/glm-4-plus`
+- `glm/glm-4-flash`
+
+## 集成示例
+
+### Python 使用 OpenAI SDK
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+)
+
+print(response.choices[0].message.content)
+```
+
+### Node.js 使用 OpenAI SDK
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+const response = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [
+ { role: "user", content: "Hello, how are you?" }
+ ]
+});
+
+console.log(response.choices[0].message.content);
+```
+
+### cURL 命令
+
+```bash
+curl http://localhost:20128/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer your-api-key-from-dashboard" \
+ -d '{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ]
+ }'
+```
+
+### HTTP 客户端(Postman、Insomnia)
+
+**Request:**
+```
+POST http://localhost:20128/v1/chat/completions
+```
+
+**Headers:**
+```
+Content-Type: application/json
+Authorization: Bearer your-api-key-from-dashboard
+```
+
+**Body:**
+```json
+{
+ "model": "cc/claude-sonnet-4-20250514",
+ "messages": [
+ {"role": "user", "content": "Hello, how are you?"}
+ ],
+ "temperature": 0.7,
+ "max_tokens": 1000
+}
+```
+
+### LangChain 集成
+
+```python
+from langchain.chat_models import ChatOpenAI
+from langchain.schema import HumanMessage
+
+llm = ChatOpenAI(
+ model_name="cc/claude-sonnet-4-20250514",
+ openai_api_key="your-api-key-from-dashboard",
+ openai_api_base="http://localhost:20128/v1",
+ temperature=0.7
+)
+
+messages = [HumanMessage(content="Explain quantum computing")]
+response = llm(messages)
+print(response.content)
+```
+
+### LlamaIndex 集成
+
+```python
+from llama_index.llms import OpenAI
+
+llm = OpenAI(
+ model="cc/claude-sonnet-4-20250514",
+ api_key="your-api-key-from-dashboard",
+ api_base="http://localhost:20128/v1"
+)
+
+response = llm.complete("What is machine learning?")
+print(response.text)
+```
+
+## 自定义脚本示例
+
+### 批处理脚本
+
+```python
+import openai
+import json
+
+openai.api_key = "your-api-key-from-dashboard"
+openai.api_base = "http://localhost:20128/v1"
+
+def process_batch(prompts, model="cx/deepseek-chat"):
+ results = []
+ for prompt in prompts:
+ response = openai.ChatCompletion.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ results.append({
+ "prompt": prompt,
+ "response": response.choices[0].message.content
+ })
+ return results
+
+prompts = [
+ "Explain AI in one sentence",
+ "What is machine learning?",
+ "Define neural networks"
+]
+
+results = process_batch(prompts)
+print(json.dumps(results, indent=2))
+```
+
+### 流式响应处理
+
+```javascript
+import OpenAI from "openai";
+
+const client = new OpenAI({
+ apiKey: "your-api-key-from-dashboard",
+ baseURL: "http://localhost:20128/v1"
+});
+
+async function streamResponse(prompt) {
+ const stream = await client.chat.completions.create({
+ model: "cc/claude-sonnet-4-20250514",
+ messages: [{ role: "user", content: prompt }],
+ stream: true
+ });
+
+ for await (const chunk of stream) {
+ const content = chunk.choices[0]?.delta?.content || "";
+ process.stdout.write(content);
+ }
+}
+
+streamResponse("Write a short story about AI");
+```
+
+### 多模型对比
+
+```python
+from openai import OpenAI
+
+client = OpenAI(
+ api_key="your-api-key-from-dashboard",
+ base_url="http://localhost:20128/v1"
+)
+
+models = [
+ "cc/claude-sonnet-4-20250514",
+ "cx/deepseek-chat",
+ "glm/glm-4-plus"
+]
+
+prompt = "Explain quantum computing in simple terms"
+
+for model in models:
+ response = client.chat.completions.create(
+ model=model,
+ messages=[{"role": "user", "content": prompt}]
+ )
+ print(f"\n=== {model} ===")
+ print(response.choices[0].message.content)
+```
+
+## 常见集成模式
+
+### 环境变量
+
+安全地存储凭据:
+
+```bash
+# .env file
+ROUTER_API_KEY=your-api-key-from-dashboard
+ROUTER_BASE_URL=http://localhost:20128/v1
+ROUTER_MODEL=cc/claude-sonnet-4-20250514
+```
+
+```python
+import os
+from openai import OpenAI
+
+client = OpenAI(
+ api_key=os.getenv("ROUTER_API_KEY"),
+ base_url=os.getenv("ROUTER_BASE_URL")
+)
+```
+
+### 错误处理
+
+```python
+from openai import OpenAI, OpenAIError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": "Hello"}]
+ )
+ print(response.choices[0].message.content)
+except OpenAIError as e:
+ print(f"Error: {e}")
+```
+
+### 重试逻辑
+
+```python
+import time
+from openai import OpenAI, RateLimitError
+
+client = OpenAI(
+ api_key="your-api-key",
+ base_url="http://localhost:20128/v1"
+)
+
+def chat_with_retry(prompt, max_retries=3):
+ for attempt in range(max_retries):
+ try:
+ response = client.chat.completions.create(
+ model="cc/claude-sonnet-4-20250514",
+ messages=[{"role": "user", "content": prompt}]
+ )
+ return response.choices[0].message.content
+ except RateLimitError:
+ if attempt < max_retries - 1:
+ time.sleep(2 ** attempt) # Exponential backoff
+ else:
+ raise
+```
+
+## 故障排除
+
+### 连接问题
+
+**问题:** 无法连接到 9Router
+```bash
+# 检查 9Router 是否运行
+curl http://localhost:20128/health
+
+# 预期响应:
+{"status": "ok"}
+```
+
+**方案:**
+- 确认 9Router 正在运行
+- 检查 20128 端口未被阻止
+- 确保 base URL 正确(包含 `/v1`)
+
+### 认证错误
+
+**问题:** 401 Unauthorized
+```
+Error: Invalid API key
+```
+
+**方案:**
+- 在仪表盘中确认 API key
+- 检查 Authorization 头格式:`Bearer your-api-key`
+- 确保 API key 中没有多余的空格或换行
+
+### 模型未找到
+
+**问题:** 404 Model not found
+```
+Error: Model 'cc/claude-opus' not found
+```
+
+**方案:**
+- 使用精确的模型名(大小写敏感)
+- 查看可用模型:`curl http://localhost:20128/v1/models`
+- 确认套餐中已启用该模型
+
+### 超时问题
+
+**问题:** 请求超时
+```
+Error: Request timed out after 30s
+```
+
+**方案:**
+- 在客户端配置中增大超时
+- 时间敏感任务使用更快的模型
+- 检查到 9Router 的网络连接
+
+### 速率限制
+
+**问题:** 429 Too Many Requests
+```
+Error: Rate limit exceeded
+```
+
+**方案:**
+- 实现指数退避
+- 降低请求频率
+- 在仪表盘中查看速率限制
+- 考虑升级套餐
+
+## 最佳实践
+
+### 安全
+- 将 API key 存储在环境变量中
+- 绝不将 API key 提交到版本控制
+- 云端部署使用 HTTPS
+- 定期轮换 API keys
+
+### 性能
+- 根据任务复杂度选择合适的模型
+- 对重复查询实现缓存
+- 长响应使用流式输出
+- 尽可能批量请求
+
+### 错误处理
+- 始终用 try-catch 块包裹
+- 添加带指数退避的重试逻辑
+- 记录错误以便调试
+- 提供回退机制
+
+### 成本优化
+- 简单任务选择高性价比的模型
+- 适当时缓存响应
+- 在仪表盘监控使用
+- 在代码中设置请求上限
+
+## 下一步
+
+- [配置 Cursor](cursor.md) 进行 IDE 集成
+- [设置 Continue](continue.md) 用于 VSCode
+- [探索 CLI 用法](../cli/basic-usage.md)
+- [了解模型选择](../models/overview.md)
+- [API 参考](../api/reference.md)
diff --git a/gitbook/content/zh-CN/integration/roo.md b/gitbook/content/zh-CN/integration/roo.md
new file mode 100644
index 0000000..86112c5
--- /dev/null
+++ b/gitbook/content/zh-CN/integration/roo.md
@@ -0,0 +1,127 @@
+# Roo AI 助手集成
+
+将 9Router 与 Roo AI 助手集成,通过统一界面访问多个 AI 模型。
+
+## 前置要求
+
+- 已安装 Roo AI 助手
+- 来自 [仪表盘](https://9router.com/dashboard) 的 9Router API key
+- 9Router 正在运行(本地或云端)
+
+## 配置步骤
+
+### 1. 打开 Roo 设置
+
+启动 Roo AI 助手并打开设置面板。
+
+### 2. 配置 API Provider
+
+1. 进入 **API Provider** 设置
+2. 选择 **Ollama** 作为 provider 类型
+3. 配置以下设置:
+
+**本地 9Router:**
+```
+Base URL: http://localhost:20128/v1
+API Key: your-api-key-from-dashboard
+```
+
+**云端 9Router:**
+```
+Base URL: https://9router.com/v1
+API Key: your-api-key-from-dashboard
+```
+
+### 3. 选择模型
+
+从可用的 9Router 模型中选择:
+
+**Claude 模型:**
+- `cc/claude-opus-4-5-20251101` - 最强
+- `cc/claude-sonnet-4-20250514` - 平衡
+- `cc/claude-haiku-4-20250514` - 快速
+
+**DeepSeek 模型:**
+- `cx/deepseek-chat` - 通用
+- `cx/deepseek-reasoner` - 复杂推理
+
+**GLM 模型:**
+- `glm/glm-4-plus` - 高级
+- `glm/glm-4-flash` - 快速响应
+
+### 4. 测试连接
+
+发送测试消息验证集成:
+
+```
+Hello! Can you confirm you're connected through 9Router?
+```
+
+## 使用示例
+
+### 基础聊天
+```
+向 Roo 提问: "Explain quantum computing in simple terms"
+模型: cc/claude-sonnet-4-20250514
+```
+
+### 代码生成
+```
+向 Roo 提问: "Write a Python function to calculate Fibonacci numbers"
+模型: cx/deepseek-chat
+```
+
+### 复杂推理
+```
+向 Roo 提问: "Analyze the trade-offs between microservices and monolithic architecture"
+模型: cx/deepseek-reasoner
+```
+
+## 模型选择建议
+
+- **快速任务**:使用 `cc/claude-haiku-4-20250514` 或 `glm/glm-4-flash`
+- **均衡性能**:使用 `cc/claude-sonnet-4-20250514` 或 `cx/deepseek-chat`
+- **复杂推理**:使用 `cc/claude-opus-4-5-20251101` 或 `cx/deepseek-reasoner`
+- **成本优化**:使用 DeepSeek 或 GLM 模型
+
+## 故障排除
+
+### 连接失败
+- 确认 9Router 正在运行:`curl http://localhost:20128/health`
+- 检查 API key 是否正确
+- 确保 Base URL 末尾包含 `/v1`
+
+### 模型不可用
+- 检查模型名是否完全匹配(大小写敏感)
+- 确认 9Router 套餐中已启用该模型
+- 尝试列表中的其他模型
+
+### 响应缓慢
+- 切换到更快的模型(haiku、flash)
+- 检查网络连接
+- 查看 9Router 日志排查问题
+
+## 高级配置
+
+### 自定义模型别名
+
+可在 Roo 设置中为常用模型创建快捷别名:
+
+```
+别名: "fast" → cc/claude-haiku-4-20250514
+别名: "smart" → cc/claude-opus-4-5-20251101
+别名: "code" → cx/deepseek-chat
+```
+
+### 多个配置文件
+
+为不同场景设置不同配置:
+- **开发**:DeepSeek 模型用于编码
+- **写作**:Claude 模型用于内容创作
+- **研究**:Reasoner 模型用于分析
+
+## 下一步
+
+- [配置 Cursor](cursor.md) 进行 IDE 集成
+- [设置 Continue](continue.md) 用于 VSCode
+- [探索 CLI 用法](../cli/basic-usage.md)
diff --git a/gitbook/content/zh-CN/providers/cheap.md b/gitbook/content/zh-CN/providers/cheap.md
new file mode 100644
index 0000000..03533d7
--- /dev/null
+++ b/gitbook/content/zh-CN/providers/cheap.md
@@ -0,0 +1,462 @@
+# 低价提供商 - 超低价备用
+
+订阅配额耗尽时,只花几分钱而不是几美元。比 ChatGPT API 便宜 ~90%!
+
+---
+
+## 概览
+
+低价层提供商是订阅配额耗尽时的 **备用**:
+
+- 💰 **GLM-4.7** - 每 1M tokens $0.6/$2.2(每日重置)
+- 💰 **MiniMax M2.1** - 每 1M tokens $0.2/$1.0(5h 重置)
+- 💰 **Kimi K2** - $9/月固定(10M tokens)
+
+**策略:** 在订阅配额用完后、免费层之前使用。相比 ChatGPT API(每 1M $20),省钱巨大。
+
+---
+
+## GLM-4.7(每日重置)
+
+### 价格
+
+| 套餐 | 输入 | 输出 | 重置 |
+|------|-------|--------|-------|
+| 标准 | $0.60/1M | $2.20/1M | 每日 10:00 AM |
+| Coding Plan | $0.60/1M | $2.20/1M | 每日 10:00 AM(3× 配额) |
+
+**成本示例(10M tokens):**
+- 输入: 10M × $0.60 = $6
+- 输出: 10M × $2.20 = $22
+- **合计: $6-22**,而 ChatGPT API 需 $200!
+
+### 设置
+
+**步骤 1:注册**
+
+1. 访问 [Zhipu AI](https://open.bigmodel.cn/)
+2. 创建账户(手机验证)
+3. 选择 **Coding Plan**,相同价格下 3× 配额
+
+**步骤 2:获取 API Key**
+
+```bash
+仪表盘 → API Keys → 创建新 Key
+→ 复制 API key(以 "zhipu-" 开头)
+```
+
+**步骤 3:添加到 9Router**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 添加 API Key
+
+Provider: glm
+API Key: zhipu-your-api-key-here
+```
+
+**步骤 4:在 CLI 中使用**
+
+```
+Model: glm/glm-4.7
+ glm/glm-4.6v (vision)
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 上下文 | 最佳场景 |
+|----------|-------------|---------|----------|
+| `glm/glm-4.7` | GLM 4.7 | 128K | 编码、通用任务 |
+| `glm/glm-4.6v` | GLM 4.6V Vision | 128K | 图像分析 |
+
+### 专业建议
+
+- **Coding Plan** - 相同价格下 3× 配额($0.6/$2.2)
+- **每日重置** - 每天北京时间 10:00 AM 重置
+- **编码首选** - 针对代码生成优化
+- **128K 上下文** - 可处理大文件
+
+### 配额重置
+
+```
+每日重置: 北京时间 10:00 AM(UTC+8)
+→ UTC 02:00
+→ PST 前一天 18:00
+→ EST 前一天 21:00
+
+围绕重置时间规划重任务!
+```
+
+---
+
+## MiniMax M2.1(5 小时重置)
+
+### 价格
+
+| 套餐 | 输入 | 输出 | 重置 |
+|------|-------|--------|-------|
+| 标准 | $0.20/1M | $1.00/1M | 5 小时滚动 |
+
+**成本示例(10M tokens):**
+- 输入: 10M × $0.20 = $2
+- 输出: 10M × $1.00 = $10
+- **合计: $2-10** - 最便宜的选择!
+
+### 设置
+
+**步骤 1:注册**
+
+1. 访问 [MiniMax](https://www.minimax.io/)
+2. 创建账户
+3. 验证邮箱/手机
+
+**步骤 2:获取 API Key**
+
+```bash
+仪表盘 → API Management → Create Key
+→ 复制 API key
+```
+
+**步骤 3:添加到 9Router**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 添加 API Key
+
+Provider: minimax
+API Key: your-minimax-api-key
+```
+
+**步骤 4:在 CLI 中使用**
+
+```
+Model: minimax/MiniMax-M2.1
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 上下文 | 最佳场景 |
+|----------|-------------|---------|----------|
+| `minimax/MiniMax-M2.1` | MiniMax M2.1 | 1M tokens | 长上下文、编码 |
+
+### 专业建议
+
+- **最便宜的选择** - 输入每 1M $0.20(比 ChatGPT 便宜 90%)
+- **5 小时滚动** - 每 5 小时配额重置
+- **1M 上下文** - 超大上下文窗口
+- **处理整个代码库** - 适合大文件
+
+### 配额重置
+
+```
+5 小时滚动窗口:
+→ 使用配额 → 等待 5 小时 → 配额刷新
+
+示例:
+10:00 AM - 使用 5M tokens
+3:00 PM - 配额刷新
+8:00 PM - 配额刷新
+
+24/7 编码,成本极低!
+```
+
+---
+
+## Kimi K2(固定 $9/月)
+
+### 价格
+
+| 套餐 | 月费 | 包含 Tokens | 折合成本 |
+|------|--------------|-----------------|----------------|
+| 订阅 | $9 | 10M tokens | $0.90/1M |
+
+**成本示例:**
+- $9/月固定
+- 包含 10M tokens
+- **折合: $0.90/1M** - 持续使用的最佳性价比!
+
+### 设置
+
+**步骤 1:订阅**
+
+1. 访问 [Moonshot AI](https://platform.moonshot.ai/)
+2. 创建账户
+3. 订阅 $9/月套餐
+
+**步骤 2:获取 API Key**
+
+```bash
+仪表盘 → API Keys → 创建新 Key
+→ 复制 API key
+```
+
+**步骤 3:添加到 9Router**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 添加 API Key
+
+Provider: kimi
+API Key: your-kimi-api-key
+```
+
+**步骤 4:在 CLI 中使用**
+
+```
+Model: kimi/kimi-latest
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 上下文 | 最佳场景 |
+|----------|-------------|---------|----------|
+| `kimi/kimi-latest` | Kimi Latest | 200K | 通用编码 |
+
+### 专业建议
+
+- **固定成本** - $9/月,不限用量(最多 10M)
+- **稳定使用最佳** - 若每月用 10M,折合 $0.90/1M
+- **每月重置** - 10M tokens 每月重置
+- **可预测账单** - 无意外费用
+
+### 配额重置
+
+```
+每月重置: 每月 1 日
+→ 10M tokens 刷新
+
+每月用量示例:
+第 1 周: 3M tokens
+第 2 周: 2M tokens
+第 3 周: 3M tokens
+第 4 周: 2M tokens
+合计: 10M tokens = $9 固定
+```
+
+---
+
+## 价格对比
+
+| 提供商 | 输入/1M | 输出/1M | 重置 | 10M 成本 | 最佳场景 |
+|----------|----------|-----------|-------|----------|----------|
+| **GLM-4.7** | $0.60 | $2.20 | 每日 10AM | $6-22 | 每日配额用户 |
+| **MiniMax M2.1** | $0.20 | $1.00 | 5 小时 | $2-10 | **最便宜!** |
+| **Kimi K2** | $0.90 | $0.90 | 每月 | **$9 固定** | 稳定使用 |
+| ChatGPT API | $20.00 | $20.00 | 无 | $200 | ❌ 昂贵 |
+
+**节省:** 比 ChatGPT API 便宜 90-95%!
+
+---
+
+## 使用示例
+
+### Cursor IDE 设置
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [从 9router 仪表盘获取]
+ Model: glm/glm-4.7
+```
+
+### 创建组合(推荐)
+
+```
+仪表盘 → 组合 → 新建
+
+名称: cheap-backup
+模型:
+ 1. cc/claude-opus-4-5 (订阅主力)
+ 2. glm/glm-4.7 (低价备用, 每日重置)
+ 3. minimax/MiniMax-M2.1 (最便宜的回退)
+ 4. if/kimi-k2-thinking (免费应急)
+
+CLI 中使用: cheap-backup
+```
+
+**结果:** 订阅 → 低价 → 最便宜 → 免费
+
+---
+
+## 成本优化
+
+### 策略 1:每日重置例程
+
+```
+早上(10AM): 全新 GLM 配额
+→ 用 GLM 处理重任务
+→ 节省订阅配额
+
+下午: 订阅配额
+→ 用 Claude/Codex 处理复杂任务
+
+晚上: MiniMax(5h 重置)
+→ 深夜的低价备用
+
+夜里: 免费层(iFlow)
+→ 零成本应急备用
+```
+
+### 策略 2:预算优先
+
+```
+设置月预算: $20
+
+分配:
+- $9 Kimi K2(10M tokens 固定)
+- $6 GLM 每日配额(10M tokens)
+- $5 MiniMax 溢出(25M tokens)
+
+合计: $20 拿到 45M tokens
+而 ChatGPT API 同样的钱只能拿 1M tokens!
+```
+
+### 策略 3:订阅优先最大化
+
+```
+优先级:
+1. Gemini CLI(每月免费 180K)
+2. Claude Code(已付费订阅)
+3. GLM-4.7(低价备用,每 1M $0.6)
+4. MiniMax M2.1(最便宜,每 1M $0.2)
+5. iFlow(免费应急)
+
+月成本示例(100M tokens):
+- 60M 通过 Gemini CLI: $0(免费)
+- 30M 通过 Claude Code: $0(订阅)
+- 8M 通过 GLM: $4.80
+- 2M 通过 MiniMax: $0.40
+合计: $5.20/月!
+```
+
+---
+
+## 真实案例
+
+### 案例 1:重度编码月(100M tokens)
+
+```
+分解:
+- 60M 通过订阅(Claude/Codex): 无额外费用
+- 30M 通过 GLM-4.7: $18
+- 10M 通过 MiniMax M2.1: $2
+
+合计: $20/月
+而 ChatGPT API 需 $2000!
+
+节省: 便宜 99%!
+```
+
+### 案例 2:预算编码者($10/月)
+
+```
+策略:
+- $9 Kimi K2(10M tokens)
+- $1 MiniMax 溢出(5M tokens)
+
+合计: $10 拿到 15M tokens
+而 ChatGPT API 同样的钱只能拿 0.5M tokens!
+
+多 30 倍 tokens!
+```
+
+### 案例 3:自由职业(用量浮动)
+
+```
+清淡月(20M tokens):
+- 15M 通过订阅: $0
+- 5M 通过 GLM: $3
+合计: $3
+
+繁忙月(150M tokens):
+- 60M 通过订阅: $0
+- 60M 通过 GLM: $36
+- 30M 通过 MiniMax: $6
+合计: $42
+
+平均: $22.50/月
+而 ChatGPT API 需 $3400!
+```
+
+---
+
+## 最佳实践
+
+### 1. 跟踪每日配额
+
+```
+仪表盘显示:
+- GLM 配额: 已用 75%(6h 后重置)
+- MiniMax 配额: 已用 50%(2h 后重置)
+- Kimi 配额: 已用 8M/10M(15 天后重置)
+
+围绕重置时间规划重任务!
+```
+
+### 2. 使用 Coding Plan(GLM)
+
+```
+标准: 1× 配额
+Coding Plan: 3× 配额(同价!)
+
+→ 永远选 Coding Plan
+```
+
+### 3. 结合免费层
+
+```
+组合:
+1. gc/gemini-3-flash(免费主力)
+2. glm/glm-4.7(低价备用)
+3. minimax/MiniMax-M2.1(最便宜)
+4. if/kimi-k2-thinking(免费应急)
+
+结果: 最小化成本,最大化在线
+```
+
+### 4. 设置预算告警
+
+```
+仪表盘 → 设置 → 预算告警
+
+每日: $2 上限
+每周: $10 上限
+每月: $30 上限
+
+→ 达到上限时自动切换到免费层
+```
+
+---
+
+## 故障排除
+
+### "Quota exhausted"
+
+**方案:**
+- GLM: 等到北京时间 10:00 AM
+- MiniMax: 从首次使用起等 5 小时
+- Kimi: 等到下月 1 日
+- 使用组合回退到免费层
+
+### "API key invalid"
+
+**方案:**
+- 检查 API key 是否复制正确
+- 确认账户有余额
+- 必要时重新生成 API key
+
+### "High costs"
+
+**方案:**
+- 在仪表盘查看使用统计
+- 设置预算告警
+- 切换到 MiniMax(每 1M $0.2 最便宜)
+- 非关键任务用免费层
+
+---
+
+## 下一步
+
+- **添加免费回退:** [免费提供商](./free.md)
+- **设置订阅:** [订阅型提供商](./subscription.md)
+- **创建组合:** 仪表盘 → 组合 → 新建
diff --git a/gitbook/content/zh-CN/providers/free.md b/gitbook/content/zh-CN/providers/free.md
new file mode 100644
index 0000000..e55fe42
--- /dev/null
+++ b/gitbook/content/zh-CN/providers/free.md
@@ -0,0 +1,442 @@
+# 免费提供商 - 零成本回退
+
+当其他一切都受配额限制时的应急备用。零成本 24/7 编码!
+
+---
+
+## 概览
+
+免费层提供商是订阅和低价配额都耗尽时的 **回退**:
+
+- 🆓 **iFlow** - 8 个免费模型(Kimi K2、Qwen3、GLM 4.7、MiniMax M2...)
+- 🆓 **Qwen** - 3 个免费模型(Qwen3 Coder Plus/Flash、Vision)
+- 🆓 **Kiro** - 2 个免费模型(Claude Sonnet 4.5、Haiku 4.5)
+
+**策略:** 作为应急备用使用。无限用量,永久零成本!
+
+---
+
+## iFlow(8 个免费模型)
+
+### 价格
+
+| 套餐 | 月费 | 模型 | 配额 |
+|------|--------------|--------|-------|
+| 免费 | $0 | 8 个模型 | 无限 |
+
+**最佳价值:** 免费层中模型最多!Kimi K2、Qwen3、GLM、MiniMax、DeepSeek。
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 连接 iFlow
+```
+
+**步骤 2:iFlow OAuth 登录**
+
+- 点击 "Connect iFlow"
+- 浏览器打开 → iFlow 登录页
+- 创建账户或登录
+- 授予权限
+- 启用自动 token 刷新
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: if/kimi-k2-thinking
+ if/kimi-k2
+ if/qwen3-coder-plus
+ if/glm-4.7
+ if/minimax-m2
+ if/deepseek-r1
+ if/deepseek-v3.2-chat
+ if/deepseek-v3.2-reasoner
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `if/kimi-k2-thinking` | Kimi K2 Thinking | 复杂推理 |
+| `if/kimi-k2` | Kimi K2 | 通用编码 |
+| `if/qwen3-coder-plus` | Qwen3 Coder Plus | 代码生成 |
+| `if/glm-4.7` | GLM 4.7 | 中文 + 英文 |
+| `if/minimax-m2` | MiniMax M2 | 长上下文 |
+| `if/deepseek-r1` | DeepSeek R1 | 推理任务 |
+| `if/deepseek-v3.2-chat` | DeepSeek V3.2 Chat | 对话型 |
+| `if/deepseek-v3.2-reasoner` | DeepSeek V3.2 Reasoner | 复杂逻辑 |
+
+### 专业建议
+
+- **8 个免费模型** - 免费层中最丰富
+- **无限用量** - 无配额限制
+- **Kimi K2 Thinking** - 复杂推理最佳
+- **DeepSeek R1** - 强大的推理能力
+
+---
+
+## Qwen(3 个免费模型)
+
+### 价格
+
+| 套餐 | 月费 | 模型 | 配额 |
+|------|--------------|--------|-------|
+| 免费 | $0 | 3 个模型 | 无限 |
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 连接 Qwen
+```
+
+**步骤 2:设备码授权**
+
+- 点击 "Connect Qwen"
+- 仪表盘显示设备码
+- 访问授权 URL
+- 输入设备码
+- 登录 Qwen 账户
+- 启用自动 token 刷新
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: qw/qwen3-coder-plus
+ qw/qwen3-coder-flash
+ qw/vision-model
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `qw/qwen3-coder-plus` | Qwen3 Coder Plus | 高级编码 |
+| `qw/qwen3-coder-flash` | Qwen3 Coder Flash | 快速响应 |
+| `qw/vision-model` | Qwen3 Vision | 图像分析 |
+
+### 专业建议
+
+- **Qwen3 Coder Plus** - 编码能力强
+- **Qwen3 Coder Flash** - 快速任务首选
+- **Vision 模型** - 免费图像分析
+- **无限用量** - 无配额限制
+
+---
+
+## Kiro(免费 Claude)
+
+### 价格
+
+| 套餐 | 月费 | 模型 | 配额 |
+|------|--------------|--------|-------|
+| 免费 | $0 | Claude Sonnet 4.5、Haiku 4.5 | 无限 |
+
+**最佳价值:** 免费 Claude!与付费 Claude Code 同质量。
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 连接 Kiro
+```
+
+**步骤 2:AWS Builder ID 或 OAuth**
+
+- 点击 "Connect Kiro"
+- 选择登录方式:
+ - AWS Builder ID(推荐)
+ - Google 账户
+ - GitHub 账户
+- 授予权限
+- 启用自动 token 刷新
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: kr/claude-sonnet-4.5
+ kr/claude-haiku-4.5
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `kr/claude-sonnet-4.5` | Claude Sonnet 4.5 | 质量/速度平衡 |
+| `kr/claude-haiku-4.5` | Claude Haiku 4.5 | 快速响应 |
+
+### 专业建议
+
+- **免费 Claude** - 与付费层同质量
+- **AWS Builder ID** - 用 AWS 账户轻松设置
+- **无限用量** - 无配额限制
+- **顶级质量** - 免费的 Claude 4.5!
+
+---
+
+## 特性对比
+
+| 提供商 | 模型 | 最佳模型 | 设置方式 | 配额 |
+|----------|--------|------------|-------|-------|
+| **iFlow** | 8 | Kimi K2 Thinking | OAuth | 无限 |
+| **Qwen** | 3 | Qwen3 Coder Plus | 设备码 | 无限 |
+| **Kiro** | 2 | Claude Sonnet 4.5 | AWS Builder ID | 无限 |
+
+**赢家:** 多样性看 iFlow,质量看 Kiro!
+
+---
+
+## 使用示例
+
+### Cursor IDE 设置
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [从 9router 仪表盘获取]
+ Model: if/kimi-k2-thinking
+```
+
+### 创建组合(推荐)
+
+```
+仪表盘 → 组合 → 新建
+
+名称: free-combo
+模型:
+ 1. if/kimi-k2-thinking (iFlow 主力)
+ 2. qw/qwen3-coder-plus (Qwen 备用)
+ 3. kr/claude-sonnet-4.5 (Kiro 质量)
+
+CLI 中使用: free-combo
+```
+
+**结果:** 零成本,最大在线!
+
+---
+
+## 完整回退策略
+
+### 完整 3 层组合
+
+```
+仪表盘 → 组合 → 新建
+
+名称: complete-fallback
+模型:
+ 1. gc/gemini-3-flash-preview (免费订阅)
+ 2. cc/claude-opus-4-5 (付费订阅)
+ 3. glm/glm-4.7 (低价备用, 每 1M $0.6)
+ 4. minimax/MiniMax-M2.1 (最便宜, 每 1M $0.2)
+ 5. if/kimi-k2-thinking (免费回退)
+ 6. kr/claude-sonnet-4.5 (免费质量)
+
+CLI 中使用: complete-fallback
+```
+
+**结果:**
+- 第 1 层: 免费订阅(Gemini CLI)
+- 第 2 层: 付费订阅(Claude Code)
+- 第 3 层: 低价备用(GLM、MiniMax)
+- 第 4 层: 免费回退(iFlow、Kiro)
+
+**永不停码!**
+
+---
+
+## 最佳实践
+
+### 1. 作为应急备用
+
+```
+优先级:
+1. 订阅层(最大化付费配额)
+2. 低价层(每 1M tokens 几分钱)
+3. 免费层(无限,零成本)
+
+仅在以下情况使用免费层:
+- 订阅配额耗尽
+- 预算上限达到
+- 测试/非关键任务
+```
+
+### 2. 选择合适的模型
+
+```
+复杂推理: if/kimi-k2-thinking
+快速编码: qw/qwen3-coder-flash
+最佳质量: kr/claude-sonnet-4.5
+长上下文: if/minimax-m2
+视觉任务: qw/vision-model
+```
+
+### 3. 创建仅免费组合
+
+```
+零成本编码:
+
+名称: zero-cost
+模型:
+ 1. kr/claude-sonnet-4.5 (最佳质量)
+ 2. if/kimi-k2-thinking (复杂任务)
+ 3. qw/qwen3-coder-plus (快速编码)
+
+成本: 永远 $0!
+```
+
+### 4. 上生产前先测试
+
+```
+用免费层来:
+- 测试 prompt
+- 原型功能
+- 学习新框架
+- 非关键任务
+
+把付费配额留给:
+- 生产代码
+- 复杂重构
+- 关键功能
+```
+
+---
+
+## 真实案例
+
+### 案例 1:学生/学习者(零预算)
+
+```
+设置:
+1. kr/claude-sonnet-4.5 (最佳质量)
+2. if/kimi-k2-thinking (复杂推理)
+3. qw/qwen3-coder-plus (快速编码)
+
+月成本: $0
+用量: 无限
+
+适合:
+- 学习编程
+- 个人项目
+- 作业/任务
+```
+
+### 案例 2:自由职业(预算敏感)
+
+```
+设置:
+1. gc/gemini-3-flash-preview (每月免费 180K)
+2. glm/glm-4.7 (低价备用, 每 1M $0.6)
+3. if/kimi-k2-thinking (免费回退)
+
+月成本: $5-10
+用量: 100M+ tokens
+
+适合:
+- 客户项目(付费层)
+- 测试(免费层)
+- 应急备用
+```
+
+### 案例 3:重度用户(全部最大化)
+
+```
+设置:
+1. gc/gemini-3-flash-preview (每月免费 180K)
+2. cc/claude-opus-4-5 (订阅 $20-100)
+3. cx/gpt-5.2-codex (订阅 $20-200)
+4. glm/glm-4.7 (低价 每 1M $0.6)
+5. minimax/MiniMax-M2.1 (最便宜 每 1M $0.2)
+6. if/kimi-k2-thinking (免费无限)
+7. kr/claude-sonnet-4.5 (免费质量)
+
+月成本: $40-320(订阅)+ $10-20(低价层)
+用量: 500M+ tokens
+
+适合:
+- 专业开发
+- 团队项目
+- 24/7 编码
+```
+
+---
+
+## 成本对比
+
+### 场景:每月 100M tokens
+
+**方案 1:仅 ChatGPT API**
+```
+100M × $20/1M = $2,000/月
+```
+
+**方案 2:仅 9Router 免费层**
+```
+100M 通过免费层 = $0/月
+节省: $2,000/月 (100%)
+```
+
+**方案 3:9Router 完整策略**
+```
+60M 通过 Gemini CLI(免费): $0
+30M 通过 Claude Code(订阅): 无额外费用
+8M 通过 GLM(低价): $4.80
+2M 通过 iFlow(免费): $0
+合计: $4.80/月 + 你已有的订阅
+节省: $1,995/月 (99.76%)
+```
+
+---
+
+## 故障排除
+
+### "OAuth failed"
+
+**方案:**
+- 检查网络连接
+- 尝试其他浏览器
+- 清除浏览器缓存
+- 在仪表盘重新连接
+
+### "Model not available"
+
+**方案:**
+- 检查仪表盘中提供商已连接
+- 确认 OAuth token 有效
+- 必要时重新连接提供商
+
+### "Slow responses"
+
+**方案:**
+- 免费层优先级较低
+- 在非高峰时段使用
+- 切换到其他免费提供商
+- 升级到低价层以提速
+
+---
+
+## 限制
+
+### 免费层注意事项
+
+- **速度** - 可能慢于付费层
+- **优先级** - 高峰期优先级较低
+- **速率限制** - 可能限速(但配额无限)
+- **可用性** - 偶尔可能宕机
+
+**方案:** 使用 3 层回退策略保障可靠性!
+
+---
+
+## 下一步
+
+- **设置订阅:** [订阅型提供商](./subscription.md)
+- **添加低价备用:** [低价提供商](./cheap.md)
+- **创建组合:** 仪表盘 → 组合 → 新建
+- **开始编码:** 使用 `complete-fallback` 组合最大化可靠性
diff --git a/gitbook/content/zh-CN/providers/subscription.md b/gitbook/content/zh-CN/providers/subscription.md
new file mode 100644
index 0000000..51e7e49
--- /dev/null
+++ b/gitbook/content/zh-CN/providers/subscription.md
@@ -0,0 +1,404 @@
+# 订阅型提供商 - 最大化你的价值
+
+通过智能配额跟踪和自动回退,最大化你已有的 AI 订阅价值。在重置前用完每一点订阅配额!
+
+---
+
+## 概览
+
+订阅型提供商是你的 **首选** - 既然已经付费了,就要用足:
+
+- ✅ **Claude Code**(Pro/Max)- Claude 4.5 Opus/Sonnet/Haiku
+- ✅ **OpenAI Codex**(Plus/Pro)- GPT 5.2 Codex、GPT 5.1 Codex Max
+- ✅ **Gemini CLI**(免费层!)- 每月 180K 次补全
+- ✅ **GitHub Copilot** - GPT-5、Claude 4.5、Gemini 3
+- ✅ **Antigravity**(Google)- Gemini 3 Pro、Claude Sonnet 4.5
+
+**策略:** 优先使用这些,实时跟踪配额,耗尽时回退到低价/免费层。
+
+---
+
+## Claude Code(Pro/Max)
+
+### 价格
+
+| 套餐 | 月费 | 配额重置 | 模型 |
+|------|--------------|-------------|--------|
+| Pro | $20 | 5 小时 + 每周 | Opus、Sonnet、Haiku |
+| Max | $100 | 5 小时 + 每周 | Opus、Sonnet、Haiku |
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘打开 → 提供商 → 连接 Claude Code
+```
+
+**步骤 2:OAuth 登录**
+
+- 点击 "Connect Claude Code"
+- 浏览器打开 → 登录 Claude.ai
+- 启用自动 token 刷新
+- 开始配额跟踪
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: cc/claude-opus-4-5-20251101
+ cc/claude-sonnet-4-5-20250929
+ cc/claude-haiku-4-5-20251001
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `cc/claude-opus-4-5-20251101` | Claude 4.5 Opus | 复杂任务、架构 |
+| `cc/claude-sonnet-4-5-20250929` | Claude 4.5 Sonnet | 平衡速度/质量 |
+| `cc/claude-haiku-4-5-20251001` | Claude 4.5 Haiku | 快速响应 |
+
+### 专业建议
+
+- **Opus 用于复杂任务** - 架构决策、重构
+- **Sonnet 用于速度** - 快速编辑、代码生成
+- **按模型跟踪配额** - 仪表盘按模型显示使用情况
+- **5 小时重置** - 每 5 小时刷新配额,加每周重置
+
+---
+
+## OpenAI Codex(Plus/Pro)
+
+### 价格
+
+| 套餐 | 月费 | 配额重置 | 模型 |
+|------|--------------|-------------|--------|
+| Plus | $20 | 5 小时 + 每周 | GPT 5.2、GPT 5.1 |
+| Pro | $200 | 5 小时 + 每周 | GPT 5.2 Codex、GPT 5.1 Max |
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 连接 Codex
+```
+
+**步骤 2:OAuth 登录**
+
+- 点击 "Connect Codex"
+- 浏览器打开 `http://localhost:1455`
+- 登录 OpenAI 账户
+- 启用自动 token 刷新
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: cx/gpt-5.2-codex
+ cx/gpt-5.1-codex-max
+ cx/gpt-5.2
+ cx/gpt-5.1-codex
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `cx/gpt-5.2-codex` | GPT 5.2 Codex | 最新编码模型 |
+| `cx/gpt-5.1-codex-max` | GPT 5.1 Codex Max | 最大上下文 |
+| `cx/gpt-5.2` | GPT 5.2 | 通用任务 |
+| `cx/gpt-5.1-codex` | GPT 5.1 Codex | 稳定编码 |
+
+### 专业建议
+
+- **5 小时滚动配额** - 每 5 小时刷新配额
+- **每周重置** - 每周配额完全重置
+- **Pro 层** - 配额是 Plus 的 10 倍
+
+---
+
+## Gemini CLI(每月免费 180K!)
+
+### 价格
+
+| 套餐 | 月费 | 配额 | 重置 |
+|------|--------------|-------|-------|
+| 免费 | $0 | 180K 次补全/月 + 每日 1K | 每日 + 每月 |
+
+**最佳性价比:** 巨大的免费层!请在付费层之前使用。
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 连接 Gemini CLI
+```
+
+**步骤 2:Google OAuth**
+
+- 点击 "Connect Gemini CLI"
+- 浏览器打开 → 登录 Google 账户
+- 授予权限
+- 启用自动 token 刷新
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: gc/gemini-3-flash-preview
+ gc/gemini-3-pro-preview
+ gc/gemini-2.5-pro
+ gc/gemini-2.5-flash
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `gc/gemini-3-flash-preview` | Gemini 3 Flash Preview | 快速响应 |
+| `gc/gemini-3-pro-preview` | Gemini 3 Pro Preview | 复杂任务 |
+| `gc/gemini-2.5-pro` | Gemini 2.5 Pro | 稳定生产 |
+| `gc/gemini-2.5-flash` | Gemini 2.5 Flash | 快速任务 |
+
+### 专业建议
+
+- **每月 180K 次补全** - 大量免费层
+- **每日 1K 限制** - 每天午夜重置
+- **优先使用** - 免费层,先于付费订阅
+- **无需信用卡** - Google 账户完全免费
+
+---
+
+## GitHub Copilot
+
+### 价格
+
+| 套餐 | 月费 | 配额重置 | 模型 |
+|------|--------------|-------------|--------|
+| 个人 | $10 | 每月(1 日) | GPT-5、Claude 4.5、Gemini 3 |
+| 商业 | $19 | 每月(1 日) | GPT-5、Claude 4.5、Gemini 3 |
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 连接 GitHub
+```
+
+**步骤 2:通过 GitHub 进行 OAuth**
+
+- 点击 "Connect GitHub"
+- 浏览器打开 → 登录 GitHub
+- 授权 GitHub Copilot
+- 启用自动 token 刷新
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: gh/gpt-5
+ gh/gpt-5.1-codex-max
+ gh/claude-4.5-sonnet
+ gh/gemini-3-pro
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `gh/gpt-5` | GPT-5 | 最新 OpenAI 模型 |
+| `gh/gpt-5.1-codex-max` | GPT-5.1 Codex Max | 最大上下文 |
+| `gh/claude-4.5-sonnet` | Claude 4.5 Sonnet | Anthropic 质量 |
+| `gh/gemini-3-pro` | Gemini 3 Pro | Google 质量 |
+
+### 专业建议
+
+- **每月重置** - 每月 1 日完全重置
+- **多模型** - 一个订阅访问 GPT、Claude、Gemini
+- **商业层** - 团队更高配额
+
+---
+
+## Antigravity(Google 账户)
+
+### 价格
+
+| 套餐 | 月费 | 配额 | 模型 |
+|------|--------------|-------|--------|
+| 免费 | $0 | 类似 Gemini CLI | Gemini 3 Pro、Claude Sonnet 4.5 |
+
+### 设置
+
+**步骤 1:通过仪表盘连接**
+
+```bash
+9router
+# 仪表盘 → 提供商 → 连接 Antigravity
+```
+
+**步骤 2:Google OAuth**
+
+- 点击 "Connect Antigravity"
+- 浏览器打开 → 登录 Google 账户
+- 授予权限
+- 启用自动 token 刷新
+
+**步骤 3:在 CLI 中使用**
+
+```
+Model: ag/gemini-3-pro-high
+ ag/claude-sonnet-4-5
+ ag/claude-opus-4-5-thinking
+```
+
+### 可用模型
+
+| 模型 ID | 描述 | 最佳场景 |
+|----------|-------------|----------|
+| `ag/gemini-3-pro-high` | Gemini 3 Pro High | 高质量响应 |
+| `ag/claude-sonnet-4-5` | Claude Sonnet 4.5 | Anthropic 质量 |
+| `ag/claude-opus-4-5-thinking` | Claude Opus 4.5 Thinking | 复杂推理 |
+
+### 专业建议
+
+- **免费层** - Google 账户零成本
+- **可访问 Claude** - 免费的 Claude Sonnet/Opus
+- **配额类似 Gemini CLI** - 每日/每月上限
+
+---
+
+## 价格对比
+
+| 提供商 | 月费 | 配额重置 | 价值 |
+|----------|--------------|-------------|-------|
+| **Claude Code Pro** | $20 | 5 小时 + 每周 | ⭐⭐⭐⭐⭐ 最佳质量 |
+| **Claude Code Max** | $100 | 5 小时 + 每周 | ⭐⭐⭐⭐⭐ 最高配额 |
+| **Codex Plus** | $20 | 5 小时 + 每周 | ⭐⭐⭐⭐ 良好性价比 |
+| **Codex Pro** | $200 | 5 小时 + 每周 | ⭐⭐⭐⭐⭐ 10× 配额 |
+| **Gemini CLI** | **$0** | 每日 + 每月 | ⭐⭐⭐⭐⭐ 免费 180K/月! |
+| **GitHub Copilot** | $10-19 | 每月(1 日) | ⭐⭐⭐⭐ 多模型 |
+| **Antigravity** | **$0** | 每日 + 每月 | ⭐⭐⭐⭐ 免费 Claude! |
+
+---
+
+## 使用示例
+
+### Cursor IDE 设置
+
+```
+Settings → Models → Advanced:
+ OpenAI API Base URL: http://localhost:20128/v1
+ OpenAI API Key: [从 9router 仪表盘获取]
+ Model: cc/claude-opus-4-5-20251101
+```
+
+### 创建组合(推荐)
+
+```
+仪表盘 → 组合 → 新建
+
+名称: premium-coding
+模型:
+ 1. gc/gemini-3-flash-preview (免费, 优先使用)
+ 2. cc/claude-opus-4-5-20251101 (订阅)
+ 3. cx/gpt-5.2-codex (订阅备用)
+
+CLI 中使用: premium-coding
+```
+
+**结果:** 最大化免费层 → 使用订阅 → 自动回退
+
+---
+
+## 配额跟踪
+
+9Router 实时跟踪配额:
+
+- **Token 消耗** - 每次请求的输入/输出 tokens
+- **重置倒计时** - 下次配额重置剩余时间
+- **使用百分比** - 配额已用比例
+- **自动回退** - 耗尽时切换到下一层
+
+**仪表盘视图:**
+
+```
+Claude Code Pro
+├─ 配额: 已用 75%
+├─ 重置: 2h 15m(5 小时)
+├─ 每周重置: 3 天
+└─ 回退: glm/glm-4.7(低价层)
+```
+
+---
+
+## 最佳实践
+
+### 1. 优先使用免费层
+
+```
+优先级:
+1. Gemini CLI(每月免费 180K)
+2. Antigravity(免费 Claude)
+3. Claude Code/Codex(付费订阅)
+```
+
+### 2. 每日跟踪配额
+
+- 每天早上查看仪表盘
+- 围绕配额重置规划重任务
+- 非关键任务用低价/免费层
+
+### 3. 创建智能组合
+
+```
+示例组合:
+1. gc/gemini-3-flash-preview(免费主力)
+2. cc/claude-opus-4-5(复杂任务)
+3. glm/glm-4.7(低价备用)
+4. if/kimi-k2-thinking(免费回退)
+```
+
+### 4. 按时间优化
+
+```
+早上: 全新 5 小时配额(Claude/Codex)
+下午: Gemini CLI(每日 1K)
+晚上: 订阅配额
+深夜: 低价/免费层
+```
+
+---
+
+## 故障排除
+
+### "Quota exhausted"
+
+**方案:**
+- 查看仪表盘配额跟踪
+- 等待重置(5 小时或每日)
+- 使用组合回退到低价/免费层
+
+### "OAuth token expired"
+
+**方案:**
+- 9Router 会自动刷新
+- 若仍有问题: 仪表盘 → 提供商 → 重新连接
+
+### "Rate limiting"
+
+**方案:**
+- 订阅配额已用尽
+- 添加回退:`cc/claude-opus → glm/glm-4.7`
+- 使用免费层:`if/kimi-k2-thinking`
+
+---
+
+## 下一步
+
+- **设置低价备用:** [低价提供商](./cheap.md)
+- **添加免费回退:** [免费提供商](./free.md)
+- **创建组合:** 仪表盘 → 组合 → 新建
diff --git a/gitbook/content/zh-CN/troubleshooting.md b/gitbook/content/zh-CN/troubleshooting.md
new file mode 100644
index 0000000..a527dc4
--- /dev/null
+++ b/gitbook/content/zh-CN/troubleshooting.md
@@ -0,0 +1,351 @@
+# 故障排除
+
+使用 9Router 时常见的问题与解决方案。
+
+---
+
+## "Language model did not provide messages"
+
+**问题:** 请求失败,响应为空或返回错误。
+
+**原因:**
+- 提供商配额耗尽
+- API key 无效或过期
+- 模型不可用
+
+**解决方案:**
+
+1. **查看配额状态:**
+ ```
+ 仪表盘 → 提供商 → 查看配额跟踪
+ ```
+ 若配额耗尽,等待重置或切换提供商。
+
+2. **使用组合回退:**
+ ```
+ 仪表盘 → 组合 → 创建回退链
+ 示例: cc/claude-opus → glm/glm-4.7 → if/kimi-k2
+ ```
+
+3. **验证提供商连接:**
+ ```
+ 仪表盘 → 提供商 → 必要时重新连接
+ ```
+
+---
+
+## 速率限制
+
+**问题:** 出现 "Rate limit exceeded" 或 "Too many requests" 错误。
+
+**原因:**
+- 订阅配额用完(5 小时/每日/每周限制)
+- 触发了 API 速率限制
+- 并发请求过多
+
+**解决方案:**
+
+1. **查看重置时间:**
+ ```
+ 仪表盘 → 配额跟踪 → 查看重置倒计时
+ ```
+
+2. **切换到低价层:**
+ ```
+ 使用: glm/glm-4.7 (每 1M tokens $0.6)
+ minimax/MiniMax-M2.1 (每 1M tokens $0.20)
+ ```
+
+3. **添加回退组合:**
+ ```
+ 仪表盘 → 组合 → 添加备用模型
+ 主力: cc/claude-opus (订阅)
+ 备用: glm/glm-4.7 (低价)
+ 应急: if/kimi-k2 (免费)
+ ```
+
+---
+
+## OAuth Token 过期
+
+**问题:** 出现 "Unauthorized" 或 "Token expired" 错误。
+
+**原因:**
+- OAuth token 过期(自动刷新失败)
+- 提供商会话失效
+- 刷新过程中出现网络问题
+
+**解决方案:**
+
+1. **自动刷新(默认):**
+ 9Router 会自动刷新 token。等待 30 秒后重试。
+
+2. **手动重连:**
+ ```
+ 仪表盘 → 提供商 → [提供商名称] → 重新连接
+ → 再次完成 OAuth 流程
+ ```
+
+3. **检查提供商状态:**
+ 确认提供商服务在线(Claude Code、Codex 等)。
+
+---
+
+## 成本过高
+
+**问题:** 出现意外的高用量或高成本。
+
+**原因:**
+- 不必要地使用了昂贵模型
+- 没有回退到便宜层级
+- 上下文窗口过大
+
+**解决方案:**
+
+1. **查看使用统计:**
+ ```
+ 仪表盘 → 使用统计 → 查看 token 消耗
+ → 找出高成本模型
+ ```
+
+2. **切换到更便宜的模型:**
+ ```
+ 替换: cc/claude-opus ($20-100/月 订阅)
+ 为: glm/glm-4.7 (每 1M tokens $0.6)
+ minimax/MiniMax-M2.1 (每 1M tokens $0.20)
+ ```
+
+3. **使用免费层:**
+ ```
+ if/kimi-k2-thinking (免费)
+ qw/qwen3-coder-plus (免费)
+ kr/claude-sonnet-4.5 (免费)
+ gc/gemini-3-flash-preview (每月免费 180K)
+ ```
+
+4. **优化 prompt:**
+ - 减少上下文大小
+ - 长响应使用流式输出
+ - 缓存常用 prompt
+
+---
+
+## 连接被拒绝
+
+**问题:** 出现 "ECONNREFUSED" 或 "Cannot connect to localhost:20128"。
+
+**原因:**
+- 9Router 未运行
+- 端口 20128 被阻止
+- 防火墙拦截连接
+
+**解决方案:**
+
+1. **启动 9Router:**
+ ```bash
+ 9router
+ ```
+ 仪表盘应该在 http://localhost:3000 打开。
+
+2. **检查端口 20128:**
+ ```bash
+ # 检查端口是否监听
+ lsof -i :20128
+
+ # Windows
+ netstat -ano | findstr :20128
+ ```
+
+3. **检查防火墙:**
+ - macOS: 系统设置 → 网络 → 防火墙
+ - Windows: Windows Defender 防火墙 → 允许应用
+ - Linux: `sudo ufw allow 20128`
+
+4. **使用云端 endpoint:**
+ 如果 localhost 不行(例如 Cursor IDE):
+ ```
+ Endpoint: https://9router.com/v1
+ ```
+
+---
+
+## 仪表盘无法打开
+
+**问题:** 仪表盘无法在 http://localhost:3000 加载。
+
+**原因:**
+- 端口 3000 被占用
+- 9Router 崩溃
+- 浏览器缓存问题
+
+**解决方案:**
+
+1. **确认 9Router 是否运行:**
+ ```bash
+ # 检查进程
+ ps aux | grep 9router
+
+ # 检查端口 3000
+ lsof -i :3000
+ ```
+
+2. **杀掉冲突进程:**
+ ```bash
+ # macOS/Linux
+ lsof -ti:3000 | xargs kill -9
+
+ # Windows
+ netstat -ano | findstr :3000
+ taskkill /PID /F
+ ```
+
+3. **重启 9Router:**
+ ```bash
+ # 停止
+ pkill -f 9router
+
+ # 启动
+ 9router
+ ```
+
+4. **清除浏览器缓存:**
+ - Chrome: Ctrl+Shift+Delete → 清除缓存
+ - 尝试无痕模式
+
+5. **检查防火墙设置:**
+ 确认端口 3000 未被阻止。
+
+---
+
+## 模型未找到
+
+**问题:** 出现 "Model not found" 或 "Invalid model" 错误。
+
+**原因:**
+- 提供商未连接
+- 模型 ID 拼写错误
+- 提供商未激活
+
+**解决方案:**
+
+1. **验证提供商连接:**
+ ```
+ 仪表盘 → 提供商 → 检查状态(绿色 = 已激活)
+ ```
+
+2. **检查模型 ID 格式:**
+ ```
+ 正确: cc/claude-opus-4-5-20251101
+ 错误: claude-opus-4-5-20251101
+
+ 格式: [provider-prefix]/[model-name]
+ ```
+
+3. **列出可用模型:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer your-api-key"
+ ```
+
+4. **重新连接提供商:**
+ ```
+ 仪表盘 → 提供商 → [提供商] → 重新连接
+ ```
+
+---
+
+## 响应缓慢
+
+**问题:** 请求耗时过长或超时。
+
+**原因:**
+- 提供商延迟
+- 网络问题
+- 上下文/响应过大
+- 提供商速率限制
+
+**解决方案:**
+
+1. **查看提供商状态:**
+ ```
+ 仪表盘 → 提供商 → 查看延迟统计
+ ```
+
+2. **切换到更快的模型:**
+ ```
+ 快速: cc/claude-haiku-4-5 (Haiku 比 Opus 快)
+ gc/gemini-3-flash-preview
+ qw/qwen3-coder-flash
+ ```
+
+3. **使用流式响应:**
+ ```json
+ {
+ "model": "cc/claude-opus-4-5",
+ "messages": [...],
+ "stream": true
+ }
+ ```
+
+4. **检查网络:**
+ ```bash
+ # 测试延迟
+ ping api.anthropic.com
+ ping api.openai.com
+ ```
+
+5. **减小上下文:**
+ - 精简消息历史
+ - 使用更短的 prompt
+ - 在 CLI 工具中启用上下文裁剪
+
+---
+
+## API Key 无效
+
+**问题:** 出现 "Invalid API key" 或 "Authentication failed" 错误。
+
+**原因:**
+- 复制了错误的 API key
+- API key 已过期
+- 未生成 API key
+
+**解决方案:**
+
+1. **重新生成 API key:**
+ ```
+ 仪表盘 → 设置 → API Keys → 生成新 Key
+ → 复制并使用新 key
+ ```
+
+2. **检查 key 格式:**
+ ```
+ 正确: 9r_xxxxxxxxxxxxxxxxxxxxxxxx
+ 错误: 缺少 9r_ 前缀
+ ```
+
+3. **检查 CLI 配置中的 key:**
+ ```bash
+ # Cursor
+ Settings → Models → OpenAI API Key
+
+ # Cline
+ Settings → API Key
+
+ # 环境变量
+ export OPENAI_API_KEY="9r_your_key"
+ ```
+
+4. **测试 API key:**
+ ```bash
+ curl http://localhost:20128/v1/models \
+ -H "Authorization: Bearer 9r_your_key"
+ ```
+
+---
+
+## 需要更多帮助?
+
+- **GitHub Issues:** [github.com/decolua/9router/issues](https://github.com/decolua/9router/issues)
+- **文档:** [9router.com/docs](https://9router.com/docs)
+- **常见问题:** [faq.md](faq.md)
diff --git a/gitbook/jsconfig.json b/gitbook/jsconfig.json
new file mode 100644
index 0000000..9c33383
--- /dev/null
+++ b/gitbook/jsconfig.json
@@ -0,0 +1,8 @@
+{
+ "compilerOptions": {
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["./*"]
+ }
+ }
+}
diff --git a/gitbook/lib/content.js b/gitbook/lib/content.js
new file mode 100644
index 0000000..e5198c0
--- /dev/null
+++ b/gitbook/lib/content.js
@@ -0,0 +1,42 @@
+import fs from "fs";
+import path from "path";
+import { DEFAULT_LANG, isValidLang } from "@/constants/languages";
+
+const CONTENT_ROOT = path.join(process.cwd(), "content");
+
+function readContentFile(lang, slugPath) {
+ const filePath = path.join(CONTENT_ROOT, lang, `${slugPath}.md`);
+ if (!fs.existsSync(filePath)) return null;
+ return fs.readFileSync(filePath, "utf-8");
+}
+
+// Load content with fallback to default language if missing
+export function loadContent(lang, slug = "index") {
+ const safeLang = isValidLang(lang) ? lang : DEFAULT_LANG;
+ const slugPath = Array.isArray(slug) ? slug.join("/") : slug;
+ return readContentFile(safeLang, slugPath) || readContentFile(DEFAULT_LANG, slugPath);
+}
+
+// Walk content// to collect all slugs (excluding index.md)
+export function getAllSlugs(lang = DEFAULT_LANG) {
+ const baseDir = path.join(CONTENT_ROOT, lang);
+ if (!fs.existsSync(baseDir)) return [];
+
+ const walk = (dir, basePath = "") => {
+ const files = fs.readdirSync(dir);
+ let results = [];
+ files.forEach(file => {
+ const full = path.join(dir, file);
+ const stat = fs.statSync(full);
+ if (stat.isDirectory()) {
+ results = results.concat(walk(full, path.join(basePath, file)));
+ } else if (file.endsWith(".md") && file !== "index.md") {
+ const slug = path.join(basePath, file.replace(/\.md$/, ""));
+ results.push(slug.split(path.sep));
+ }
+ });
+ return results;
+ };
+
+ return walk(baseDir);
+}
diff --git a/gitbook/next.config.mjs b/gitbook/next.config.mjs
new file mode 100644
index 0000000..69608b6
--- /dev/null
+++ b/gitbook/next.config.mjs
@@ -0,0 +1,24 @@
+import { fileURLToPath } from "node:url";
+import { dirname } from "node:path";
+
+/** @type {import('next').NextConfig} */
+const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? "";
+const projectRoot = dirname(fileURLToPath(import.meta.url));
+
+const nextConfig = {
+ output: "export",
+ basePath,
+ assetPrefix: basePath || undefined,
+ trailingSlash: true,
+ images: {
+ unoptimized: true
+ },
+ turbopack: {
+ root: projectRoot
+ },
+ env: {
+ NEXT_PUBLIC_BASE_PATH: basePath
+ }
+};
+
+export default nextConfig;
diff --git a/gitbook/package.json b/gitbook/package.json
new file mode 100644
index 0000000..12f2735
--- /dev/null
+++ b/gitbook/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "9router-docs",
+ "version": "0.1.0",
+ "type": "module",
+ "scripts": {
+ "dev": "next dev -p 3001",
+ "build": "next build",
+ "start": "next start -p 3001",
+ "deploy": "npm run build && npx wrangler pages deploy out --project-name=9router-docs --commit-dirty=true"
+ },
+ "dependencies": {
+ "lucide-react": "^0.563.0",
+ "next": "16.1.1",
+ "react": "19.2.3",
+ "react-dom": "19.2.3",
+ "react-markdown": "^9.0.1",
+ "rehype-highlight": "^7.0.0",
+ "rehype-slug": "^6.0.0",
+ "remark-gfm": "^4.0.0"
+ },
+ "devDependencies": {
+ "@tailwindcss/postcss": "^4.2.0",
+ "tailwindcss": "^4.2.0"
+ }
+}
diff --git a/gitbook/postcss.config.mjs b/gitbook/postcss.config.mjs
new file mode 100644
index 0000000..9b544e3
--- /dev/null
+++ b/gitbook/postcss.config.mjs
@@ -0,0 +1,5 @@
+export default {
+ plugins: {
+ "@tailwindcss/postcss": {}
+ }
+};
diff --git a/gitbook/utils/markdown.js b/gitbook/utils/markdown.js
new file mode 100644
index 0000000..d4e56fd
--- /dev/null
+++ b/gitbook/utils/markdown.js
@@ -0,0 +1,217 @@
+import ReactMarkdown from "react-markdown";
+import remarkGfm from "remark-gfm";
+import rehypeHighlight from "rehype-highlight";
+import rehypeSlug from "rehype-slug";
+import { BookOpen, Rocket, Terminal, Monitor, FolderOpen, HelpCircle, MessageCircle, Mouse, Folder, Lock, Zap, Smartphone, Lightbulb, AlertTriangle, CheckCircle, ArrowRight, Layers, Plug, Cloud, Wallet, Gift, GitBranch, BarChart3, Code2, Sparkles, Server, PartyPopper, Siren, Link2, Target, Heart, Check, Home, Package, Wrench, OctagonX, Search, Globe, Container } from "lucide-react";
+
+const PAGE_ICONS = {
+ "Welcome to 9Router": BookOpen,
+ "Introduction": BookOpen,
+ "Getting Started": Rocket,
+ "Quick Start": Rocket,
+ "Installation": Terminal,
+ "Providers": Layers,
+ "Subscription (Maximize)": Sparkles,
+ "Cheap (Backup)": Wallet,
+ "Free (Fallback)": Gift,
+ "Features": Zap,
+ "Smart Routing": GitBranch,
+ "Combos & Fallback": Layers,
+ "Quota Tracking": BarChart3,
+ "Integration": Plug,
+ "Claude Code": Code2,
+ "OpenAI Codex": Code2,
+ "Cursor": Code2,
+ "Cline": Code2,
+ "Roo": Code2,
+ "Continue": Code2,
+ "Other Tools": Plug,
+ "Deployment": Cloud,
+ "Localhost": Monitor,
+ "Cloud (VPS/Docker)": Server,
+ "Troubleshooting": HelpCircle,
+ "FAQ": MessageCircle,
+ "Frequently Asked Questions": MessageCircle
+};
+
+const ICON_MAP = {
+ "terminal": Terminal,
+ "monitor": Monitor,
+ "mouse": Mouse,
+ "folder": Folder,
+ "lock": Lock,
+ "zap": Zap,
+ "smartphone": Smartphone,
+ "lightbulb": Lightbulb,
+ "alert-triangle": AlertTriangle,
+ "check-circle": CheckCircle,
+ "arrow-right": ArrowRight,
+};
+
+// Emoji to lucide icon mapping (auto-converted in markdown)
+const EMOJI_ICON_MAP = {
+ "✅": { Icon: CheckCircle, color: "text-green-600" },
+ "✓": { Icon: Check, color: "text-green-600" },
+ "❌": { Icon: AlertTriangle, color: "text-red-500" },
+ "⚠️": { Icon: AlertTriangle, color: "text-yellow-600" },
+ "⚠": { Icon: AlertTriangle, color: "text-yellow-600" },
+ "🚨": { Icon: Siren, color: "text-red-500" },
+ "🛑": { Icon: OctagonX, color: "text-red-500" },
+ "💡": { Icon: Lightbulb, color: "text-yellow-500" },
+ "🔄": { Icon: GitBranch, color: "text-[#E68A6E]" },
+ "🚀": { Icon: Rocket, color: "text-[#E68A6E]" },
+ "⚡": { Icon: Zap, color: "text-yellow-500" },
+ "🔌": { Icon: Plug, color: "text-[#E68A6E]" },
+ "☁️": { Icon: Cloud, color: "text-blue-500" },
+ "☁": { Icon: Cloud, color: "text-blue-500" },
+ "📦": { Icon: Package, color: "text-[#E68A6E]" },
+ "💰": { Icon: Wallet, color: "text-green-600" },
+ "🎁": { Icon: Gift, color: "text-pink-500" },
+ "📊": { Icon: BarChart3, color: "text-[#E68A6E]" },
+ "💻": { Icon: Code2, color: "text-gray-700" },
+ "✨": { Icon: Sparkles, color: "text-[#E68A6E]" },
+ "🖥️": { Icon: Server, color: "text-gray-700" },
+ "🖥": { Icon: Server, color: "text-gray-700" },
+ "📖": { Icon: BookOpen, color: "text-[#E68A6E]" },
+ "🔒": { Icon: Lock, color: "text-gray-700" },
+ "➡️": { Icon: ArrowRight, color: "text-[#E68A6E]" },
+ "📱": { Icon: Smartphone, color: "text-[#E68A6E]" },
+ "📂": { Icon: Folder, color: "text-[#E68A6E]" },
+ "📁": { Icon: Folder, color: "text-[#E68A6E]" },
+ "🖱️": { Icon: Mouse, color: "text-[#E68A6E]" },
+ "🎉": { Icon: PartyPopper, color: "text-pink-500" },
+ "🔗": { Icon: Link2, color: "text-blue-500" },
+ "🎯": { Icon: Target, color: "text-red-500" },
+ "❤": { Icon: Heart, color: "text-red-500" },
+ "❤️": { Icon: Heart, color: "text-red-500" },
+ "🏠": { Icon: Home, color: "text-[#E68A6E]" },
+ "🔧": { Icon: Wrench, color: "text-gray-700" },
+ "🔍": { Icon: Search, color: "text-gray-700" },
+ "🌐": { Icon: Globe, color: "text-blue-500" },
+ "🐳": { Icon: Container, color: "text-blue-500" }
+};
+
+const EMOJI_REGEX = new RegExp(`^(${Object.keys(EMOJI_ICON_MAP).map(e => e.replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&")).join("|")})\\s*`);
+
+export function parseMarkdown(content) {
+ return content;
+}
+
+// Unicode-aware slugify: keeps letters/numbers from any language (Vietnamese, Chinese, Japanese, etc.)
+export function slugify(text) {
+ return text
+ .toLowerCase()
+ .normalize("NFC")
+ .replace(/[\s_]+/g, "-")
+ .replace(/[^\p{L}\p{N}-]+/gu, "")
+ .replace(/^-+|-+$/g, "");
+}
+
+// Extract leading emoji from heading children and replace with lucide icon
+function renderHeadingWithEmoji(tag, children, props) {
+ const Tag = tag;
+ const text = (Array.isArray(children) ? children : [children])
+ .map(c => (typeof c === "string" ? c : ""))
+ .join("");
+ const id = slugify(text);
+ const emojiMatch = text.match(EMOJI_REGEX);
+ if (emojiMatch) {
+ const { Icon, color } = EMOJI_ICON_MAP[emojiMatch[1]];
+ const rest = text.slice(emojiMatch[0].length);
+ return (
+
+
+ {rest}
+
+ );
+ }
+ return {children};
+}
+
+export function MarkdownRenderer({ content }) {
+ return (
+ {
+ const text = children?.toString() || "";
+ const IconComponent = PAGE_ICONS[text];
+ const id = slugify(text);
+
+ return (
+
+ {IconComponent && }
+ {children}
+
+ );
+ },
+ h2: ({ node, children, ...props }) => renderHeadingWithEmoji("h2", children, props),
+ h3: ({ node, children, ...props }) => renderHeadingWithEmoji("h3", children, props),
+ li: ({ node, children, ...props }) => {
+ // Extract text from children (handle React elements)
+ const extractText = (child) => {
+ if (typeof child === 'string') return child;
+ if (Array.isArray(child)) return child.map(extractText).join('');
+ if (child?.props?.children) return extractText(child.props.children);
+ return '';
+ };
+
+ const text = extractText(children);
+ const iconMatch = text.match(/^\[icon:([a-z-]+)\]\s*(.*)$/);
+
+ if (iconMatch) {
+ const iconName = iconMatch[1];
+ const restText = iconMatch[2];
+ const IconComponent = ICON_MAP[iconName];
+
+ return (
+
+ {IconComponent && }
+ {restText}
+
+ );
+ }
+
+ // Auto-convert leading emoji to lucide icon
+ const emojiMatch = text.match(EMOJI_REGEX);
+ if (emojiMatch) {
+ const { Icon, color } = EMOJI_ICON_MAP[emojiMatch[1]];
+ const restText = text.slice(emojiMatch[0].length);
+ return (
+
+
+ {restText}
+
+ );
+ }
+
+ return {children};
+ },
+ }}
+ >
+ {content}
+
+ );
+}
+
+export function extractHeadings(content) {
+ const headingRegex = /^(#{2,3})\s+(.+)$/gm;
+ const headings = [];
+ let match;
+
+ while ((match = headingRegex.exec(content)) !== null) {
+ const level = match[1].length;
+ const text = match[2].replace(EMOJI_REGEX, "").trim();
+ const id = slugify(text);
+
+ headings.push({
+ level,
+ text,
+ id
+ });
+ }
+
+ return headings;
+}
diff --git a/next.config.mjs b/next.config.mjs
index 99d5557..de5874f 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -1,7 +1,19 @@
+import { fileURLToPath } from "node:url";
+import { dirname } from "node:path";
+
+const projectRoot = dirname(fileURLToPath(import.meta.url));
+
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
serverExternalPackages: ["better-sqlite3", "sql.js", "node:sqlite", "bun:sqlite"],
+ turbopack: {
+ root: projectRoot
+ },
+ outputFileTracingRoot: projectRoot,
+ outputFileTracingExcludes: {
+ "*": ["./gitbook/**/*"]
+ },
images: {
unoptimized: true
},
@@ -15,8 +27,8 @@ const nextConfig = {
path: false,
};
}
- // Stop watching logs directory to prevent HMR during streaming
- config.watchOptions = { ...config.watchOptions, ignored: /[\\/](logs|\.next)[\\/]/ };
+ // Exclude logs, .next, gitbook subapp from watcher
+ config.watchOptions = { ...config.watchOptions, ignored: /[\\/](logs|\.next|gitbook)[\\/]/ };
return config;
},
async rewrites() {
diff --git a/src/lib/tunnel/tailscale.js b/src/lib/tunnel/tailscale.js
index aab5d72..d943567 100644
--- a/src/lib/tunnel/tailscale.js
+++ b/src/lib/tunnel/tailscale.js
@@ -570,8 +570,7 @@ export function startLogin(hostname) {
return;
}
- // Force re-auth on Win when device may have been removed from tailnet
- const args = tsArgs("up", "--accept-routes", "--force-reauth");
+ const args = tsArgs("up", "--accept-routes");
if (hostname) args.push(`--hostname=${hostname}`);
const child = spawn(bin, args, {
stdio: ["ignore", "pipe", "pipe"],