Quick Start Guide
Get CLI Proxy API running in under 5 minutes. This guide will walk you through installation, configuration, OAuth authentication, and making your first API call.What You’ll Build
By the end of this guide, you’ll have:- A running CLI Proxy API server
- OAuth authentication configured for at least one provider
- Successfully made an API call using your CLI subscription
Install CLI Proxy API
Choose your preferred installation method:
The Docker method is recommended for production deployments as it includes automatic updates and easier management.
Configure the Server
Create a Key Configuration Options:
For advanced configuration options, see the Server Configuration guide.
config.yaml file with your basic settings:config.yaml
| Option | Description | Default |
|---|---|---|
host | Network interface to bind (empty = all) | "" |
port | HTTP server port | 8317 |
auth-dir | Directory for OAuth tokens | ~/.cli-proxy-api |
api-keys | Client authentication keys | [] |
debug | Enable verbose logging | false |
Authenticate with a Provider
Authenticate with at least one OAuth provider. We’ll use Google Gemini as an example:This will:For multiple accounts:Each login creates a new credential file, enabling automatic load balancing.
- Gemini (Google)
- Claude Code
- OpenAI Codex
- Qwen Code
- Open your browser automatically
- Prompt you to sign in with your Google account
- Save OAuth tokens to
~/.cli-proxy-api/gemini_*.json
Use the
-no-browser flag if you’re on a headless server. You’ll get a URL to open manually.Verify Your Setup
Check that everything is working correctly:1. List Available Models
2. Check Server Health
3. Review Logs
Common Issues
OAuth browser doesn't open
OAuth browser doesn't open
Solution: Use the Copy the URL shown and open it in your browser manually.
-no-browser flag:Port 8317 already in use
Port 8317 already in use
Solution: Change the port in Then update your client requests to use the new port.
config.yaml:API returns 401 Unauthorized
API returns 401 Unauthorized
No models available after OAuth
No models available after OAuth
Solution: Verify OAuth tokens were saved:You should see files like
gemini_account1.json, claude_account1.json, etc.If missing, re-run the login command:Next Steps
Now that you have CLI Proxy API running:Add More Accounts
Set up multiple accounts for load balancing across providers
Configure Model Mappings
Create custom model aliases and route unavailable models
Integrate with Your Tools
Connect Cursor, Cline, or other AI coding tools
Deploy to Production
Learn best practices for production deployments
Alternative: Quick Docker Setup
If you prefer a fully automated Docker setup:For production deployments with high availability, see our Cloud Deployment guide.