SuperAPI AI Directory

CLIProxyAPI

A proxy server that exposes AI CLI tools and subscriptions (Claude Code, Codex, Gemini, Grok, etc.) through OpenAI/Gemini/Claude/Codex-compatible API interfaces. Supports OAuth login, streaming/WebSocket responses, function calling, multimodal input, and multi-account load balancing across providers

Open website

About this tool

CLIProxyAPI is a proxy server designed to provide OpenAI-, Gemini-, Claude-, Codex-, and Grok-compatible API interfaces for command-line (CLI) AI tools. Through it, users can locally use any OpenAI- (including Responses), Gemini- (including Interactions), or Claude-compatible client or SDK to access the model services corresponding to multiple CLI accounts.

Main capabilities include:

  • Provides OpenAI/Gemini/Claude/Grok-compatible API endpoints for CLI models.
  • Supports OpenAI Codex (GPT series), Claude Code, and Grok Build via OAuth login.
  • Provides streaming, non-streaming, and WebSocket responses where supported.
  • Supports function calling/tool calling.
  • Supports multimodal input (text and images).
  • Supports multi-account round-robin load balancing (Gemini, OpenAI, Claude, Grok).
  • Provides a simple CLI authentication flow (Gemini, OpenAI, Claude, Grok).
  • Supports Generative Language API Key.
  • Supports AI Studio Build multi-account load balancing, Claude Code multi-account load balancing, OpenAI Codex multi-account load balancing, and Grok Build multi-account load balancing.
  • Can connect to OpenAI-compatible upstream providers (such as OpenRouter) through configuration.
  • Provides a reusable Go SDK for embedding the proxy (see docs/sdk-usage.md).

Usage: The project provides a CLIProxyAPI guide (https://help.router-for.me/),并包含管理 API documentation (MANAGEMENT_API.md). Users can log in to accounts of various providers through the CLI authentication flow, and then use compatible clients or SDKs to connect to the local proxy endpoint. For desktop use, the official recommendation is the EasyCLIProxyAPI desktop client, which provides a graphical configuration interface, automatic updates, system tray integration, and one-click start/stop of the service.

Since v6.10.0, CLIProxyAPI and CPAMC no longer include built-in usage statistics. If statistics are needed, you can use CPA Usage Keeper (an independent persistence and visualization service that supports periodic data synchronization, SQLite storage, an aggregation API, and a built-in dashboard) or CPA-Manager-Plus (a self-hosted management console and observability dashboard that supports OAuth credential management, AI provider management, client API keys, model aliases, plugins, and CPA settings, and provides request history, real-time monitoring, fault diagnosis, token/latency/estimated cost analysis, etc.).

Applicable scenarios:

  • Wanting to provide existing AI CLI subscriptions (such as Claude Code, ChatGPT Codex, Gemini, Grok, etc.) to other tools or applications through standard API interfaces.
  • Needing to perform load balancing across multiple CLI accounts to improve availability or share quotas.
  • Developing applications based on OpenAI/Gemini/Claude-compatible interfaces, but wanting the backend to use CLI subscriptions rather than direct API keys.
  • Embedding proxy capabilities into your own project through the Go SDK.

Limitations and notes:

  • The project itself does not provide models; it only acts as a proxy to forward requests to various CLI providers.
  • The usage statistics feature depends on third-party projects (CPA Usage Keeper, CPA-Manager-Plus, etc.).
  • Some features (such as WebSocket responses) depend on support from upstream providers.
  • Specific installation steps, system requirements, pricing models, etc. are not described in detail in the provided materials and are not yet available.