Commit Graph

532 Commits

Author SHA1 Message Date
yaogdu
d1bbc71796 feat: 🎸 export csv from web and support hourly TTL of key 2025-09-27 14:11:54 +08:00
shaw
0e724c9901 feat: oai账号增加402适配 2025-09-26 17:29:50 +08:00
shaw
f97db927c0 style: 调整standardGeminiRoutes缩进格式 2025-09-26 10:47:07 +08:00
shaw
25d1c3f74e fix: apikey的服务权限问题修复 2025-09-25 22:51:39 +08:00
shaw
66bb3419b7 fix: 修复oai专属绑定401导致重复触发通知的bug 2025-09-25 22:32:04 +08:00
shaw
c15ef0b6ae feat: 适配codex用量数据 2025-09-25 17:23:52 +08:00
shaw
991dd1436f fix: 修复apikey的服务权限失效问题 2025-09-25 17:23:52 +08:00
shaw
f105b1cc31 fix: 修复codex调度问题 2025-09-25 16:05:56 +08:00
shaw
79fb5fb072 fix: 去除无用参数 2025-09-25 15:08:04 +08:00
shaw
69cf8646e9 fix: cc提示词检测暂时排除haiku模型2 2025-09-25 14:22:36 +08:00
shaw
749ebf0a82 fix: cc提示词检测暂时排除haiku模型 2025-09-25 14:18:16 +08:00
shaw
ad672c3c4c fix: 修复openai-respons计费问题 2025-09-25 11:31:30 +08:00
shaw
54bf1ce49b fix: claude code兼容sdk-cli 2025-09-25 10:10:43 +08:00
shaw
e1a481af46 fix: 修复提示词检测引起的compact失败 2025-09-24 23:22:21 +08:00
shaw
b0077cecd7 fix: 修复s5代理不可用的问题 2025-09-24 19:21:56 +08:00
shaw
0a66609c1b fix: 修复codex限流自动恢复问题 2025-09-24 16:47:55 +08:00
shaw
ad443ea18a fix: 调整Claude Code相似度检测并恢复401处理 2025-09-24 15:04:39 +08:00
千羽
9c3914bf79 feat: enhance Claude Code client detection with similarity matching
- Add string-similarity library for robust prompt comparison
- Extract Claude Code system prompts to separate contents module
- Implement similarity-based validation with configurable thresholds
- Support different validation logic for Haiku vs other Claude models
- Fix validation to properly handle array format system prompts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 11:31:44 +09:00
shaw
24d1f0a494 fix: 修复统一user-agent问题 2025-09-23 17:35:10 +08:00
shaw
303c0c4e15 feat: 增加claude code客户端识别 2025-09-23 16:41:26 +08:00
shaw
5a2199f9a9 fix: claude提示词检测逻辑修复 2025-09-23 16:29:17 +08:00
shaw
0ba048aced feat: 优化专属账号删除逻辑 2025-09-23 15:48:38 +08:00
shaw
86668c3de9 fix:修复1.1.147版本启动问题 2025-09-22 13:53:56 +08:00
shaw
ff73375f0a fix: 优化codex错误抛出 增强客户端限制条件 2025-09-22 11:56:54 +08:00
shaw
f9c397cc1f feat: api-stats页面增加周限总限查询 2025-09-21 14:22:34 +08:00
shaw
588b181eb9 fix: 修复服务账户数量少了response账户 2025-09-20 22:03:43 +08:00
shaw
3628bb2b7a fix: 修复openai输入token计算问题 2025-09-20 21:43:48 +08:00
shaw
08c2b7a444 fix: 修复PR #458中的totalCostLimit功能问题
主要修复:
- 移除重复的totalUsageLimit字段,统一使用totalCostLimit
- 删除auth.js中重复的总费用限制检查逻辑
- 删除admin.js中重复的totalCostLimit验证代码
- 更新所有前端组件,移除totalUsageLimit引用

功能改进:
- 确保totalCostLimit作为永久累计费用限制正常工作
- 与dailyCostLimit(每日重置)功能互补
- 适用于预付费、一次性API Key场景

