CLIProxyAPI README

The project's README from github.com/router-for-me/CLIProxyAPI. As one markdown file: README.md.

CLI Proxy API

English | 中文 | 日本語

If you want to use CLIProxyAPI on your desktop, we recommend our EasyCLIProxyAPI desktop client. It provides a graphical configuration UI, automatic updates, system tray integration, and one-click start/stop for the CLIProxyAPI service.

CLIProxyAPI is a proxy server that provides OpenAI/Gemini/Claude/Codex/Grok compatible API interfaces for CLI.

You can access the following providers locally and with multiple CLI accounts through any OpenAI (including Responses), Gemini (including Interactions), or Claude-compatible client or SDK.

Provider Description
Kimi Kimi series models (Kimi K3, Kimi K2.7 Code, etc.). Kimi K3 is Moonshot AI’s most capable model and the world’s first open 3T-class model. With 2.8 trillion parameters, native vision, and a 1-million-token context window, K3 is built for long-horizon coding, knowledge work, and reasoning. CLIProxyAPI supports Kimi through OAuth or compatible API interfaces. Try the Kimi Code subscription, or get an API key from the Kimi Open Platform. Thanks to Kimi for supporting CLIProxyAPI and the open-source community!
OpenAI OpenAI GPT series models (GPT 5.6, GPT 5.5, etc.). GPT-5.6 sets a new quality and efficiency baseline for complex production workflows. GPT-5.6 is especially token-efficient and improves frontend aesthetics, including layout, visual hierarchy, and design judgment.
Anthropic Anthropic Claude series models (Claude Fable, Claude Opus, Claude Sonnet, etc.). Claude Fable 5 is Anthropic's most capable widely released model, built for the most demanding reasoning and long-horizon agentic work.
Antigravity Google Gemini series models (Gemini 3.5 Flash, Gemini 3.1 Pro, etc.). Gemini 3.5 Flash provides sustained frontier-level intelligence optimized for real-world tasks at a higher speed and lower cost. Designed for the agentic era, it excels at sub-agent deployment, multi-step workflows, and long-horizon tasks at scale. This model is particularly effective for rapid agentic loops involving complex coding cycles and iterations.
xAI xAI Grok series models (Grok 4.5, Grok Composer 2.5 Fast, etc.). Grok 4.5 is SpaceXAI's frontier model built for coding, agentic tasks, and knowledge work. It was trained in SpaceXAI's data centers in Memphis with new datasets spanning science, engineering, and math.

Sponsor

https://www.packyapi.com/register?aff=cliproxyapi

Thanks to PackyCode for sponsoring this project!

PackyCode is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more.

PackyCode provides special discounts for our software users: register using this link and enter the "cliproxyapi" promo code during recharge to get 10% off.


