ProxyCLI / SETUP_GUIDE.md
PHhTTPS's picture
Replace hardcoded OAuth secrets with placeholders
4998bdc
# CLIProxyAPIPlus Setup Guide - YOUR SETUP
## πŸŽ‰ Setup Complete!
You have **15 AI accounts** configured and ready to use through a single OpenAI-compatible proxy.
---
## πŸ“Š Account Summary
| Provider | Accounts | Type |
|-----------|-----------|-------|
| Gemini | 6 | OAuth |
| Antigravity | 7 | OAuth |
| Qwen | 1 | OAuth |
| OpenRouter | 1 | API Key |
| **Total** | **15** | |
### Your Configured Accounts
- pascal.hintermaier@gmail.com (Gemini)
- hintermaier.pascal@gmail.com (Gemini, Antigravity)
- claracouve342@gmail.com (Gemini, Antigravity)
- hintermaierpascal0@gmail.com (Gemini, Antigravity)
- rave.riotofficial@gmail.com (Gemini, Antigravity)
- citrondon666@gmail.com (Gemini, Antigravity)
- diesmalwichtigsamuel@gmail.com (Antigravity)
- 1x Qwen account
- 1x OpenRouter account
---
## πŸš€ Quick Start
### Server Status
- **URL**: http://localhost:8317
- **Status**: Running βœ…
- **Config**: ~/CLIProxyAPIPlus/config.yaml
- **Auth**: ~/.cli-proxy-api/
### Quick Test
```bash
~/CLIProxyAPIPlus/proxy test
```
### List Models
```bash
~/CLIProxyAPIPlus/proxy models
```
---
## πŸ“ Quick Reference Commands
### Using the `proxy` Script
```bash
~/CLIProxyAPIPlus/proxy <command>
```
**Available Commands:**
- `models` or `m` - List all available models
- `test` or `t` - Send test request
- `status` or `s` - Check server status
- `auth` or `a` - Show configured accounts
- `logs` or `l` - View recent logs
- `start` - Start proxy server
- `stop` - Stop proxy server
- `restart` or `r` - Restart server
### Fish Shell Aliases
These are available in your terminal:
**Testing:**
```bash
cliproxy-models # List models
cliproxy-test # Test request
cliproxy-status # Server status
```
**Management:**
```bash
cliproxy-start # Start server
cliproxy-stop # Stop server
cliproxy-restart # Restart server
cliproxy-logs # View logs
cliproxy-auth # Show accounts
```
**Add Accounts:**
```bash
gemini-login # Add Gemini
antigravity-login # Add Antigravity
qwen-login # Add Qwen
kiro-login # Add Kiro
```
---
## πŸ”§ Configuration
### Environment Variables
```bash
$CLIPROXY_URL # http://localhost:8317/v1
$CLIPROXY_KEY # sk-client-key-1
```
### API Keys (from config.yaml)
- `sk-client-key-1` - Primary API key
- `sk-client-key-2` - Secondary API key
### Client Configuration
#### OpenAI SDK (Python)
```python
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8317/v1",
api_key="sk-client-key-1"
)
response = client.chat.completions.create(
model="gemini-2.5-pro",
messages=[{"role": "user", "content": "Hello!"}]
)
```
#### Node.js
```javascript
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'http://localhost:8317/v1',
apiKey: 'sk-client-key-1'
});
const completion = await openai.chat.completions.create({
model: 'gemini-2.5-pro',
messages: [{ role: 'user', content: 'Hello!' }]
});
```
#### cURL
```bash
curl -H "Authorization: Bearer sk-client-key-1" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-pro",
"messages": [{"role": "user", "content": "Hello!"}]
}' \
http://localhost:8317/v1/chat/completions
```
---
## 🎯 Available Models
The proxy automatically combines models from all providers. To see all available models:
```bash
~/CLIProxyAPIPlus/proxy models
```
### Model Aliases
Some models have shorter aliases configured:
- `g2.5p` β†’ `gemini-2.5-pro`
- `g2.5f` β†’ `gemini-2.5-flash`
- `ag-pro` β†’ Antigravity pro model
- `qwen-plus` β†’ Qwen coder plus
---
## πŸ”„ Load Balancing
The proxy uses **round-robin** routing by default. When you make requests:
1. First request uses Account 1
2. Second request uses Account 2
3. Third request uses Account 3
4. ...and so on
This automatically distributes load across all your accounts!
---
## πŸ“ File Structure
```
~/CLIProxyAPIPlus/
β”œβ”€β”€ cli-proxy-api-plus # Main binary
β”œβ”€β”€ config.yaml # Configuration file
β”œβ”€β”€ server.log # Server logs
β”œβ”€β”€ proxy # Quick access script
β”œβ”€β”€ SETUP_GUIDE.md # This file
β”œβ”€β”€ README.md # Original README
└── auths/ # (optional, alternate auth location)
~/.cli-proxy-api/ # OAuth tokens stored here
β”œβ”€β”€ *.json # Provider tokens
└── ...
```
---
## πŸ”‘ Account Management
### Add New Accounts
**Gemini:**
```bash
cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -login -incognito
```
**Antigravity:**
```bash
cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -antigravity-login -incognito
```
**Qwen:**
```bash
cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -qwen-login -incognito
```
**Kiro (AWS CodeWhisperer):**
```bash
cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -kiro-aws-login -incognito
```
### View Current Accounts
```bash
~/CLIProxyAPIPlus/proxy auth
```
---
## πŸ› οΈ Troubleshooting
### Server Not Running
```bash
~/CLIProxyAPIPlus/proxy restart
```
### Check Logs
```bash
~/CLIProxyAPIPlus/proxy logs
```
### Port Already in Use
```bash
~/CLIProxyAPIPlus/proxy stop
sleep 2
~/CLIProxyAPIPlus/proxy start
```
### API Key Errors
- Make sure to use `Authorization: Bearer sk-client-key-1`
- Or set correct API key in your client config
### Browser Not Opening
- The incognito window might be behind other windows
- Check for browser notifications
- OAuth URLs are also printed in terminal
---
## πŸ“š Additional Resources
### Official Documentation
- CLIProxyAPI: https://github.com/router-for-me/CLIProxyAPI
- CLIProxyAPIPlus: https://github.com/router-for-me/CLIProxyAPIPlus
### API Endpoints
- `GET /v1/models` - List all models
- `POST /v1/chat/completions` - Chat completions
- `POST /v1/completions` - Text completions
### Management API (requires auth key)
- Base URL: `http://localhost:8317/v0/management`
- Auth Key: `admin123` (set in config.yaml)
- Endpoints: Add/remove accounts, view status, etc.
---
## πŸŽ“ Advanced Configuration
### Edit Config File
```bash
nano ~/CLIProxyAPIPlus/config.yaml
```
### Key Settings
- `port: 8317` - Server port
- `host: ""` - Bind to all interfaces
- `api-keys` - Client API keys
- `incognito-browser: true` - Multi-account support
- `routing.strategy: "round-robin"` - Load balancing
### Add More Providers
You can add:
- Claude (OAuth)
- OpenAI Codex (OAuth)
- Vertex (OAuth or API key)
- Any OpenAI-compatible provider via `openai-compatibility`
---
## βœ… Quick Verification
Run these commands to verify everything works:
```bash
# 1. Check server status
~/CLIProxyAPIPlus/proxy status
# 2. View all accounts
~/CLIProxyAPIPlus/proxy auth
# 3. List available models
~/CLIProxyAPIPlus/proxy models
# 4. Test API request
~/CLIProxyAPIPlus/proxy test
```
All should complete successfully! πŸŽ‰
---
## πŸ“ž Need Help?
### Common Issues
- **"Missing API key"** β†’ Add `Authorization: Bearer sk-client-key-1` header
- **"Connection refused"** β†’ Server not running, run `~/CLIProxyAPIPlus/proxy start`
- **"Model not found"** β†’ Check `~/CLIProxyAPIPlus/proxy models` for available models
### Get Support
- Check logs: `~/CLIProxyAPIPlus/proxy logs`
- Restart server: `~/CLIProxyAPIPlus/proxy restart`
- Review config: `nano ~/CLIProxyAPIPlus/config.yaml`
---
## πŸŽ‰ You're All Set!
Your CLIProxyAPIPlus proxy is running with 15 AI accounts. Use any OpenAI-compatible client and point it to:
```
http://localhost:8317/v1
```
The proxy will handle load balancing, account rotation, and provide a unified API endpoint for all your AI providers!
**Happy coding! πŸš€**