diff --git a/README.md b/README.md index 89160cb1..bd2da6a1 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,17 @@ --- -## ⭐ 如果觉得有用,点个Star支持一下吧! +## 💎 Claude 拼车 - Claude Code 合租服务推荐 -> 开源不易,你的Star是我持续更新的动力 🚀 -> 欢迎加入 [Telegram 公告频道](https://t.me/claude_relay_service) 获取最新动态 +
+ +| 平台 | 类型 | 介绍 | +|:---:|:---:|:---| +| **[PinCC.ai](https://pincc.ai/)** | 🏆 **官方运营** | 项目官方直营的Claude拼车服务
提供200刀 Claude Code Max 套餐共享服务 | +| **[CToK.ai](https://ctok.ai/)** | 🤝 合作伙伴 | 社区认可的Claude拼车服务,稳定可靠 | + + +
--- @@ -42,11 +49,6 @@ 如果有以上困惑,那这个项目可能适合你。 -> 💡 **Claude Code 拼车服务** -> 目前有两个稳定的 Claude Code Max 20X 200刀 拼车渠道: -> 1. **PinCC** - 项目官方运营的拼车服务:[https://pincc.ai/](https://pincc.ai/) -> 2. **CToK** - 社区认可的合作伙伴服务:[https://ctok.ai/](https://ctok.ai/) - ### 适合的场景 ✅ **找朋友拼车**: 三五好友一起分摊Claude Code Max订阅 @@ -76,8 +78,6 @@ ## 🚀 核心功能 -> 📸 **[查看演示站点](https://demo.pincc.ai/admin-next/login)** - ### 基础功能 - ✅ **多账户管理**: 可以添加多个Claude账户自动轮换 diff --git a/src/routes/apiStats.js b/src/routes/apiStats.js index 810c53a1..a121fe3e 100644 --- a/src/routes/apiStats.js +++ b/src/routes/apiStats.js @@ -376,12 +376,14 @@ router.post('/api/user-stats', async (req, res) => { rateLimitCost: parseFloat(fullKeyData.rateLimitCost) || 0, // 新增:费用限制 dailyCostLimit: fullKeyData.dailyCostLimit || 0, totalCostLimit: fullKeyData.totalCostLimit || 0, + weeklyOpusCostLimit: parseFloat(fullKeyData.weeklyOpusCostLimit) || 0, // Opus 周费用限制 // 当前使用量 currentWindowRequests, currentWindowTokens, currentWindowCost, // 新增:当前窗口费用 currentDailyCost, currentTotalCost: totalCost, + weeklyOpusCost: (await redis.getWeeklyOpusCost(keyId)) || 0, // 当前 Opus 周费用 // 时间窗口信息 windowStartTime, windowEndTime, diff --git a/web/admin-spa/src/components/apistats/LimitConfig.vue b/web/admin-spa/src/components/apistats/LimitConfig.vue index bddf547a..78ff90ff 100644 --- a/web/admin-spa/src/components/apistats/LimitConfig.vue +++ b/web/admin-spa/src/components/apistats/LimitConfig.vue @@ -135,6 +135,59 @@ + +
+
+ 总费用限制 + + + ${{ statsData.limits.currentTotalCost.toFixed(4) }} / ${{ + statsData.limits.totalCostLimit.toFixed(2) + }} + + + ${{ statsData.limits.currentTotalCost.toFixed(4) }} / + + +
+
+
+
+
+
+
+
+ + +
+
+ Opus 模型周费用限制 + + ${{ statsData.limits.weeklyOpusCost.toFixed(4) }} / ${{ + statsData.limits.weeklyOpusCostLimit.toFixed(2) + }} + +
+
+
+
+
+
-
model_provider = "crs"
-
model = "gpt-5-codex"
-
model_reasoning_effort = "high"
-
disable_response_storage = true
-
preferred_auth_method = "apikey"
-
-
[model_providers.crs]
-
name = "crs"
-
base_url = "{{ openaiBaseUrl }}"
-
wire_api = "responses"
+
+ {{ line }} +

在 @@ -449,13 +447,59 @@

-
{
-
"OPENAI_API_KEY": "你的API密钥"
-
}
+
+ {{ line }} +
+
+
+ +

{{ codexConfigContent.authInstructions.description }}

+ + +
+ {{ codexConfigContent.authInstructions.title }} +
+ + +
+

+ {{ codexConfigContent.authInstructions.platform.title }}: +

+
+
+ {{ codexConfigContent.authInstructions.platform.command }} +
+
+
+ + +
+

+ {{ codexConfigContent.authInstructions.persistent.title }}: +

+

+ {{ codexConfigContent.authInstructions.persistent.description }} +

+
+
+ {{ command }} +
+
+
-

- 💡 使用与 Claude Code 相同的 API 密钥即可,格式如 cr_xxxxxxxxxx。 -

@@ -917,16 +961,14 @@
-
model_provider = "crs"
-
model = "gpt-5-codex"
-
model_reasoning_effort = "high"
-
disable_response_storage = true
-
preferred_auth_method = "apikey"
-
-
[model_providers.crs]
-
name = "crs"
-
base_url = "{{ openaiBaseUrl }}"
-
wire_api = "responses"
+
+ {{ line }} +

在 @@ -936,13 +978,59 @@

-
{
-
"OPENAI_API_KEY": "你的API密钥"
-
}
+
+ {{ line }} +
+
+
+ +

{{ codexConfigContent.authInstructions.description }}

+ + +
+ {{ codexConfigContent.authInstructions.title }} +
+ + +
+

+ {{ codexConfigContent.authInstructions.platform.title }}: +

+
+
+ {{ codexConfigContent.authInstructions.platform.command }} +
+
+
+ + +
+

+ {{ codexConfigContent.authInstructions.persistent.title }}: +

+

+ {{ codexConfigContent.authInstructions.persistent.description }} +

+
+
+ {{ command }} +
+
+
-

- 💡 使用与 Claude Code 相同的 API 密钥即可,格式如 cr_xxxxxxxxxx。 -

@@ -1395,16 +1483,14 @@
-
model_provider = "crs"
-
model = "gpt-5-codex"
-
model_reasoning_effort = "high"
-
disable_response_storage = true
-
preferred_auth_method = "apikey"
-
-
[model_providers.crs]
-
name = "crs"
-
base_url = "{{ openaiBaseUrl }}"
-
wire_api = "responses"
+
+ {{ line }} +

在 @@ -1414,13 +1500,59 @@

-
{
-
"OPENAI_API_KEY": "你的API密钥"
-
}
+
+ {{ line }} +
+
+
+ +

{{ codexConfigContent.authInstructions.description }}

+ + +
+ {{ codexConfigContent.authInstructions.title }} +
+ + +
+

+ {{ codexConfigContent.authInstructions.platform.title }}: +

+
+
+ {{ codexConfigContent.authInstructions.platform.command }} +
+
+
+ + +
+

+ {{ codexConfigContent.authInstructions.persistent.title }}: +

+

+ {{ codexConfigContent.authInstructions.persistent.description }} +

+
+
+ {{ command }} +
+
+
-

- 💡 使用与 Claude Code 相同的 API 密钥即可,格式如 cr_xxxxxxxxxx。 -

@@ -1627,7 +1759,6 @@ const getBaseUrlPrefix = () => { origin = currentUrl.substring(0, pathStart) } else { // 最后的降级方案,使用相对路径 - console.warn('无法获取完整的 origin,将使用相对路径') return '' } } @@ -1649,6 +1780,92 @@ const geminiBaseUrl = computed(() => { const openaiBaseUrl = computed(() => { return getBaseUrlPrefix() + '/openai' }) + +// Codex 配置内容 +const codexConfigContent = computed(() => { + // 根据当前激活的教程系统获取对应的环境变量设置说明 + const getCurrentPlatformAuthInstructions = () => { + const baseInstructions = { + title: '环境变量设置方法', + description: + '💡 将 OPENAI_API_KEY 设置为 null,然后设置环境变量 CRS_OAI_KEY 为您的 API 密钥(格式如 cr_xxxxxxxxxx)。' + } + + switch (activeTutorialSystem.value) { + case 'windows': + return { + ...baseInstructions, + platform: { + title: 'Windows', + command: 'set CRS_OAI_KEY=cr_xxxxxxxxxx' + } + } + case 'macos': + return { + ...baseInstructions, + platform: { + title: 'macOS', + command: 'export CRS_OAI_KEY=cr_xxxxxxxxxx' + }, + persistent: { + title: 'Shell 配置文件(持久保存)', + description: '添加到您的 shell 配置文件中:', + commands: [ + '# 对于 zsh (默认)', + 'echo "export CRS_OAI_KEY=cr_xxxxxxxxxx" >> ~/.zshrc', + 'source ~/.zshrc', + '', + '# 对于 bash', + 'echo "export CRS_OAI_KEY=cr_xxxxxxxxxx" >> ~/.bash_profile', + 'source ~/.bash_profile' + ] + } + } + case 'linux': + return { + ...baseInstructions, + platform: { + title: 'Linux', + command: 'export CRS_OAI_KEY=cr_xxxxxxxxxx' + }, + persistent: { + title: 'Shell 配置文件(持久保存)', + description: '添加到您的 shell 配置文件中:', + commands: [ + '# 对于 bash (默认)', + 'echo "export CRS_OAI_KEY=cr_xxxxxxxxxx" >> ~/.bashrc', + 'source ~/.bashrc', + '', + '# 对于 zsh', + 'echo "export CRS_OAI_KEY=cr_xxxxxxxxxx" >> ~/.zshrc', + 'source ~/.zshrc' + ] + } + } + default: + return baseInstructions + } + } + + return { + configToml: [ + 'model_provider = "crs"', + 'model = "gpt-5-codex"', + 'model_reasoning_effort = "high"', + 'disable_response_storage = true', + 'preferred_auth_method = "apikey"', + '', + '[model_providers.crs]', + 'name = "crs"', + `base_url = "${openaiBaseUrl.value}"`, + 'wire_api = "responses"', + 'requires_openai_auth = true', + 'env_key = "CRS_OAI_KEY"' + ], + authJson: ['{', ' "OPENAI_API_KEY": null', '}'], + authInstructions: getCurrentPlatformAuthInstructions() + } +})