mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-29 20:17:21 +08:00
Merge pull request #8381 from r266-tech/codex/sonnet55-cache-read-pricing
fix: correct Sonnet 5.5 cache read fallback pricing
This commit is contained in:
4 files changed
+5
-4
No files matched your search
@@ -426,7 +426,7 @@ func (s *BillingService) initFallbackPricing() {
|
||||
InputPricePerToken: 2e-6,
|
||||
OutputPricePerToken: 10e-6,
|
||||
CacheCreationPricePerToken: 2.5e-6,
|
||||
CacheReadPricePerToken: 0.2e-6,
|
||||
CacheReadPricePerToken: 0.1e-6,
|
||||
CacheCreation5mPrice: 2.5e-6,
|
||||
CacheCreation1hPrice: 4e-6,
|
||||
SupportsCacheBreakdown: true,
|
||||
|
||||
@@ -2104,7 +2104,8 @@ func TestNewModelPricingCatalogFallbackAndContext(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.InDelta(t, 100_000*2e-6, cost.InputCost, 1e-10)
|
||||
require.InDelta(t, 400*2.5e-6+600*4e-6, cost.CacheCreationCost, 1e-10)
|
||||
require.InDelta(t, 1000*0.2e-6, cost.CacheReadCost, 1e-10)
|
||||
// Sonnet 5.5 cache hits cost 5% of the $2/MTok input price (#8378).
|
||||
require.InDelta(t, 1000*0.1e-6, cost.CacheReadCost, 1e-10)
|
||||
require.InDelta(t, 500*10e-6, cost.OutputCost, 1e-10)
|
||||
require.False(t, cost.LongContextBillingApplied)
|
||||
})
|
||||
|
||||
@@ -153,7 +153,7 @@ var (
|
||||
claudeSonnet55FallbackPricing = &LiteLLMModelPricing{
|
||||
InputCostPerToken: 2e-6, OutputCostPerToken: 10e-6,
|
||||
CacheCreationInputTokenCost: 2.5e-6, CacheCreationInputTokenCostAbove1hr: 4e-6,
|
||||
CacheReadInputTokenCost: 0.2e-6,
|
||||
CacheReadInputTokenCost: 0.1e-6,
|
||||
LiteLLMProvider: "anthropic", Mode: "chat", SupportsPromptCaching: true,
|
||||
}
|
||||
claudeHaiku55FallbackPricing = &LiteLLMModelPricing{
|
||||
|
||||
@@ -1015,7 +1015,7 @@
|
||||
"claude-sonnet-5-5": {
|
||||
"cache_creation_input_token_cost": 2.5e-06,
|
||||
"cache_creation_input_token_cost_above_1hr": 4e-06,
|
||||
"cache_read_input_token_cost": 2e-07,
|
||||
"cache_read_input_token_cost": 1e-07,
|
||||
"input_cost_per_token": 2e-06,
|
||||
"litellm_provider": "anthropic",
|
||||
"max_input_tokens": 1000000,
|
||||
|
||||
Reference in new issue
Block a user