Sfoglia il codice sorgente

fix: fix used amount not correct

JustSong 2 anni fa
parent
commit
ced9f060c7
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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,