# AI Proxy

企業在導入 LLM 時，可能會用到多種不同的模型，這些包含商用授權與開源授權以及來自不同的服務商。為了統一管理及開發應用這些各類不同模型，建議使用 AI Proxy (AI API Gateway) 這類平台來解決，以達到下列目的：

- 統一 API 介接入口與格式
- 成本追蹤
- 平衡負載

#### LiteLLM

- Doc: [https://docs.litellm.ai/docs/simple\_proxy](https://docs.litellm.ai/docs/simple_proxy)
- GitHub: [https://github.com/BerriAI/litellm](https://github.com/BerriAI/litellm)

#### CLI Proxy API

僅適合個人用；沒有 API 用量限制、ACL 權限及多帳號等管理功能，所以不適合企業用。

- GitHub: [https://github.com/router-for-me/CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)
- Doc: [CLIProxyAPI](https://help.router-for.me/)
- [基于docker搭建CLIProxyAPI图文教程 - 文档共建 - LINUX DO](https://linux.do/t/topic/1672081)
- [手把手带你用上AI神器 - CLIProxyAPI（零：配置详细解说） - 资源荟萃 - LINUX DO](https://linux.do/t/topic/1011966)
- CLIProxyAPI Plus 
    - GitHub: [https://github.com/router-for-me/CLIProxyAPIPlus](https://github.com/router-for-me/CLIProxyAPIPlus)
    - YT: [【2026最新】零成本无限调用GPT-5.3高级模型！ChatGPT免费额度+CLIProxyAPIPlus 完整部署教程 - YouTube](https://www.youtube.com/watch?v=sLjTilvm2RQ)

##### Installation

```bash
mkdir cli-proxy-api-plus
cd cli-proxy-api-plus

curl -o config.yaml https://raw.githubusercontent.com/router-for-me/CLIProxyAPIPlus/main/config.example.yaml

mv config.example.yaml config.yaml
```

Edit: config.yaml

- 控制台登入時需要輸入 YOU-MANAGEMENT-KEY。
- NOTE: 服務啟動後，YOU-MANAGEMENT-KEY 會轉換成雜湊值（Hash），所以需手動記下。

```yaml
remote-management:
  allow-remote: true
  secret-key: YOUR-MANAGEMENT-KEY
```

Edit: docker-compose.yaml

```yaml
services:
  cli-proxy-api:
    image: ${CLI_PROXY_IMAGE:-eceasy/cli-proxy-api-plus:latest}
    container_name: cli-proxy-api-plus 
    ports:
      - "8317:8317" 
    volumes:
      - ${CLI_PROXY_CONFIG_PATH:-./config.yaml}:/CLIProxyAPI/config.yaml
      - ${CLI_PROXY_AUTH_PATH:-./auths}:/root/.cli-proxy-api
      - ${CLI_PROXY_LOG_PATH:-./logs}:/CLIProxyAPI/logs
    environment:
      - TZ=Asia/Taipei
    restart: unless-stopped

```

Start the service

```bash
docker compose up -d
```

Management UI: *http://your.server.ip:8317/management.html*

#### Sub2API

- GitHub: [https://github.com/Wei-Shaw/sub2api](https://github.com/Wei-Shaw/sub2api)
- [基于docker搭建sub2api图文教程 - 文档共建 - LINUX DO](https://linux.do/t/topic/1672075/6)
- [\[龙虾教程\] 自建Sub2API中转站管理多个AI账号 方便集中管理/好友共享/快速切换 - 蓝点网](https://www.landiannews.com/archives/112080.html)

#### New API

一個用於彙整與分發的統一 AI 模型中心 (AI Model Hub)。它支援將各種大型語言模型（LLM）相互轉換為相容於 OpenAI、Claude 或 Gemini 的格式。這是個人與企業模型管理的集中式入口。

- [New API - AI 基座](https://www.newapi.ai/zh)
- [https://github.com/QuantumNous/new-api](https://github.com/QuantumNous/new-api)
- [Token 太贵？0 门槛自建一个 AI Token 中转站 - YouTube](https://www.youtube.com/watch?v=rZxsVlnj1P8)

#### 9Router

9Router is a smart gateway between your tools (Cursor, Claude Code, Codex, Cline, Copilot…) and 60+ AI providers.

- [9Router - Free AI Router | Smart Fallback for Claude, Codex &amp; More](https://9router.com/)
- [https://github.com/decolua/9router](https://github.com/decolua/9router)

#### Audit Tools

- [API Relay Audit](https://github.com/toby-bridges/api-relay-audit)
- [hvoy](https://hvoy.ai/)
- [CCTest](https://cctest.ai/zh)