Claude Code Router / CCS
Claude Code Router 和 CCS 用来把 Claude Code 的 Anthropic 请求转发到自定义服务。接 Enodot 时,使用 Anthropic 兼容地址:
text
https://ai.enodot.shop你需要准备
- Enodot API Key。
- 一个支持 Anthropic 协议的分组,或默认聚合路由。
- 一个可用模型,例如
claude-opus-4-7。
通用配置项
不同 Router 的配置文件字段名可能不同,但含义基本一致:
| 字段 | 填写 |
|---|---|
| Provider | anthropic 或 custom-anthropic |
| Base URL / API URL | https://ai.enodot.shop |
| API Key | 你的 Enodot API Key |
| Model | claude-opus-4-7 |
| Small / Fast Model | claude-haiku-4-5-20251001 |
| Reasoning Model | claude-opus-4-7 |
配置示例
如果工具使用 JSON 配置,可以按这个结构理解:
json
{
"providers": [
{
"name": "enodot-anthropic",
"type": "anthropic",
"baseURL": "https://ai.enodot.shop",
"apiKey": "你的 Enodot API Key",
"models": [
"claude-opus-4-7",
"claude-haiku-4-5-20251001",
"claude-sonnet-4-6"
]
}
]
}如果工具要求把请求路径写全,填写:
text
https://ai.enodot.shop/v1/messages否则只填主地址:
text
https://ai.enodot.shop自测
配置 Router 前,先用同一个 Key 直接测 Anthropic 入口:
bash
curl https://ai.enodot.shop/v1/messages \
-H "x-api-key: 你的 Enodot API Key" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-7",
"max_tokens": 64,
"messages": [{"role": "user", "content": "只回复 ok"}]
}'排查
- Router 报 404:检查是否把 Base URL 写成了
https://ai.enodot.shop/v1,Anthropic 模式通常不要加/v1。 - Router 报 401:Key 填错,或工具没有把 Key 放进
x-api-key/Authorization。 - Router 报模型不存在:模型名不在当前分组可用范围内。