Skip to main content

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
1

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.
2

Configure the Server

Create a config.yaml file with your basic settings:
config.yaml
Generate secure API keys using: openssl rand -hex 32
Key Configuration Options:For advanced configuration options, see the Server Configuration guide.
3

Start the Server

Launch CLI Proxy API with your configuration:
You should see output like:
4

Authenticate with a Provider

Authenticate with at least one OAuth provider. We’ll use Google Gemini as an example:
This will:
  1. Open your browser automatically
  2. Prompt you to sign in with your Google account
  3. 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.
For multiple accounts:
Each login creates a new credential file, enabling automatic load balancing.
OAuth tokens are stored in auth-dir (default: ~/.cli-proxy-api/). Keep these files secure and never commit them to version control.
5

Make Your First API Call

Test your setup with a simple API request:
cURL
Expected Response:
Replace your-secure-api-key-here with one of the API keys you defined in config.yaml.
Test with Python:
python
Test with Streaming:
python (streaming)

Verify Your Setup

Check that everything is working correctly:

1. List Available Models

You should see all models from your authenticated providers.

2. Check Server Health

3. Review Logs

Common Issues

Solution: Use the -no-browser flag:
Copy the URL shown and open it in your browser manually.
Solution: Change the port in config.yaml:
Then update your client requests to use the new port.
Causes:
  • Incorrect API key in Authorization header
  • API key not defined in config.yaml
Solution: Verify your API key:
config.yaml
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:
This gives you a complete setup with persistent storage for configs, auth tokens, and logs.
For production deployments with high availability, see our Cloud Deployment guide.