name: setup description: 当用户遇到 “ccproxy not found”、“LiteLLM 连接失败”、“localhost:4000 拒绝连接”、“OAuth 失败”、“代理未运行” 或需要帮助配置 ccproxy/LiteLLM 集成时,应使用此技能。
ccproxy-tools 设置
运行 /ccproxy-tools:setup 来配置 ccproxy/LiteLLM。
快速修复
- ccproxy/litellm not found - 使用
uv tool install 'litellm[proxy]' 'ccproxy'安装 - Connection refused localhost:4000 - 启动代理:
ccproxy start或litellm --config ~/.litellm/config.yaml - OAuth failed - 重新运行
ccproxy init并通过浏览器认证 - Invalid model name - 检查
.claude/settings.json中的模型名称是否与 LiteLLM 配置匹配 - Changes not applied - 更新设置后重启 Claude Code
环境变量
关键设置在 .claude/settings.json → env:
| 变量 | 用途 |
|---|---|
ANTHROPIC_BASE_URL |
代理端点 (http://localhost:4000) |
ANTHROPIC_AUTH_TOKEN |
代理的认证令牌 |
ANTHROPIC_DEFAULT_OPUS_MODEL |
Opus 模型名称 |
ANTHROPIC_DEFAULT_SONNET_MODEL |
Sonnet 模型名称 |
ANTHROPIC_DEFAULT_HAIKU_MODEL |
Haiku 模型名称 |
检查代理健康
curl http://localhost:4000/health
资源
- ccproxy: https://github.com/starbased-co/ccproxy
- LiteLLM: https://docs.litellm.ai