Explorar o código

fix: fix used amount not correct

JustSong %!s(int64=2) %!d(string=hai) anos
pai
achega
ced9f060c7
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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,