fix(billing): avoid double counting cache read in OpenAI cache hit context

This commit is contained in:
ZheFox
2026-05-17 02:40:01 +08:00
parent b903f8ff7d
commit 41ffb18604
2 changed files with 47 additions and 10 deletions

View File

@@ -113,10 +113,7 @@ struct ExpectedUsagePricing {
impl ExpectedUsagePricing {
fn total_tokens(self) -> u64 {
self.input_tokens
.saturating_add(self.output_tokens)
.saturating_add(self.cache_creation_tokens)
.saturating_add(self.cache_read_tokens)
self.input_tokens.saturating_add(self.output_tokens)
}
fn cache_creation_uncategorized_tokens(self) -> u64 {