# claudemore **Repository Path**: opencode-plugin/claudemore ## Basic Information - **Project Name**: claudemore - **Description**: 已失效。 - **Primary Language**: TypeScript - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-21 - **Last Updated**: 2026-09-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # claudemore #### 介绍 claudemore 是 OpenCode 插件,对外注册单个 provider(id: claudemore,name: Claude),内部将请求路由到 3 家第三方 Claude 中转提供商,实现多提供商 + 多 API Key 双层轮询。用户只需在 OpenCode 界面看到一个 claudemore provider,即可享受 3 家提供商的额度池和容错能力。 #### 特色 - 单 provider 统一入口:OpenCode 界面只看到一个 claudemore,简化配置 - 多提供商 + 多 API Key 双层轮询:提供商间 round-robin + 提供商内 key round-robin - 支持只填部分提供商:有几家用几家,至少填一家即可使用 - thinking 模型自动注入思考参数,支持 reasoning_content 思考内容 - 注册即送额度,多家额度池合并使用,提升可用性 - 自动容错:某提供商所有 key 失败(errorCount ≥ 3)自动跳过,全部失败重置计数重试 #### 支持的提供商(注册送额度) | 提供商 | baseUrl | 注册额度 | 计费方式 | 获取 API Key | 注册邀请链接 | |--------|---------|----------|----------|--------------|--------------| | justwoker | https://api.justwoker.icu/v1 | $120 | 按量计费 | https://api.justwoker.icu/keys | https://api.justwoker.icu/sign-up?aff=Mglv | | gorouter | https://gorouter.app/v1 | $70 | 按次计费 | https://gorouter.app/keys | https://gorouter.app/sign-up?aff=DjzO | | tabitoken | https://tabitoken.com/v1 | $120 | 按次计费 | https://tabitoken.com/keys | https://tabitoken.com/sign-up?aff=e2iDv | #### 支持的模型 | 模型别名(OpenCode 显示) | 上游模型 id | 上下文 | 最大输出 | |---------------------------|-------------|--------|----------| | claude-opus-4.8 | claude-opus-4-8 | 1048576 | 131072 | | claude-opus-4.8-thinking | claude-opus-4-8-thinking | 1048576 | 131072 | | claude-opus-5 | claude-opus-5 | 1048576 | 131072 | | claude-opus-5-thinking | claude-opus-5-thinking | 1048576 | 131072 | 所有模型均支持 vision(图像输入)和 reasoning(思考能力)。thinking 后缀模型会自动注入 `thinking: { type: 'enabled' }` 参数,返回 `reasoning_content` 思考内容。 #### 安装 1. 克隆项目: ```bash git clone cd claudemore ``` 2. 安装依赖并构建: ```bash npm install npm run build ``` 3. 在 opencode.json 配置插件(指向 claudemore/dist/index.js): ```json { "plugins": [ "E:/work/nreg/ai-provider/claudemore" ] } ``` #### 使用说明 1. **授权配置**: - 运行 OpenCode 授权命令(如 `opencode connect`) - 按顺序输入 3 家提供商 API Keys(justwoker → gorouter → tabitoken) - 每家可输入多个 API Key,用逗号分隔 - 可跳过不需要的提供商,但至少填一家 2. **开始对话**: - 在 OpenCode 中选择 claude-opus-4.8 等模型 - 请求自动在已配置的提供商与 key 之间轮询 3. **凭证存储**: - 凭证按提供商分组存储在 `%USERPROFILE%\.claudemore\auth.json` - 支持跨会话持久化,无需重复授权 #### 轮询与容错机制 **双层轮询**: - 提供商间轮询:justwoker → gorouter → tabitoken → justwoker(循环) - 提供商内 key 轮询:key1 → key2 → key3 → key1(循环) **容错逻辑**: - 某个 key 请求失败,errorCount + 1 - 某提供商所有 key 的 errorCount ≥ 3,跳过该提供商 - 所有提供商的所有 key 都失败,重置所有 errorCount 为 0,重新尝试 - key 与 baseUrl 绑定:每家的 key 只能用于自家的端点 **错误处理**: - 401/403/429:原样返回给 OpenCode,由上层处理 fallback 或重试 - 5xx/网络异常:返回 429 错误流,触发 OpenCode 自动重试 #### 调试 调试日志路径:`%USERPROFILE%\.claudemore\debug.log` 开启方式(任选其一): - 设置环境变量 `DEBUG=1` - 设置环境变量 `OPENCODE_CLAUDEMORE_DEBUG=1` 日志内容包括: - Key 选择与轮询状态 - 请求 URL 替换 - Thinking 参数注入 - 错误追踪与重置 #### 参与贡献 1. Fork 本仓库 2. 新建 Feature 分支(`git checkout -b feature/AmazingFeature`) 3. 提交更改(`git commit -m 'Add some AmazingFeature'`) 4. 推送到分支(`git push origin feature/AmazingFeature`) 5. 提交 Pull Request #### 许可证 本项目采用 MIT 许可证,详见 LICENSE 文件。