AICodeMirror Thanks to AICodeMirror for sponsoring this project! AICodeMirror provides official high-stability relay services for Claude Code / Codex / Gemini, with enterprise-grade concurrency, fast invoicing, and 24/7 dedicated technical support. Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original price, with extra discounts on top-ups! AICodeMirror offers special benefits for CLIProxyAPI users: register via this link to enjoy 20% off your first top-up, and enterprise customers can get up to 25% off!
APIKEY.FUN Thanks to APIKEY.FUN for sponsoring this project! APIKEY.FUN is a professional enterprise-grade AI relay platform dedicated to providing stable, efficient, and low-cost AI model API access for enterprises and individual developers. The platform supports popular mainstream models such as Claude, OpenAI, and Gemini, with prices as low as 7% of the official price. Register through this project's exclusive link to enjoy a special permanent 5% top-up discount.
RunAPI RunAPI is an efficient and stable API platform—an alternative to OpenRouter. A single API Key gives you access to 150+ leading models, including OpenAI, Claude, Gemini, DeepSeek, Grok, and more, at prices as low as 10% of the original (up to 90% off), with exceptional stability. It's seamlessly compatible with tools like Claude Code, OpenClaw, and others. RunAPI offers an exclusive perk for CPA users: register and contact an administrator to claim ¥7 in free credit.
CyberPay CyberPay was founded in 2021. We are committed to providing stable, efficient, and secure payment settlement solutions for AI industry merchants. Working with us helps your website platform solve Alipay and WeChat payment collection needs. We support business cooperation for selling GPT, Gemini, Claude, and Codex accounts, relay platforms, and other related services, helping merchants address payment collection challenges. Contact us to start your path to growth.
FennoAI FennoAI is a stable and efficient API relay service provider, currently focused on Codex relay services. It is compatible with OpenAI and Anthropic protocols and can flexibly integrate with mainstream coding tools such as Codex, Claude Code, and OpenCode. It can reliably support enterprise-grade demand of hundreds of billions of tokens per day, with B2B settlement and invoicing available for both domestic and overseas entities. FennoAI offers an exclusive benefit for CLIProxyAPI users: purchase a subscription through the exclusive link and receive $50 worth of Coding Plan credits for just $1.99. Referral rewards are also available: earn up to 20% commission when invited friends make a purchase. The more friends you invite, the greater the rewards.
Qiniu Cloud AI Thanks to Qiniu Cloud AI for sponsoring this project! Qiniu Cloud AI is an enterprise-grade large-model MaaS platform under Qiniu Cloud (02567.HK). It provides one-stop access to 150+ mainstream global models, is compatible with protocols from major global model providers, and covers full-modal processing capabilities for text, image, audio, video, and files. It serves more than 1.69 million enterprise and developer users. Exclusive benefits: enterprise users can claim 12 million free tokens, and invite friends to earn up to tens of billions of tokens.
Cubence Thanks to Cubence for sponsoring this project! Cubence is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more. Cubence provides special discounts for our software users: register using this link and enter the "CLIPROXYAPI" promo code during recharge to get 10% off.
FastAIToken Thanks to FastAIToken for sponsoring this project! FastAIToken is an AI API aggregation platform built for developers, focused on speed and stability. It supports leading AI models including OpenAI, Claude, Gemini, and more. With a 1:1 recharge ratio (¥1 = $1 in API credits), developers can access the world's top AI models at lower cost and with greater convenience. Telegram Support Group
The platform offers multiple channels to suit different needs: an ultra-low-cost 0.02× OpenAI promotional tier (limited time), OpenAI channels starting from 0.25×, 0.7× Claude with 95% fixed cache, and 1.2× Claude Max channels. It also provides a public status page displaying real-time availability, latency, and operational status for every channel, ensuring transparent and reliable service. In addition, FastAIToken offers 24/7 human technical support (no bots) for rapid response to developers' needs. For enterprise customers, dedicated SLA-backed channel pools are available with guaranteed stability, contract support, invoicing, and dedicated maintenance.
Bestproxy Bestproxy provides high-purity residential IPs with dedicated one-IP-per-account support. 🟡Residential Proxy - $0.5/GB;🟡Static Residential Proxy - Starting at $3/IP;🟡Unlimited Residential Proxy - Starting at $67/Day. ✅Get Free Trial.
APIMart Thanks to APIMart for sponsoring this project! APIMart is a low-cost API platform for AI image & video generation — GPT-Image-2 from $0.006/image, 160+ images per dollar. One async API covers both image and video: submit a task, get an ID, fetch results via polling or callback. Batch tens of thousands of images without timeouts, switch models without changing code. Pay-as-you-go with no monthly fee — sign up here to get started.
AxisNow Protect and accelerate websites and APIs while optimizing access from both mainland China and the rest of the world. Extend acceleration and security to native and mobile apps through client SDKs — self-hosted private CDN | subscription-based DDoS-protected CDN | independently controlled, flexibly composable CDN networks.
Swiftproxy Swiftproxy provides 90M+ clean residential IPs across 220+ locations, supporting HTTP(S)/SOCKS5, IP rotation, Sticky Sessions, and precise location targeting. It helps AI API tools and automation workflows access online services reliably from different locations, making it ideal for API requests, web access, data collection, and location-based testing. Residential proxies from $0.7/GB. Free testing is available, with 10% off using code PROXY90. Try Swiftproxy Now
Aiberm This project is sponsored by Aiberm — a unified, discounted AI API for developers. One endpoint for Claude, GPT, Grok, DeepSeek, GLM, Kimi, and MiniMax: 85–90% off Claude, 90% off GPT, and 80% off Grok. Image generation included, with GPT Image 2 and Nano Banana. Visit Aiberm.

Overview

Getting Started

CLIProxyAPI Guides: https://help.router-for.me/

Management API

see MANAGEMENT_API.md

Usage Statistics

Since v6.10.0, CLIProxyAPI and CPAMC no longer ship built-in usage statistics. If you need usage statistics, use:

CPA Usage Keeper

Standalone persistence and visualization service for CLIProxyAPI, with periodic data sync, SQLite storage, aggregate APIs, and a built-in dashboard for usage and statistics.

CPA-Manager-Plus

Full CLIProxyAPI management center with request-level monitoring and cost estimates. CPA-Manager tracks collected requests by account, model, channel, latency, status, and token usage; estimates cost with editable model prices and one-click LiteLLM price sync; persists events in SQLite; and provides Codex account-pool operations with batch inspection, quota detection, unhealthy account discovery, cleanup suggestions, and one-click execution for day-to-day multi-account maintenance.

SDK Docs

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Who is with us?

Those projects are based on CLIProxyAPI:

vibeproxy

Native macOS menu bar app to use your Claude Code & ChatGPT subscriptions with AI coding tools - no API keys needed

Subtitle Translator

A cross-platform desktop and web app to translate and validate SRT subtitles using your existing LLM subscriptions (Gemini, ChatGPT, Claude, etc.) via CLIProxyAPI - no API keys needed.

CCS (Claude Code Switch)

