fix: update the limit logic, and if the daily limit is not reached after reaching the opus weekly limit, other claude models can be used

This commit is contained in:
tyrantlucifer
2026-02-10 13:59:20 +08:00
parent 00a954c7e9
commit f444af49bf
4 changed files with 23 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ const config = require('../../config/config')
const redis = require('../models/redis')
const logger = require('../utils/logger')
const serviceRatesService = require('./serviceRatesService')
const { isClaudeFamilyModel } = require('../utils/modelHelper')
const { isOpusModel } = require('../utils/modelHelper')
const ACCOUNT_TYPE_CONFIG = {
claude: { prefix: 'claude:account:' },
@@ -1649,7 +1649,7 @@ class ApiKeyService {
async recordOpusCost(keyId, ratedCost, realCost, model, accountType) {
try {
// 判断是否为 Claude 系列模型(包含 Bedrock 格式等)
if (!isClaudeFamilyModel(model)) {
if (!isOpusModel(model)) {
return
}