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:
Wesley Liddick authored and GitHub committed 2026-11-10 21:28:02 +08:00
commit 722bbf6dbe
4 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -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)
})
+1 -1
View File
@@ -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,