CLI wrapper for instant switching between multiple Claude accounts and alternative models (Gemini, Codex, Antigravity) via CLIProxyAPI OAuth - no API keys needed

Quotio

Native macOS menu bar app that unifies Claude, Gemini, OpenAI, and Antigravity subscriptions with real-time quota tracking and smart auto-failover for AI coding tools like Claude Code, OpenCode, and Droid - no API keys needed.

ProxyPilot

Windows-native CLIProxyAPI fork with TUI, system tray, and multi-provider OAuth for AI coding tools - no API keys needed.

Claude Proxy VSCode

VSCode extension for quick switching between Claude Code models, featuring integrated CLIProxyAPI as its backend with automatic background lifecycle management.

ZeroLimit

Windows desktop app built with Tauri + React for monitoring AI coding assistant quotas via CLIProxyAPI. Track usage across Gemini, Claude, OpenAI Codex, and Antigravity accounts with real-time dashboard, system tray integration, and one-click proxy control - no API keys needed.

CPA-XXX Panel

A lightweight web admin panel for CLIProxyAPI with health checks, resource monitoring, real-time logs, auto-update, request statistics and pricing display. Supports one-click installation and systemd service.

CLIProxyAPI Tray

A Windows tray application implemented using PowerShell scripts, without relying on any third-party libraries. The main features include: automatic creation of shortcuts, silent running, password management, channel switching (Main / Plus), and automatic downloading and updating.

霖君

霖君 is a cross-platform desktop application for managing AI programming assistants, supporting macOS, Windows, and Linux systems. Unified management of Claude Code, Gemini, OpenAI Codex, and other AI coding tools, with local proxy for multi-account quota tracking and one-click configuration.

CLIProxyAPI Dashboard

A modern web-based management dashboard for CLIProxyAPI built with Next.js, React, and PostgreSQL. Features real-time log streaming, structured configuration editing, API key management, OAuth provider integration for Claude/Gemini/Codex, usage analytics, container management, and config sync with OpenCode via companion plugin - no manual YAML editing needed.

All API Hub

Browser extension for one-stop management of New API-compatible relay site accounts, featuring balance and usage dashboards, auto check-in, one-click key export to common apps, in-page API availability testing, and channel/model sync and redirection. It integrates with CLIProxyAPI through the Management API for one-click provider import and config sync.

Shadow AI

Shadow AI is an AI assistant tool designed specifically for restricted environments. It provides a stealthy operation mode without windows or traces, and enables cross-device AI Q&A interaction and control via the local area network ( LAN). Essen

CLIProxyAPI (router-for-me/CLIProxyAPI)

Searching Database…

What is this?CLIProxyAPI is a proxy server that exposes OpenAI, Gemini, Claude, and Grok compatible API endpoints, letting you access CLI-based AI accounts (Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin) through any standard OpenAI/Gemini/Claude-compatible client or SDK.
Is this a standalone server, or do I need a client app too?It's a Go server/SDK you run yourself; there's also an optional desktop client (EasyCLIProxyAPI) for a GUI config, auto-updates, tray icon, and one-click start/stop.
How do I get it running?Run it as a Docker container (a docker-compose setup is provided) or build/run the Go binary directly, then point your OpenAI/Gemini/Claude-compatible client at its local endpoint and authenticate each provider via its CLI OAuth flow.
What do I need to authenticate with each provider?You log in through each provider's own CLI OAuth flow (Gemini, OpenAI, Claude, Grok) rather than supplying separate API keys, though it also supports a Generative Language API key and OpenAI-compatible upstream providers via config.
Is usage tracking still built in?No — since v6.10.0 CLIProxyAPI no longer ships built-in usage statistics; you need a separate companion tool like CPA Usage Keeper or CPA-Manager-Plus for dashboards and cost tracking.
Does it support multiple accounts per provider?Yes, it supports multiple accounts per provider with round-robin load balancing for Gemini, OpenAI, Claude, and Grok, which is useful for teams or heavy usage hitting rate limits.
Can I embed this in my own application instead of running it as a service?Yes, it ships a reusable Go SDK for embedding the proxy directly into other software, documented in docs/sdk-usage.md along with advanced executors/translators and custom provider examples.
Which response modes does it support?It supports streaming, non-streaming, and WebSocket responses where the underlying provider allows it, plus function calling/tools and multimodal (text and image) input.
Are there other tools built on top of CLIProxyAPI?Yes, community projects like vibeproxy (macOS menu bar app), Subtitle Translator, CCS, Quotio, ProxyPilot, Claude Proxy VSCode, and ZeroLimit all use CLIProxyAPI as their backend to avoid needing raw API keys.
Can I route through third-party relay/API providers instead of OAuth logins?Yes, it supports OpenAI-compatible upstream providers configured directly, such as OpenRouter or various sponsor relay services mentioned in the README.
Size
43.2 MB
Stars
55.5K
Age
1y
Commits · 90 Days