瀏覽代碼

fix: fix used amount not correct

JustSong 2 年之前
父節點
當前提交
ced9f060c7
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      controller/billing.go

+ 3 - 0
controller/billing.go

@@ -48,6 +48,9 @@ func GetUsage(c *gin.Context) {
 		return
 	}
 	amount := float64(quota)
+	if common.DisplayInCurrencyEnabled {
+		amount /= common.QuotaPerUnit
+	}
 	usage := OpenAIUsageResponse{
 		Object:     "list",
 		TotalUsage: amount,