mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 18:35:09 +00:00
feat: 添加API Key时间窗口限流功能并移除累计总量限制
- 新增时间窗口限流功能,支持按分钟设置时间窗口 - 支持在时间窗口内限制请求次数和Token使用量 - 移除原有的累计总量限制,只保留时间窗口限制 - Token统计包含所有4种类型:输入、输出、缓存创建、缓存读取 - 前端UI优化,明确显示限流参数的作用范围 - 限流触发时提供友好的错误提示和重置时间 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class ClaudeRelayService {
|
||||
|
||||
try {
|
||||
// 调试日志:查看API Key数据
|
||||
logger.info(`🔍 API Key data received:`, {
|
||||
logger.info('🔍 API Key data received:', {
|
||||
apiKeyName: apiKeyData.name,
|
||||
enableModelRestriction: apiKeyData.enableModelRestriction,
|
||||
restrictedModels: apiKeyData.restrictedModels,
|
||||
@@ -448,7 +448,7 @@ class ClaudeRelayService {
|
||||
async relayStreamRequestWithUsageCapture(requestBody, apiKeyData, responseStream, clientHeaders, usageCallback) {
|
||||
try {
|
||||
// 调试日志:查看API Key数据(流式请求)
|
||||
logger.info(`🔍 [Stream] API Key data received:`, {
|
||||
logger.info('🔍 [Stream] API Key data received:', {
|
||||
apiKeyName: apiKeyData.name,
|
||||
enableModelRestriction: apiKeyData.enableModelRestriction,
|
||||
restrictedModels: apiKeyData.restrictedModels,
|
||||
|
||||
Reference in New Issue
Block a user