测试:
- 删除有逻辑错误的test-total-usage-limit.js
- 创建新的test-total-cost-limit.js验证功能正确性
- 所有测试通过,功能正常工作

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 17:37:20 +08:00
itzhan
a929ff4242 chore: fix prettier formatting 2025-09-20 08:27:41 +08:00
itzhan
200149b9ee chore: fix prettier formatting 2025-09-19 22:41:46 +08:00
itzhan
ec28b66e7f feat: 给key增加总用量限制 2025-09-19 21:57:24 +08:00
shaw
6e98c46371 fix: 修复oai代理密码保存问题 2025-09-18 19:47:09 +08:00
shaw
43cfb0f4f3 fix: 修复openai账号代理问题 2025-09-18 17:39:45 +08:00
shaw
f70c3babc9 fix: 修复编辑oai账号是代理IP被错误保存的问题 2025-09-18 10:22:41 +08:00
wfunc
f2dc834bba feat: 新增 telegram 通知 2025-09-16 11:44:39 +08:00
shaw
ae4bbe8253 docs: 更新codex默认模型示例 2025-09-16 10:40:58 +08:00
shaw
51cb92d395 feat: 适配gpt-5-codex模型 2025-09-16 09:01:41 +08:00
shaw
c0d6ecefac fix: 修复限流状态判断逻辑,兼容对象和字符串格式
- 修复 cleanupOpenAIAccounts 方法中 rateLimitStatus 判断问题
- 修复 cleanupClaudeConsoleAccounts 方法中的判断逻辑
- 优化 unifiedOpenAIScheduler 的 _isRateLimited 辅助方法
- 保持原始服务层数据获取方式,通过判断逻辑适配不同数据格式

问题原因:服务层返回的 rateLimitStatus 是对象格式,但清理逻辑使用字符串比较,
导致限流账户无法被正确检测和自动恢复。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 12:20:10 +08:00
shaw
158a9b9a31 feat: 优化API Key批量创建和账户限流状态显示
- 添加 bedrockAccountId 和 rateLimitCost 字段到批量创建 API Key 功能
- 格式化 claudeAccountService 中的日志输出
- 改进账户视图中会话进度条样式,限流状态显示红色

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 11:59:09 +08:00
shaw
aabf909c61 fix:修复限流后未自动恢复调度的问题 2025-09-13 22:24:56 +08:00
shaw
b7da43f615 fix: 修复部分账号转发gemini api失败的问题 2025-09-12 11:41:14 +08:00
shaw
7c4feec5aa feat: 添加账户状态监控和自动恢复机制
- 实现账户健康度监控系统,支持30分钟内错误率检测
- 添加自动恢复机制,失败账户在30分钟后自动尝试恢复
- 优化账户选择策略,优先选择健康账户
- 增强Redis键管理,添加账户状态和错误追踪功能
- 改进Gemini服务错误处理和重试逻辑
- 新增standardGeminiRoutes标准化路由支持

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 22:02:53 +08:00
shaw
0eb95b3b06 refactor: 清理模型限制检查的冗余代码
优化内容:
- 删除 claudeRelayService.js 中的重复模型限制检查(82行代码)
- 保留 api.js 中的统一检查,覆盖所有服务类型(claude/console/ccr)
- 移除 /v1/messages/count_tokens 端点的模型限制(计数接口不需要限制)

架构改进:
- 模型限制逻辑现在集中在 api.js 的 handleMessagesRequest 函数中
- 避免了每个服务各自实现一遍的重复代码
- 提高了代码的可维护性和一致性

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:43:15 +08:00
shaw
f667a95d88 fix: 修复模型限制功能逻辑错误(从白名单改回黑名单)
问题原因:
- 在提交 7f9869ae 添加CCR支持时,错误地将模型限制从黑名单改成了白名单
- 前端UI显示"设置此API Key无法访问的模型",明确表示这是黑名单
- 后端却将其当作白名单处理,导致逻辑完全相反

修复内容:
- 将判断逻辑从 !includes 改回 includes(黑名单逻辑)
- 更新注释和日志消息,明确这是"限制列表"而非"允许列表"
- 同时修复了 api.js 和 claudeRelayService.js 中的所有相关判断

影响范围:
- src/routes/api.js: 修复 /v1/messages 和 /v1/messages/count_tokens 端点的模型限制判断
- src/services/claudeRelayService.js: 修复流式和非流式请求的模型限制判断

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:35:04 +08:00
shaw
2fcfccb2fc Merge branch 'dev' of github.com:Wei-Shaw/claude-relay-service into dev 2025-09-10 22:46:18 +08:00
Wesley Liddick
fe1f05fadd Merge pull request #411 from bottotl/main
兼容 sider 自定义 API
2025-09-10 22:36:54 +08:00
root
cd5573ecde Fix Prettier formatting issues
- Remove trailing whitespace and fix indentation in src/app.js
- Format whitespace in src/middleware/auth.js
- Fix formatting and add missing newline in src/middleware/browserFallback.js

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 09:13:51 +00:00
root
4fd4dbfa51 fix: 回退401错误处理逻辑到原始版本
- 恢复"遇到1次401就停止调度"的原始逻辑
- 移除"记录401错误但不停用账号"的临时修改
- 修复非流式和流式请求中的401处理逻辑
- 确保401错误会立即标记账号为异常状态

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 08:20:17 +00:00
sususu98
d3fcd95b94 refactor: improve readability of conditional statements 2025-09-10 15:55:34 +08:00
sususu98
433f0c5f23 fix: 更新会话续期逻辑,调整续期阈值和TTL设置,确保统一调度会话映射按配置正确续期 2025-09-10 15:53:23 +08:00