BenedictKing/ccx is an AI API proxy and protocol-translation gateway that provides one entry point for Claude, OpenAI, Codex Responses, Gemini, and other listed APIs. It is used to manage provider channels, keys, routing, monitoring, and failover, and the catalogue entries provide skills and instructions for operating it.
Borrowing it
Nothing to install: this file belongs to BenedictKing/ccx. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/BenedictKing/ccx/main/AGENTS.mdgit clone --depth 1 https://github.com/BenedictKing/ccxWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/benedictking/ccx/agents-md)<a href="https://agentmods.dev/instructions/benedictking/ccx/agents-md"><img src="https://agentmods.dev/badge/instructions/benedictking/ccx/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/benedictking/ccx/agents-md"><img src="https://agentmods.dev/badge/instructions/benedictking/ccx/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01424 | $0.01424 |
| Opus 5.5 | $0.00570 | $0.00570 |
| Sonnet 5.5 | $0.00285 | $0.00285 |
| Haiku 4.5 | $0.00142 | $0.00142 |
Grade A, and why
ccx AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 28d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
仓库协作指南
重要约定
- 始终使用简体中文回复。
- 遵循 SOLID / KISS / DRY / YAGNI;优先修复根因,避免无关重构。
- 禁止停止或杀掉本项目正在运行的服务进程;默认用户已通过开发命令启动服务,如需让代码生效,只能提示用户手动重启或使用用户明确指定的安全方式。
- 修改文档时,优先以以下文件为事实源:
VERSION、Makefile、backend-go/Makefile、frontend/package.json、backend-go/main.go。
项目概览
- CCX 是一个多上游 AI API 代理与协议转换网关,当前正式支持六类渠道:
messages、chat、responses、gemini、images、vectors。 - 根目录
VERSION是唯一发布版本源;后端构建时通过backend-go/Makefile的-ldflags注入运行时版本信息。
项目结构与模块
backend-go/:主 Go 服务(Gin),负责路由、认证、调度、协议转换、指标与日志;前端构建产物嵌入到backend-go/frontend/dist/。frontend/:Vue 3 + Vite + Vuetify 管理界面。dist/:发布构建产物,禁止手动编辑。.config/:运行时配置与持久化目录(如config.json、metrics.db、backups/)。refs/:外部参考项目存档,仅供对照,默认只读。- 文档入口:
README.md、README.zh-CN.md、backend-go/README.md、docs/guide/architecture.md、docs/guide/development.md、docs/guide/environment.md、docs/guide/release.md。
构建 / 测试 / 开发命令
- 全栈开发(推荐):根目录
make dev(前端bun run dev+ 后端air热重载)。 - 根目录常用命令:
make run、make build、make frontend-dev、make clean。 - 仅后端:
cd backend-go && make dev|run|build|test|test-cover|fmt|lint|deps。 - 后端本地构建:
cd backend-go && make build-local。 - 前端:
cd frontend && bun install后执行bun run dev|build|preview|type-check|lint。 - Docker:
docker-compose up -d用于接近生产环境的验证。
代码风格
- Go:保持包职责单一、接口清晰;修改后运行
go fmt ./...。 - 前端:遵循现有 Vuetify / TypeScript / Prettier 风格;保持 strict 类型约束。
- 不要手动编辑生成产物:
dist/、frontend/dist/、backend-go/frontend/dist/。 - 配置/密钥:
.env/.json只提交示例文件或文档化内容,禁止提交真实密钥。
路由与能力边界
- 实际代理与管理路由以
backend-go/main.go为准。 - 常见代理入口包括:
/v1/messages/v1/chat/completions/v1/responses/v1/images/generations/v1/images/edits/v1/images/variations/v1/embeddings/v1beta/models/*/v1/alpha/*(Codex 记忆层 history/notes 透传,粘 Responses 渠道池;上游未实现时如实透传错误)
- 管理入口统一位于
/api/{type}/channels/*。 - 能力测试当前只适用于
messages、chat、responses、gemini;不要假设images或vectors具备 capability-test。 - 渠道保活验证位于
backend-go/internal/healthcheck/:L1(带 key 拉模型列表)六类渠道通用,L2(最便宜模型的普通真实调用)仅messages、chat、responses、gemini;配置为全局/渠道级healthCheck,频率硬下限 30 分钟;管理端点GET /api/{type}/channels/:id/health与POST /api/{type}/channels/:id/health/check。 - 上游余额探测位于
backend-go/internal/balanceprobe/(探测器在internal/upstreamprobe/balance.go):用渠道 key 查上游剩余额度(auto/newapi_token/sub2api/newapi_billing),六类渠道通用;配置为全局/渠道级balanceCheck,newapi 订阅托管渠道默认开启 auto,间隔硬下限 30 分钟;结果落key_health(check_kind=balance)并聚合写配额真相 provider_api 级参与调度;管理端点GET /api/{type}/channels/:id/balance与POST /api/{type}/channels/:id/balance/check。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 28d ago Changed · +1 lines · +154 tokens per session 0d49a38529d2
- 1mo ago Changed · +1 lines · +42 tokens per session a138111e48a9
- 2mo ago First seen · 60 lines · 1,228 tokens per session scan A ebe6995470ad
ccx AGENTS.md is an instructions file published in the GitHub repository BenedictKing/ccx (3,983 stars, last pushed 3d ago), licensed MIT. It adds 1,424 tokens to every session, about $0.0057 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
ccx AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ccx AGENTS.mdBenedictKing/ccx | Instructions file | 4.0k | 3d ago | MIT | A | 1,424 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |