File size: 7,679 Bytes
4998bdc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# 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! π**
|