KevinLiao
0e5f4e03c1
feat: 新增Claude账号订阅类型设置
...
1. OAuth可自动判断订阅类型,Setup Token请自行选择。无论那种类型都可以自己改
2. 优化调度,Pro账号不再接受opus模型请求的调度
2025-08-14 16:43:58 +08:00
Wesley Liddick
ceb1749859
Merge pull request #243 from tanaer/fixed
...
Fixed: 新增 Claude Console 账户限流机制开关
2025-08-13 17:49:47 +08:00
wt
8142c3356a
feat: 新增 Claude Console 账户限流机制开关 Lint format
2025-08-13 17:04:47 +08:00
wt
ab02acd008
Prettier format
2025-08-13 15:04:47 +08:00
wt
f9e8157e07
Fix: Claude Console 账户的限流开关
2025-08-13 11:24:20 +08:00
shaw
2cd56c1174
fix: 修复OpenAI账户统计问题
...
- 添加缺失的recordUsage方法,统一updateAccountUsage实现
- 优化模型支持检查逻辑,未设置supportedModels时支持所有模型
- 修复gpt-5模型请求被拒绝的问题
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-13 09:54:06 +08:00
shaw
4ca9674772
feat: 完善多平台账户管理和API Keys页面展示
...
- 修复OpenAI路由中的gpt-5模型ID处理
- 增强统一调度器的账户选择日志输出
- 优化OAuth流程中的账户类型处理
- 完善API Keys页面的多平台账户信息展示
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-12 17:55:45 +08:00
wt
6dfaf637aa
feat: 新增 Claude Console 账户限流机制开关
2025-08-12 15:48:41 +08:00
wt
0f66ea7d4a
Fixes: Gemini账户调度状态在页面刷新后与实际设置不符
2025-08-11 16:48:34 +08:00
shaw
f462684f97
feat: 实现OpenAI账户管理和统一调度系统
...
- 新增 OpenAI 账户管理服务,支持多账户轮询和负载均衡
- 实现统一的 OpenAI API 调度器,智能选择最优账户
- 优化成本计算器,支持更精确的 token 计算
- 更新模型定价数据,包含最新的 OpenAI 模型价格
- 增强 API Key 管理,支持更灵活的配额控制
- 改进管理界面,添加教程视图和账户分组管理
- 优化限流配置组件,提供更直观的用户体验
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-11 13:58:43 +08:00
Wesley Liddick
e09c1dda12
Merge pull request #227 from mouyong/dev-local
...
增强账户管理页面的平台筛选和缓存优化功能
2025-08-10 13:25:02 +08:00
mouyong
4bcd2878f2
feat: 增强账户管理页面的平台筛选和缓存优化功能
...
- 添加平台筛选功能到账户管理页面
* 后端:在所有账户接口中支持platform和groupId查询参数
* 前端:添加平台筛选下拉框,支持条件性API请求
- 使用智能缓存机制优化数据加载
* 缓存API Keys、账户分组和分组成员数据
* 通过Ctrl/⌘+点击刷新按钮实现强制重新加载
* 在数据变更时自动清除相关缓存(创建/编辑/删除)
- 改进Gemini账户限流状态显示
* 在geminiAccountService中添加限流信息支持
* 统一所有平台的限流状态格式
* 修复仪表板统计,排除被限流的账户
- 提升用户界面体验
* 将原生title提示替换为Element Plus的el-tooltip组件
* 支持跨平台键盘快捷键(Ctrl/⌘+点击)
* ESLint规范合规和代码格式化改进
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-10 12:40:24 +08:00
KevinLiao
87775c9fb1
fix: 修复Claude Console账号模型映射的的流式响应
2025-08-10 08:46:26 +08:00
mouyong
8bdf495ffa
feat: enhance monitoring and Gemini service functionality
...
- Add enhanced monitoring scripts (monitor-enhanced.sh, status-unified.sh)
- Improve Gemini relay service with better error handling and token management
- Update authentication middleware for better compatibility
- Add new package dependencies for enhanced functionality
- Update .gitignore and app configuration
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-09 14:06:56 +08:00
shaw
4adc8d9695
恢复并保存本地修改:仪表盘服务账户分类显示、WindowCountdown组件等功能
2025-08-08 11:56:24 +08:00
shaw
31bdb4aa8c
feat: add comprehensive 401 error handling and account status management
...
- Add 401 error detection and automatic account suspension after 3 consecutive failures
- Implement account status reset functionality for clearing all error states
- Enhance admin interface with status reset controls and improved status display
- Upgrade service management script with backup protection and retry mechanisms
- Add mandatory code formatting requirements using Prettier
- Improve account selector with detailed status information and color coding
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-08 00:35:26 +08:00
千羽
8a74bf5afe
refactor: standardize code formatting and linting configuration
...
- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility
- Add .prettierrc configuration for consistent code formatting
- Update package.json with new lint and format scripts
- Add nodemon.json for development hot reloading configuration
- Standardize code formatting across all JavaScript and Vue files
- Update web admin SPA with improved linting rules and formatting
- Add prettier configuration to web admin SPA
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-07 18:19:31 +09:00
Wesley Liddick
6626d1d32a
Merge pull request #208 from kevinconan/main
...
fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值
2025-08-07 12:38:36 +08:00
KevinLiao
ae7f4e2405
fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值
2025-08-07 12:33:32 +08:00
andersonby
7ea899bd30
feat: add model name normalization for statistics aggregation in Redis and admin routes
2025-08-07 01:35:01 +08:00
andersonby
622c4047e9
fix: update account retrieval logic in BedrockAccountService to handle missing accounts and re-encrypt AWS credentials
2025-08-07 01:10:30 +08:00
andersonby
3dc0b7ff4f
fix: improve decryption logic in BedrockAccountService to handle both encrypted and plaintext AWS credentials
2025-08-07 01:02:26 +08:00
andersonby
e553734e42
chore: update user agent version to 1.0.69 in claudeConsoleAccountService and claudeConsoleRelayService
2025-08-07 00:53:14 +08:00
Wesley Liddick
f63708cda4
Merge branch 'main' into feature/claude-code-client-support
2025-08-06 23:20:33 +08:00
shinegod
3616245d49
feat: 全面增强 Claude Code 客户端支持与错误处理
...
## 🚀 新功能
- **智能认证系统**: 根据 API Key 格式自动选择认证方式
- `sk-ant-*` 开头使用 `x-api-key` 认证(兼容 Anthropic 官方)
- 其他格式使用 `Authorization: Bearer` 认证(兼容标准 REST API)
- **Claude Code 客户端完整支持**: 新增必需的 API 端点
- `GET /v1/models` - 返回支持的模型列表
- `GET /v1/me` - 用户信息端点
- `GET /v1/organizations/:org_id/usage` - 使用统计查询
## 🔧 修复与优化
- **HTTP 协议合规性**: 修复响应头冲突导致的 502 错误
- 避免同时发送 `Content-Length` 和 `Transfer-Encoding` 头部
- 优化响应头过滤机制,确保代理兼容性
- **完全透传错误响应**: 保持上游 API 原始响应格式
- 透传原始状态码、响应头和内容
- 移除错误包装,直接转发原始 JSON 格式
- 支持流式和非流式请求的错误透传
- **流式响应处理优化**:
- 添加 `validateStatus: () => true` 配置
- 改进错误处理逻辑,避免异常中断
## 📝 代码质量
- 修复 ESLint 代码规范警告
- 优化敏感头部过滤列表
- 改进调试日志输出
## 🎯 解决的问题
- Claude Code 客户端无法连接(502 Bad Gateway)
- 错误响应被包装而非透传原始格式
- sk-ant-* 格式 API Key 认证失败
- HTTP/2 代理环境下的响应头冲突
## ✅ 测试验证
- 本地测试完全透传上游错误响应
- Claude Code 客户端连接测试通过
- 智能认证机制验证成功
- HTTP 协议合规性确认
2025-08-06 14:27:57 +00:00
andersonby
d8f949fb47
fix: update Bedrock model format check to use includes method for better accuracy
2025-08-06 21:44:03 +08:00
andersonby
5883a60fba
Merge upstream changes and resolve conflicts
...
- Merged latest changes from Wei-Shaw/claude-relay-service
- Resolved conflict in AccountForm.vue to support both Bedrock and improved platform switching logic
- Maintained Bedrock integration while incorporating Gemini pricing improvements
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-06 19:26:31 +08:00
andersonby
657b7b0a05
feat: Add test scripts for Bedrock models and model mapping functionality
2025-08-06 19:23:36 +08:00
shaw
b1ea32caba
feat: 添加Gemini定价功能和界面优化
...
- 实现Gemini定价查询服务,支持实时计算token成本
- 改进API Key管理界面,添加模型快速选择功能
- 优化账户表单组件的渲染性能
- 更新Gemini账户服务,增强token刷新和错误处理
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-06 18:09:43 +08:00
andersonby
9a9a82c86f
feat: Add comprehensive Amazon Bedrock integration support
...
Add complete Amazon Bedrock integration to Claude Relay Service with:
## Core Features
- ✅ Bedrock account management with encrypted AWS credential storage
- ✅ Full request routing to AWS Bedrock with streaming support
- ✅ Integration with unified Claude scheduler system
- ✅ Support for Inference Profiles and Application Inference Profiles
- ✅ Configurable default and small-fast model settings
## Backend Services
- Add bedrockAccountService.js for account management
- Add bedrockRelayService.js for request forwarding
- Integrate Bedrock accounts into unifiedClaudeScheduler.js
- Update admin and API routes to support Bedrock endpoints
- Add comprehensive configuration options to config.example.js
## Frontend Integration
- Complete Vue.js Web UI for Bedrock account management
- Account creation form with AWS credentials and model configuration
- Real-time account status monitoring and statistics
- Edit/update capabilities for existing accounts
## CLI Support
- Interactive CLI commands for Bedrock account operations
- Account creation, listing, updating, and testing
- Status monitoring and connection validation
## Security & Performance
- AES encrypted storage of AWS credentials in Redis
- Support for temporary credentials (session tokens)
- Region-specific configuration support
- Rate limiting and error handling
This integration enables the relay service to support three AI platforms:
1. Claude (OAuth) - Original Claude.ai integration
2. Gemini - Google AI integration
3. Amazon Bedrock - New AWS Bedrock integration
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-06 17:41:16 +08:00
mouyong
80c6bed8c2
fix: 修复无法转发 opus 4.1 的问题
2025-08-06 15:26:49 +08:00
mouyong
e786ba8852
fix: 修复透传参数
2025-08-05 21:37:08 +08:00
mouyong
ca4099d23f
fix: 修复无法获取分组账号问题
2025-08-05 19:39:53 +08:00
shaw
7fa75df1fd
fix: 修复分组调度功能和API Keys统计弹窗UI问题
...
1. 分组调度功能修复:
- 统一使用 unifiedClaudeScheduler 和 unifiedGeminiScheduler
- 修复 schedulable 字段数据类型不一致问题(布尔值/字符串)
- 添加 _isSchedulable() 辅助方法确保兼容性
- 修复所有路由文件中的调度器调用
2. API Keys 统计弹窗UI优化:
- 统一弹窗样式与系统UI风格
- 添加右上角关闭按钮
- 修复移动端宽度问题(设置为95%屏幕宽度)
- 使用 Teleport 组件和项目通用样式
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-05 17:06:52 +08:00
mouyong
54ad8452c3
feat: gemini 流式响应
2025-08-04 20:34:17 +08:00
mouyong
2eee902988
feat: 处理 openai 格式请求
2025-08-04 18:20:39 +08:00
shaw
ef4f7483d3
feat: 完善 Gemini 功能与 Claude 保持一致
...
- 添加 Gemini 账户的 schedulable 字段和调度开关 API
- 实现 Gemini 调度器的模型过滤功能
- 完善 Gemini 数据统计,记录 token 使用量
- 修复 Gemini 流式响应的 SSE 解析和 AbortController 支持
- 在教程页面和 README 中添加 Gemini CLI 环境变量说明
- 修复前端 Gemini 账户调度开关限制
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-04 16:53:11 +08:00
mouyong
0e5a49c86f
feat: 处理sse传输
2025-08-04 15:46:16 +08:00
千羽
9625e7f490
Merge branch 'Wei-Shaw:main' into main
2025-08-04 14:47:32 +09:00
千羽
33837c23aa
feat: 增强 Gemini 服务支持并添加统一调度器
...
- 新增 unifiedGeminiScheduler.js 统一账户调度服务
- 增强 geminiRoutes.js 支持更多 Gemini API 端点
- 优化 geminiAccountService.js 账户管理和 token 刷新机制
- 添加对 v1internal 端点的完整支持(loadCodeAssist、onboardUser、countTokens、generateContent、streamGenerateContent)
- 改进错误处理和流式响应管理
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-04 14:47:03 +09:00
shaw
4e3c826b6c
fix: 修复API Keys页面时间窗口进度条和Token数值显示问题
...
- 修复时间窗口限制的请求次数和Token使用量进度条不更新的问题
- 在apiKeyService.getAllApiKeys()中添加获取当前窗口统计数据的逻辑
- 从Redis读取rate_limit:requests和rate_limit:tokens键的值
- 优化Token数值展示,添加K/M单位格式化
- UsageDetailModal组件中5处Token数值改用formatTokenCount
- ApiKeysView模型统计中5处Token数值改用formatTokenCount
- 统一使用K/M单位简化大数字显示
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-04 10:55:17 +08:00
千羽
a80b36896d
feat: 更新 Gemini OAuth 流程支持新的授权方式
...
- 使用 codeassist.google.com 作为新的回调地址
- 实现 PKCE 认证流程增强安全性
- 更新前端授权流程指引
- 简化授权码输入流程
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-04 00:16:29 +08:00
shaw
a5c7eeaf84
fix: 修复专属账号下拉框,仅显示dedicated类型账号
...
- 修改CreateApiKeyModal和EditApiKeyModal的过滤逻辑
- 专属账号下拉框只显示accountType='dedicated'的账号
- 移除accountType='group'的账号,这些账号通过分组调度
- 更新标签文字为'专属账号'以更准确描述
2025-08-03 22:34:44 +08:00
shaw
9c9afe1528
feat: 实现账户分组管理功能和优化响应式设计
...
主要更新:
- 实现账户分组管理功能,支持创建、编辑、删除分组
- 支持将账户添加到分组进行统一调度
- 优化 API Keys 页面响应式设计,解决操作栏被隐藏的问题
- 优化账户管理页面布局,合并平台/类型列,改进操作按钮布局
- 修复代理信息显示溢出问题
- 改进表格列宽分配,充分利用屏幕空间
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-03 22:34:43 +08:00
shaw
8e89311dac
feat: 使用API响应头中的准确时间戳修正会话窗口和限流时间
...
- 从429响应中提取 anthropic-ratelimit-unified-reset 响应头
- 使用准确的重置时间戳设置限流结束时间和会话窗口
- 会话窗口开始时间 = 重置时间戳 - 5小时
- 兼容旧逻辑:无响应头时使用预估的会话窗口时间
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-31 16:29:44 +08:00
KevinLiao
b7f4c2a560
Merge branch 'main' of https://github.com/Wei-Shaw/claude-relay-service
2025-07-31 13:37:23 +08:00
KevinLiao
0e84a979e9
fix: 继续修正会话窗口的计算问题,这回应该正确了
2025-07-31 13:36:24 +08:00
shaw
7ebcdbe72d
fix: 优化限流机制,使限流时间与Claude会话窗口保持一致
...
- 限流结束时间现在基于5小时会话窗口而非硬编码1小时
- 新增 rateLimitEndAt 字段追踪限流结束时间
- 自动解除限流基于会话窗口结束时间
- 保持向后兼容,支持旧数据格式
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-31 13:00:19 +08:00
KevinLiao
d93ce8713d
fix: 修复session窗口计算问题
2025-07-31 09:15:33 +08:00
KevinLiao
3c797a85e0
feat: Claude Console账号增强,升级模型支持列表为模型映射表!
2025-07-30 23:13:59 +08:00