mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-19 16:17:56 +00:00
fix(gemini): 3.6 Flash 兜底价改为官方优惠价
- 内置兜底价与本地价格表快照的 gemini-3.6-flash 改为 $0.75 输入 / $3.75 输出 / $0.075 缓存读取(Priority 档 $1.35 / $6.75 / $0.135),有效期至 2026-12-31, 2027-01-01 起恢复 $1.50 / $7.50 / $0.15,与 3.7 / 3.8 Flash 及远程价格目录一致
This commit is contained in:
@@ -933,7 +933,7 @@ func TestResolveAccountStatsCost_Gemini36FlashTierUsesFallbackPricing(t *testing
|
||||
UsageTokens{InputTokens: 1_000_000, OutputTokens: 1_000_000, CacheReadTokens: 1_000_000}, 1, 0, "", time.Time{}, true,
|
||||
)
|
||||
require.NotNil(t, result)
|
||||
require.InDelta(t, 9.15, *result, 1e-12)
|
||||
require.InDelta(t, 4.575, *result, 1e-12)
|
||||
}
|
||||
|
||||
func TestResolveAccountStatsCost_AllMiss_ReturnsNil(t *testing.T) {
|
||||
|
||||
@@ -474,14 +474,15 @@ func (s *BillingService) initFallbackPricing() {
|
||||
SupportsCacheBreakdown: false,
|
||||
}
|
||||
|
||||
// Gemini 3.6 Flash (Google AI pricing: $1.50 input / $7.50 output /
|
||||
// $0.15 cached input per MTok). Antigravity's -high/-low/-medium/-tiered
|
||||
// aliases are matched below so unavailable remote pricing never records
|
||||
// token-bearing requests at $0.
|
||||
// Gemini 3.6 Flash (Google AI pricing: $0.75 input / $3.75 output /
|
||||
// $0.075 cached input per MTok, promotional through 2026-12-31; official
|
||||
// rates double to $1.50/$7.50/$0.15 from 2027-01-01). Antigravity's
|
||||
// -high/-low/-medium/-tiered aliases are matched below so unavailable
|
||||
// remote pricing never records token-bearing requests at $0.
|
||||
s.fallbackPrices["gemini-3.6-flash"] = &ModelPricing{
|
||||
InputPricePerToken: 1.5e-6,
|
||||
OutputPricePerToken: 7.5e-6,
|
||||
CacheReadPricePerToken: 0.15e-6,
|
||||
InputPricePerToken: 0.75e-6,
|
||||
OutputPricePerToken: 3.75e-6,
|
||||
CacheReadPricePerToken: 0.075e-6,
|
||||
SupportsCacheBreakdown: false,
|
||||
}
|
||||
|
||||
|
||||
@@ -613,10 +613,10 @@ func TestBillingService_Gemini36FlashThinkingTierFallbacksAreBillable(t *testing
|
||||
t.Run(model, func(t *testing.T) {
|
||||
cost, err := svc.CalculateCost(model, tokens, 1)
|
||||
require.NoError(t, err)
|
||||
require.InDelta(t, 1.5, cost.InputCost, 1e-12)
|
||||
require.InDelta(t, 7.5, cost.OutputCost, 1e-12)
|
||||
require.InDelta(t, 0.15, cost.CacheReadCost, 1e-12)
|
||||
require.InDelta(t, 9.15, cost.TotalCost, 1e-12)
|
||||
require.InDelta(t, 0.75, cost.InputCost, 1e-12)
|
||||
require.InDelta(t, 3.75, cost.OutputCost, 1e-12)
|
||||
require.InDelta(t, 0.075, cost.CacheReadCost, 1e-12)
|
||||
require.InDelta(t, 4.575, cost.TotalCost, 1e-12)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -725,9 +725,9 @@ func TestDefaultPricingIncludesGemini36FlashRates(t *testing.T) {
|
||||
t.Run(model, func(t *testing.T) {
|
||||
pricing, err := billingSvc.GetModelPricing(model)
|
||||
require.NoError(t, err)
|
||||
require.InDelta(t, 1.5e-6, pricing.InputPricePerToken, 1e-12)
|
||||
require.InDelta(t, 7.5e-6, pricing.OutputPricePerToken, 1e-12)
|
||||
require.InDelta(t, 0.15e-6, pricing.CacheReadPricePerToken, 1e-12)
|
||||
require.InDelta(t, 0.75e-6, pricing.InputPricePerToken, 1e-12)
|
||||
require.InDelta(t, 3.75e-6, pricing.OutputPricePerToken, 1e-12)
|
||||
require.InDelta(t, 0.075e-6, pricing.CacheReadPricePerToken, 1e-12)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2616,17 +2616,17 @@
|
||||
"web_search_billing_unit": "per_query"
|
||||
},
|
||||
"gemini-3.6-flash": {
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"cache_read_input_token_cost_priority": 2.7e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"input_cost_per_token_priority": 2.7e-06,
|
||||
"cache_read_input_token_cost": 7.5e-08,
|
||||
"cache_read_input_token_cost_priority": 1.35e-07,
|
||||
"input_cost_per_token": 7.5e-07,
|
||||
"input_cost_per_token_priority": 1.35e-06,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 65536,
|
||||
"max_tokens": 65536,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 7.5e-06,
|
||||
"output_cost_per_token_priority": 1.35e-05,
|
||||
"output_cost_per_token": 3.75e-06,
|
||||
"output_cost_per_token_priority": 6.75e-06,
|
||||
"source": "https://ai.google.dev/gemini-api/docs/latest-model",
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
|
||||
Reference in New Issue
Block a user