ccx README

项目的 README,来自 github.com/BenedictKing/ccx。合并为一个 markdown 文件:README.md。

Claude / OpenAI Chat / OpenAI Images / OpenAI Embeddings / Codex Responses / Gemini API Proxy - CCX

English | 简体中文

GitHub release License: MIT

CCX is a high-performance AI API proxy and protocol translation gateway for Claude, OpenAI Chat, OpenAI Images, OpenAI Embeddings, Codex Responses, and Gemini. It provides a unified entrypoint, built-in web administration, channel orchestration, failover, multi-key management, and model routing.

Features

Sponsor

Screenshots

Channel Orchestration

Visual channel management with drag-and-drop priority adjustment and real-time health monitoring.

Channel Orchestration

Add Channel

Supports multiple upstream service types and flexible API key, model mapping, and request parameter configuration.

Add Channel

Traffic Stats

Real-time monitoring of per-channel request traffic, success rate, and latency.

Traffic Stats

Architecture

CCX exposes one backend entrypoint:

Client -> backend :3000 ->
  |- /                            -> Web UI
  |- /api/*                       -> Admin API
  |- /v1/messages                 -> Claude Messages proxy
  |- /v1/chat/completions         -> OpenAI Chat proxy
  |- /v1/responses                -> Codex Responses proxy
  |- /v1/images/{...}             -> OpenAI Images proxy
  |- /v1/embeddings               -> OpenAI Embeddings proxy
  |- /v1/models                   -> Models API
  `- /v1beta/models/*             -> Gemini proxy

Images endpoints currently include:

See ARCHITECTURE.md for the detailed design.

Quick Start

Option 0: CCX Desktop

CCX Desktop provides a native desktop experience with GUI for managing channels, keys, and agent configuration.

Platform Install Method Notes
Windows Search CCX Desktop in Microsoft Store Recommended. Auto-update, no manual signing. Also available as setup.exe from GitHub Releases.
macOS brew tap BenedictKing/ccx && brew install --cask ccx-desktop Or download .dmg (arm64/amd64) from GitHub Releases.
Linux Download .AppImage from GitHub Releases Mark as executable and run.

See CCX Desktop Guide for detailed setup instructions.

Option 1: Binary

  1. Download the latest binary from Releases.
  2. Create a .env file next to the binary:
PROXY_ACCESS_KEY=your-proxy-access-key
PORT=3688
ENABLE_WEB_UI=true
APP_UI_LANGUAGE=en
  1. Run the binary and open http://localhost:3000

On Windows, if the client runs from cmd, PowerShell, WSL, or Docker and localhost does not reach CCX, use the Windows host IPv4 address instead, for example http://192.168.1.23:3000. When BIND_HOST is empty, CCX listens on all interfaces by default through :PORT; set BIND_HOST=127.0.0.1 for local-only access.

For background startup without Docker, see Service Startup.

Option 2: Docker

docker run -d \
  --name ccx \
  -p 3000:3000 \
  -e PROXY_ACCESS_KEY=your-proxy-access-key \
  -e APP_UI_LANGUAGE=en \
  -v $(pwd)/.config:/app/.config \
  crpi-i19l8zl0ugidq97v.cn-hangzhou.personal.cr.aliyuncs.com/bene/ccx:latest

Run in the background with Docker Compose:

docker compose up -d

Enable Watchtower auto-update:

docker compose -f docker-compose.yml -f docker-compose.watchtower.yml up -d

Pull the latest image immediately after setup if needed:

docker compose pull ccx
docker compose up -d ccx

Option 3: Build From Source

Prerequisites: Go 1.25+, Bun, and Make (macOS: xcode-select --install).

git clone https://github.com/BenedictKing/ccx
cd ccx
cp backend-go/.env.example backend-go/.env
make install   # install all dependencies (frontend + Go modules + dev tools)
make run

Useful commands:

make dev
make run
make build
make frontend-dev

Core Environment Variables

PORT=3688
ENV=production
ENABLE_WEB_UI=true
PROXY_ACCESS_KEY=your-proxy-access-key
ADMIN_ACCESS_KEY=your-admin-secret-key
APP_UI_LANGUAGE=en
LOG_LEVEL=info

Main Endpoints

Development

Recommended local workflow:

make dev

Frontend only:

cd "frontend"
bun install
bun run dev

Backend only:

cd "backend-go"
make dev

Additional Docs

Community

Join the QQ group for discussion: 642217364

QQ Group QR Code

Star History

Star History Chart

License

MIT

ccx (BenedictKing/ccx)

正在搜索数据库…

这是什么?CCX 是一个高性能的 AI API 代理和协议转换网关,位于 Claude、OpenAI Chat、OpenAI Images、OpenAI Embeddings、Codex Responses 和 Gemini API 之前,为你提供统一的入口。
这只是一个反向代理,还是除了转发请求还有别的功能?它是一个协议转换网关:除了转发请求,还能进行渠道编排、故障转移、多密钥轮换和模型路由,并带有内置的网页管理控制台,可以统一管理这一切。
怎么把它跑起来?最简单的方式是使用 CCX Desktop(Windows 上的 Microsoft Store,macOS 上的 Homebrew cask 或 .dmg,Linux 上的 .AppImage)。也可以下载发布的可执行文件,在旁边创建 .env 文件后运行,或者用 Docker Compose 部署。
仅仅是运行它也需要安装 Go 或 Docker 吗?不需要,预构建的二进制文件和桌面应用都可以独立运行;只有选择从源码构建时才需要 Go 1.25+、Bun 和 Make。
在 Windows 上从 Docker 或 WSL 连接它有什么坑吗?如果你在 Windows 上的不同环境(cmd、PowerShell、WSL、Docker)中分别运行 CCX 和客户端,localhost 可能无法访问服务器;你需要改用 Windows 宿主机的 IPv4 地址。
CCX Desktop 支持哪些平台?CCX Desktop 可用于 Windows(Microsoft Store 或 setup.exe)、macOS(Homebrew cask 或 .dmg,支持 arm64/amd64)和 Linux(.AppImage)。
为什么需要两个不同的访问密钥?CCX 支持双密钥认证:PROXYACCESSKEY 供调用代理的客户端使用,可选的 ADMINACCESSKEY 供网页管理控制台使用,这样 API 使用者和管理员就可以分开管理。
渠道编排具体控制什么?它可以让你把多个上游 API 密钥/提供商注册为带有优先级、晋升窗口、健康检查和自动故障转移的“渠道”,此外还有上下文感知路由,会根据模型的上下文窗口和最大输出能力选择渠道。
CCX 运行后会暴露哪些端点?它提供 Claude Messages(/v1/messages)、OpenAI Chat(/v1/chat/completions)、Codex Responses(/v1/responses)、OpenAI Images/Embeddings 以及 Gemini 的 generateContent 端点,还有 Models API 和健康检查,全部通过同一个端口提供。
能自动更新 Docker 部署吗?可以,CCX 的 Docker Compose 部署支持 Watchtower 自动更新镜像,你也可以在安装后手动拉取最新镜像。
大小
33.4 MB
星标
4K
时长
10个月
提交 · 90 天