项目地址

GitHub:https://github.com/router-for-me/CLIProxyAPI
文档:https://help.router-for.me/cn/

环境准备

确保服务器已安装:

  • Docker

  • Docker Compose

部署 CLIProxyAPI

创建目录

mkdir -p cli-proxy-api && cd cli-proxy-api

下载配置文件

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

修改 config.yaml 配置

1️⃣ 开启远程管理

remote-management:
  allow-remote: true

2️⃣ 设置登录密钥

remote-management:
  secret-key: "123456"

3️⃣ 设置 API 密钥

api-keys:
  - "your-api-key-1"

其他配置可根据文档自行修改

创建 docker-compose.yml

services:
  cli-proxy-api:
    image: eceasy/cli-proxy-api:latest
    container_name: cli-proxy-api
    ports:
      - "8317:8317"
    volumes:
      - ./config.yaml:/CLIProxyAPI/config.yaml
      - ./auths:/root/.cli-proxy-api
      - ./logs:/CLIProxyAPI/logs
    restart: unless-stopped

启动并访问

docker compose up -d

访问 http://你的服务器IP:8317/management.html