CLIProxyAPI  by luispater

Proxy API for diverse LLMs

Created 2 months ago
305 stars

Top 87.8% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a unified API gateway for multiple large language models, including Gemini, OpenAI (Codex/GPT), Claude, and Qwen. It enables developers to access these diverse models through a single, OpenAI-compatible API endpoint, facilitating easier integration and potentially leveraging free tiers or multiple accounts for cost-effective and flexible LLM usage. The service targets developers seeking a consolidated interface for various AI models.

How It Works

CLIProxyAPI functions as a proxy server that exposes standardized API endpoints compatible with OpenAI, Gemini, Claude, and Codex. It handles authentication via OAuth flows for each provider and routes incoming requests to the appropriate backend LLM service based on the specified model. The architecture supports multiple accounts per provider, enabling load balancing and resilience. It also integrates with OpenAI-compatible clients and SDKs by simply reconfiguring the base_url.

Quick Start & Requirements

  • Prerequisites: Go 1.24 or higher. Optional accounts for Gemini, OpenAI, Anthropic, and Qwen are required for accessing their respective models.
  • Installation: Clone the repository, navigate to the directory, and build the Go application using go build -o cli-proxy-api ./cmd/server.
  • Authentication: Initiate authentication via CLI flags like --login (Gemini), --codex-login (OpenAI), --claude-login (Claude), or --qwen-login (Qwen).
  • Running: Start the server with ./cli-proxy-api.
  • Configuration: Customize settings via a config.yaml file or the --config flag.
  • Docker: Pre-built Docker images are available for simplified deployment and authentication. Docker Compose is also supported for orchestrating the service.

Highlighted Details

  • Unified API Endpoints: Offers OpenAI/Gemini/Claude/Codex compatible endpoints for chat completions and messages.
  • Multi-Provider & Multi-Account Support: Integrates Gemini, OpenAI (GPT), Claude, and Qwen, with load balancing across multiple accounts for each.
  • Advanced Features: Supports streaming/non-streaming responses, function calling/tools, and multimodal input (text and images).
  • Broad Compatibility: Seamlessly integrates with OpenAI libraries in Python and JavaScript/TypeScript.
  • Extensibility: Allows configuration of additional OpenAI-compatible upstream providers like OpenRouter.
  • Hot Reloading: Automatically reloads client configurations upon detecting changes in the configuration or authentication directories.

Maintenance & Community

The project welcomes contributions via pull requests. Standard contribution steps are outlined, but specific details regarding maintainers, community channels (e.g., Discord, Slack), or a public roadmap are not detailed in the provided README.

Licensing & Compatibility

This project is licensed under the permissive MIT License. This license generally allows for commercial use, modification, and distribution, including integration within closed-source applications.

Limitations & Caveats

The project documentation notes that multi-account load balancing for the Gemini CLI is restricted to local access (127.0.0.1 is hardcoded) due to current authentication limitations for remote requests. The README does not explicitly mention alpha status, known bugs, or deprecation warnings.

Health Check
Last Commit

16 hours ago

Responsiveness

Inactive

Pull Requests (30d)
14
Issues (30d)
22
Star History
219 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.