logo
icon

CLI Proxy AI/OAuth Provider

OpenAI/Gemini/Claude/Codex compatible API proxy for CLI models with OAuth support - no API keys needed

template cover
展開済み23
発行者wpinaja
作成日2026-01-12
サービス
service icon
タグ
AIAPIProxyTool

CLIProxyAPI

A powerful proxy server that wraps CLI-based AI models (Gemini CLI, OpenAI Codex, Claude Code, Qwen Code, iFlow, Antigravity) as OpenAI/Gemini/Claude/Codex compatible API endpoints with OAuth authentication support.

Features

  • Multi-Provider Support: OpenAI Codex (GPT-5), Claude Code, Gemini CLI, Qwen Code, iFlow, and Antigravity
  • OAuth Authentication: Use your existing subscriptions without API keys
  • Multi-Account Load Balancing: Round-robin support across multiple accounts with automatic failover
  • OpenAI Compatible: Works seamlessly with any OpenAI SDK and AI coding tools
  • Streaming Support: Real-time streaming responses for all providers
  • Function Calling: Full tool/function calling support
  • Web Management UI: Built-in web interface for easy OAuth configuration
  • Pre-configured: Optimized config.yaml included - ready to use out of the box

Supported AI Coding Tools

CLIProxyAPI works with all major AI coding assistants:

  • Cursor - AI-first code editor
  • Continue - VS Code extension for AI assistance
  • Cline - Claude-powered coding assistant
  • Windsurf - AI pair programming tool
  • Roo Code - AI code generation
  • GitHub Copilot Chat - Via OpenAI compatibility
  • And many more - Any tool supporting OpenAI API format

Quick Start Guide

Step 1: Authenticate Provider(s)

After deployment, you have two authentication methods:

Method A: Web UI (Recommended)

  1. Access Management Web UI at: https://<your-domain>:8085
  2. Click OAuth buttons for: Codex, Claude Code, Qwen Code, iFlow, or Antigravity
  3. Complete the OAuth flow in your browser
  4. For Gemini CLI: Use CLI method (requires terminal)

Method B: CLI Authentication

Use Zeabur's shell/terminal feature:

# Navigate to working directory
cd /CLIProxyAPI

# Gemini CLI (OAuth via port 8085)
./CLIProxyAPI -no-browser --login

# OpenAI Codex (OAuth via port 1455)
./CLIProxyAPI -no-browser --codex-login

# Claude Code (OAuth via port 54545)
./CLIProxyAPI -no-browser --claude-login

# Qwen Code
./CLIProxyAPI -no-browser --qwen-login

# iFlow (OAuth via port 11451)
./CLIProxyAPI -no-browser --iflow-login

# Antigravity (OAuth via port 51121)
./CLIProxyAPI -no-browser --antigravity-login

The -no-browser flag displays OAuth URL in terminal for manual browser authentication.

Step 2: Configure Your AI Coding Tool

After authentication, configure your tools:

Base URL: https://<your-domain>/v1
API Key: sk-cliproxyapi-default-key-change-me (or update in config.yaml)

Available Models

Each provider exposes different models:

OpenAI Codex: gpt-5-codex, gpt-5, codex-latest
Claude Code: claude-sonnet-4, claude-opus-4, claude-sonnet-4-5, claude-opus-4-5
Gemini CLI: gemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash-thinking
Qwen Code: qwen-coder-plus, qwen-turbo, qwen-max
iFlow: tstars2.0
Antigravity: antigravity-latest

Configuration Examples

Cursor

{
  "models": {
    "override": {
      "gpt-5-codex": {
        "apiKey": "sk-cliproxyapi-default-key-change-me",
        "baseURL": "https://<your-domain>/v1"
      }
    }
  }
}

Continue

{
  "models": [
    {
      "model": "gpt-5-codex",
      "apiKey": "sk-cliproxyapi-default-key-change-me",
      "apiBase": "https://<your-domain>/v1"
    }
  ]
}

Windsurf

model_provider = "cliproxyapi"
model = "gpt-5-codex"

[model_providers.cliproxyapi]
name = "cliproxyapi"
base_url = "https://<your-domain>/v1"
wire_api = "responses"

Cline

In VS Code Settings → Cline:

  • API Provider: OpenAI Compatible
  • Base URL: https://<your-domain>/v1
  • API Key: sk-cliproxyapi-default-key-change-me
  • Model: gpt-5-codex

Pre-configured Settings

This template includes an optimized config.yaml with:

Remote Management Enabled - Access Web UI from anywhere
Auto-retry on Failures - 3 retries with 30s max interval
Round-robin Load Balancing - Even distribution across accounts
Streaming Keepalive - 15s keepalive for stable connections
Log Management - File-based logging with 100MB limit
Usage Tracking - Built-in usage statistics
Quota Management - Auto-switch projects/models on quota exceeded

Config Location: /CLIProxyAPI/config.yaml

You can edit the config via Zeabur's file editor or terminal to:

  • Add/update API keys
  • Configure model mappings and aliases
  • Set up proxy routing
  • Add custom headers
  • Exclude specific models
  • Configure payload transformations

See the configuration guide for all options.

Advanced Configuration

Custom API Keys

Edit /CLIProxyAPI/config.yaml and update the api-keys section:

api-keys:
  - "sk-your-secure-key-1"
  - "sk-your-secure-key-2"

Multi-Account Setup

Add multiple OAuth accounts per provider via Web UI for load balancing, failover, and rate limiting.

Storage Backends

For persistent configuration, configure environment variables:

Git Storage:

GITSTORE_GIT_URL=https://github.com/user/config.git
GITSTORE_GIT_TOKEN=ghp_xxxxx

PostgreSQL:

PGSQL_ENABLE=true
PGSQL_DSN=postgres://user:pass@host:5432/db

Port Reference

PortPurposeProtocol
8317Main API EndpointHTTP
8085Management Web UI & Gemini OAuthHTTP
1455OpenAI Codex OAuth CallbackTCP
54545Claude Code OAuth CallbackTCP
51121Antigravity OAuth CallbackTCP
11451iFlow OAuth CallbackTCP

Resources

License

MIT License - See LICENSE