Files
sproutclaw/packages
sparkleMing 6d744f02ef fix: subtract cached tokens from input in Google and Vertex cost calculation (#2588)
Google's promptTokenCount includes cachedContentTokenCount, so using it
directly as the input token count causes double-counting when calculateCost
multiplies input by the input rate AND cacheRead by the cacheRead rate.

The google-gemini-cli provider already handles this correctly (subtracting
cachedContentTokenCount from promptTokenCount), but google.ts and
google-vertex.ts were using the raw promptTokenCount.

This fix aligns both providers with the google-gemini-cli behavior.
2026-03-25 22:02:28 +01:00
..
2026-03-23 02:49:53 +01:00