Feat : Gitbook

This commit is contained in:
decolua
2026-05-11 11:50:24 +07:00
parent 7ad538bcf2
commit fd92af77a0
124 changed files with 34154 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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