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


πŸš€ Quick Start

Server Status

  • URL: http://localhost:8317
  • Status: Running βœ…
  • Config: ~/CLIProxyAPIPlus/config.yaml
  • Auth: ~/.cli-proxy-api/

Quick Test

~/CLIProxyAPIPlus/proxy test

List Models

~/CLIProxyAPIPlus/proxy models

πŸ“ Quick Reference Commands

Using the proxy Script

~/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:

cliproxy-models      # List models
cliproxy-test         # Test request
cliproxy-status       # Server status

Management:

cliproxy-start        # Start server
cliproxy-stop         # Stop server
cliproxy-restart      # Restart server
cliproxy-logs        # View logs
cliproxy-auth         # Show accounts

Add Accounts:

gemini-login         # Add Gemini
antigravity-login    # Add Antigravity
qwen-login          # Add Qwen
kiro-login          # Add Kiro

πŸ”§ Configuration

Environment Variables

$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)

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

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

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:

~/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:

cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -login -incognito

Antigravity:

cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -antigravity-login -incognito

Qwen:

cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -qwen-login -incognito

Kiro (AWS CodeWhisperer):

cd ~/CLIProxyAPIPlus && ./cli-proxy-api-plus -kiro-aws-login -incognito

View Current Accounts

~/CLIProxyAPIPlus/proxy auth

πŸ› οΈ Troubleshooting

Server Not Running

~/CLIProxyAPIPlus/proxy restart

Check Logs

~/CLIProxyAPIPlus/proxy logs

Port Already in Use

~/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

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

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:

# 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! πŸš€