shaw
3a563b8dd2
fix: 优化 OpenAI Codex API 的 gpt-5 模型 ID 处理
...
- 自动将 gpt-5-xxx 格式的模型 ID 标准化为 gpt-5
- 解决 Codex API 不接受具体版本模型 ID 的问题
- 添加日志记录模型标准化过程
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-12 15:50:34 +08:00
shaw
b06fa5efe8
fix: 修复OpenAI类型账号数据统计问题
...
- 修复API Key请求次数、费用、token统计无法记录的问题
- 修复OpenAI账户今日使用统计显示空白的问题
- 修复模型使用详情记录缺失的问题
- 统一OpenAI账户统计数据格式与其他平台保持一致
主要修改:
1. openaiRoutes.js: 将req.apiKeyData改为req.apiKey,与中间件保持一致
2. admin.js: 为OpenAI账户列表接口添加使用统计获取逻辑
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-12 14:21:01 +08:00
Wesley Liddick
c761b4f3c7
Merge pull request #234 from tanaer/bugfix
...
Fixes: Gemini账户调度状态在页面刷新后与实际设置不符
2025-08-11 17:08:59 +08:00
wt
0f66ea7d4a
Fixes: Gemini账户调度状态在页面刷新后与实际设置不符
2025-08-11 16:48:34 +08:00
shaw
ed1f23152d
fix: redis服务改为expose并支持Codex cli的api转发
2025-08-11 15:54:59 +08:00
shaw
4643bd8aad
fix: 解决Codex cli转发流式响应中断问题
2025-08-11 14:40:02 +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
千羽
5d9c8216ac
chore: commit all changes
2025-08-10 19:09:56 +09:00
千羽
11fc856999
chore: commit all changes
2025-08-10 17:46:31 +09: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
shaw
7e1a9daa6b
feat: 完善管理界面功能和用户体验
...
- 添加 API Key 窗口倒计时组件 (WindowCountdown)
- 添加自定义下拉菜单组件 (CustomDropdown)
- 优化账户和 API Key 管理界面交互
- 改进教程页面布局和说明文字
- 完善账户状态显示和错误处理
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-08 14:14:46 +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
千羽
35e16038a5
feat: add Setup Token OAuth flow for simplified Claude account setup
...
Introduces a streamlined Setup Token authentication method that reduces the required OAuth scopes from 'org:create_api_key user:profile user:inference' to just 'user:inference', simplifying the account setup process for users who only need inference capabilities.
Key changes:
- Add Setup Token authorization endpoints in admin routes
- Implement Setup Token OAuth flow with PKCE support in oauthHelper
- Update AccountForm to support Setup Token as the default auth method
- Add automatic authorization code extraction from callback URLs
- Maintain full proxy configuration support for Setup Token flow
- Preserve existing OAuth flow for advanced users requiring API key creation
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-07 22:48:48 +09: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
andersonby
7ea899bd30
feat: add model name normalization for statistics aggregation in Redis and admin routes
2025-08-07 01:35:01 +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
657b7b0a05
feat: Add test scripts for Bedrock models and model mapping functionality
2025-08-06 19:23:36 +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
VanZheng
1e61e7a31d
feat: add comprehensive Makefile for project management ( #1 )
...
* fix: 修复timeRange=7days时的数据加载和显示问题
## 修复内容
### 后端修复 (src/routes/admin.js)
- 添加 /admin/usage-costs 接口对 period=7days 的支持
- 实现7天时间范围的成本统计,汇总最近7天的daily数据
- 修复时区处理不一致导致的数据过滤错误
### 前端修复 (web/admin-spa/src/stores/dashboard.js)
- 修改 loadDashboardData() 支持动态 timeRange 参数
- 根据时间范围动态调整 usage-costs 查询参数
- 消除硬编码的 period=today 和 period=all
### 前端修复 (web/admin-spa/src/views/ApiKeysView.vue)
- 修正API Key详情统计的period计算逻辑
- 7days时间范围现在正确传递 period=daily 而非 monthly
- 确保列表数据和详情统计使用一致的时间范围
## 解决的问题
- 选择"最近7天"时数据显示不准确或缺失
- API Key详情展开时period参数错误
- 成本统计不跟随时间范围选择变化
- 时区计算不一致导致的边界问题
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
* feat: add comprehensive Makefile for project management
- Add common development commands (install, setup, dev, start)
- Add frontend build commands (build-web, build-all)
- Add service management with daemon support
- Add Docker deployment commands
- Add CLI management tools shortcuts
- Add maintenance and monitoring commands
- Include Chinese descriptions for better UX
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
---------
Co-authored-by: Claude <noreply@anthropic.com >
2025-08-06 00:45:28 +08:00
shaw
4ebe6abd96
fix: 修复编辑账户时分组调度选择不生效的问题
...
- 为 Claude Console 和 Gemini 账户的更新接口添加分组处理逻辑
- 处理账户类型变更时的分组关系(从旧分组移除,添加到新分组)
- 修复前端编辑账户时分组 ID 的初始化问题
- 优化删除账户时自动从分组中移除的逻辑
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-05 19:02:27 +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
9fca0b0c20
feat: gemini 支持
2025-08-05 01:19:23 +08:00
mouyong
c214d72bef
feat: gemini 流式响应
2025-08-04 23:10:53 +08:00
mouyong
71b0d743fd
feat: gemini 流式响应
2025-08-04 23:05:51 +08:00
mouyong
e4b5364061
feat: gemini 流式响应
2025-08-04 23:04:40 +08:00
mouyong
74f428d990
feat: gemini 流式响应
2025-08-04 22:57:31 +08:00
mouyong
49221dfbc5
feat: gemini 流式响应
2025-08-04 22:45:11 +08:00
mouyong
08a962833b
feat: gemini 流式响应
2025-08-04 22:38:58 +08:00
mouyong
ae9f6158d1
feat: gemini 流式响应
2025-08-04 22:37:06 +08:00
mouyong
f2312893d4
feat: gemini 流式响应
2025-08-04 22:36:36 +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
mouyong
327d14bd5e
Merge branch 'main' of github.com:Wei-Shaw/claude-relay-service
...
* 'main' of github.com:Wei-Shaw/claude-relay-service:
fix: 修复 Gemini 统计功能的多个问题
fix: 修复API Keys页面时间窗口进度条和Token数值显示问题
chore: 清理 dist 目录
2025-08-04 17:42:08 +08:00
mouyong
c8f2abfedc
feat: 处理 openai 格式请求
2025-08-04 17:40:57 +08:00
shaw
2ad5d02468
fix: 修复 Gemini 统计功能的多个问题
...
主要修复:
1. geminiRoutes.js 主端点现在使用统一调度器(unifiedGeminiScheduler)
- 支持模型过滤
- 支持账户调度控制
- 与 Claude 保持一致的调度逻辑
2. 修复 Gemini 账户统计数据获取
- admin 路由现在正确获取 Gemini 账户的使用统计
- 使用 redis.getAccountUsageStats 获取真实数据
- 与 Claude 账户统计逻辑保持一致
这些修复确保了 Gemini 服务的数据统计功能正常工作,包括:
- 请求次数统计
- Token 使用量统计
- 模型级别的统计数据
- API Keys 页面和账户管理页面的数据显示
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-04 17:35:15 +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
千羽
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
fce6d8e1ac
fix: 修复仪表盘和API统计页面的多个问题
...
- 修复仪表盘天粒度下7天/30天快捷选择无数据的问题
- 修复API Keys页面统计按钮链接路由错误(admin -> admin-next)
- 改进统计页面限制展示,使用3个进度条更直观显示使用情况
- 后端API响应增加当前使用量数据(currentWindowRequests/Tokens/DailyCost)
- 修复教程页面window.location.origin为空的兼容性问题
- 无限制时使用无穷符号(∞)展示,提升用户体验
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-04 11:58:26 +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
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
329904ba72
fix: 修复仪表盘页面时间筛选功能
...
- 修复模型使用分布和详细统计数据不响应时间筛选的问题
- 后端/admin/model-stats端点添加startDate和endDate参数支持
- 支持自定义时间范围的模型统计数据聚合
- 前端loadModelStats函数添加时间范围参数传递
- 修复小时粒度和自定义时间筛选不生效的问题
现在时间筛选可以正确控制所有数据展示:
- Token使用趋势图 ✓
- 模型使用分布 ✓
- 详细统计数据 ✓
- API Keys使用趋势 ✓
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-03 22:34:42 +08:00
shaw
ecfc1050d3
feat: 优化移动端响应式设计
...
- 优化所有页面的移动端适配(手机、平板、PC)
- 修复AccountsView移动端状态显示和按钮功能问题
- 修复ApiKeysView移动端详情展开显示问题
- 移除ApiKeysView不必要的查看按钮
- 修复Dashboard页面PC版时间筛选按钮布局
- 改进所有组件的响应式设计
- 删除dist目录避免构建文件冲突
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-03 22:34:41 +08:00
KevinLiao
6216433b0b
Merge branch 'main' of https://github.com/Wei-Shaw/claude-relay-service
...
# Conflicts:
# web/admin-spa/dist/assets/LoginView-BJ0LLv16.js
# web/admin-spa/dist/assets/LogoTitle-DHj-MjwS.js
# web/admin-spa/dist/assets/MainLayout-CLydIeqJ.js
# web/admin-spa/dist/assets/SettingsView-DicW12bL.js
# web/admin-spa/dist/assets/index-HYE9xPuR.js
# web/admin-spa/dist/index.html
# web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue
# web/admin-spa/src/components/apikeys/EditApiKeyModal.vue
# web/admin-spa/src/views/ApiKeysView.vue
2025-07-30 20:41:10 +08:00
KevinLiao
b86adcd6d2
fix: 1.修复ClaudeConsole账号设置为专属绑定的功能
...
2. 修复Claude 官方账号会话窗口计算错误的问题
2025-07-30 20:20:12 +08:00
Gemini Wen
ef6de13084
fix: 修复仪表盘统计中遗漏 Claude Console 账户的问题
...
将 Claude Console 账户统计信息纳入系统概览,确保仪表盘显示完整的账户状态和健康检查。
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-30 17:22:40 +08:00
shaw
1ca753c79a
fix: 修复API Keys使用趋势图费用计算不准确的问题
...
- 使用模型级别的详细统计数据计算费用,而非固定模型
- 按实际使用的模型(sonnet/opus/haiku等)分别计算价格
- 累加各模型费用得到准确的总费用
- 降级方案改用sonnet模型(中等价格)而非haiku(最低价格)
问题原因:之前使用固定的haiku模型计算所有token的费用,导致价格偏低
解决方案:获取模型级别的使用数据,按实际模型价格计算
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-30 15:37:59 +08:00
shaw
321be986a6
feat: 优化仪表盘数据展示和用户体验
...
- 优化实时TPM显示格式,添加智能单位(K/M)
- 折线图tooltip添加token数单位格式化
- API Keys使用趋势图增加USD金额计算和显示
- 实现鼠标悬浮时数据倒序展示,前3名添加🥇 🥈 🥉 标识
- 后端API添加费用计算支持
- 删除测试脚本,保持代码整洁
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-30 15:37:58 +08:00