mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-26 20:29:03 +03:00
Update sing-box core, refactor MASQUE, update XHTTP
This commit is contained in:
@@ -851,10 +851,7 @@ func normalizeGPT5Model(model string) string {
|
||||
func calculateCost(stats UsageStats, model string, serviceTier string, contextWindow int) float64 {
|
||||
pricing := getPricing(model, serviceTier, contextWindow)
|
||||
|
||||
regularInputTokens := stats.InputTokens - stats.CachedTokens
|
||||
if regularInputTokens < 0 {
|
||||
regularInputTokens = 0
|
||||
}
|
||||
regularInputTokens := max(stats.InputTokens-stats.CachedTokens, 0)
|
||||
|
||||
cost := (float64(regularInputTokens)*pricing.InputPrice +
|
||||
float64(stats.OutputTokens)*pricing.OutputPrice +
|
||||
|
||||
Reference in New Issue
Block a user