From 3dd3a49cab7fddabe1f1b4b5793804ee7b344db8 Mon Sep 17 00:00:00 2001 From: Mark Yan Date: Mon, 24 Aug 2026 06:54:03 +0000 Subject: [PATCH] fix(cost): price Gemini 2.5 cache reads at 10% of input, not 25% Google publishes context caching for every Gemini 2.5 model at 10% of the input price: 2.5 Pro $1.25/M in -> $0.125/M cached (10%) 2.5 Flash $0.30/M in -> $0.03/M cached (10%) 2.5 Flash-Lite $0.10/M in -> $0.01/M cached (10%) 2.5 Flash-Lite $0.30/M audio in -> $0.03/M cached audio (10%) 25% is the deprecated Gemini 2.0 Flash ratio ($0.10 in / $0.025 cached). 2.0 Flash was shut down on 2026-06-01; the 2.5 rows kept its number. All four Gemini 3.x models in this repo already use 0.1, and the audio block inside gemini-2.5-flash already reads 0.1, so this restores the repo's own convention rather than introducing one. cachedInput: 0.25 elsewhere (openai gpt-4.1 / o3 / o4 / gpt-5.1, xai) is correct for those providers and is left untouched. Snapshot regenerated with jest -u; packages/__tests__/cost is green (13 suites, 190 tests). --- .../__snapshots__/registrySnapshots.test.ts.snap | 16 ++++++++-------- .../google/gemini-2.5-flash-lite/endpoints.ts | 8 ++++---- .../authors/google/gemini-2.5-flash/endpoints.ts | 4 ++-- .../authors/google/gemini-2.5-pro/endpoints.ts | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap b/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap index ab023ddc00..1dd95cb90a 100644 --- a/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap +++ b/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap @@ -8871,7 +8871,7 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` "input": 0.000001, }, "cacheMultipliers": { - "cachedInput": 0.25, + "cachedInput": 0.1, "write5m": 1, }, "cacheStoragePerHour": 0.000001, @@ -8901,7 +8901,7 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` "input": 0.000001, }, "cacheMultipliers": { - "cachedInput": 0.25, + "cachedInput": 0.1, "write5m": 1, }, "cacheStoragePerHour": 0.000001, @@ -8915,11 +8915,11 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` "google-ai-studio": [ { "audio": { - "cachedInputMultiplier": 0.0833333, + "cachedInputMultiplier": 0.1, "input": 3e-7, }, "cacheMultipliers": { - "cachedInput": 0.25, + "cachedInput": 0.1, "write5m": 1, }, "cacheStoragePerHour": 0.000001, @@ -8938,11 +8938,11 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` "vertex": [ { "audio": { - "cachedInputMultiplier": 0.0833333, + "cachedInputMultiplier": 0.1, "input": 3e-7, }, "cacheMultipliers": { - "cachedInput": 0.25, + "cachedInput": 0.1, "write5m": 1, }, "cacheStoragePerHour": 0.000001, @@ -8956,7 +8956,7 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` "google-ai-studio": [ { "cacheMultipliers": { - "cachedInput": 0.25, + "cachedInput": 0.1, "write5m": 1, }, "cacheStoragePerHour": 0.0000045, @@ -8980,7 +8980,7 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` "vertex": [ { "cacheMultipliers": { - "cachedInput": 0.25, + "cachedInput": 0.1, "write5m": 1, }, "cacheStoragePerHour": 0.0000045, diff --git a/packages/cost/models/authors/google/gemini-2.5-flash-lite/endpoints.ts b/packages/cost/models/authors/google/gemini-2.5-flash-lite/endpoints.ts index ccc372dc1c..9466877c77 100644 --- a/packages/cost/models/authors/google/gemini-2.5-flash-lite/endpoints.ts +++ b/packages/cost/models/authors/google/gemini-2.5-flash-lite/endpoints.ts @@ -14,10 +14,10 @@ export const endpoints = { output: 0.0000004, audio: { input: 0.0000003, // $0.30/1M audio input tokens - cachedInputMultiplier: 0.0833333, // $0.025/1M cached audio (8.33% of input) + cachedInputMultiplier: 0.1, // $0.03/1M cached audio (10% of input) }, cacheMultipliers: { - cachedInput: 0.25, + cachedInput: 0.1, // $0.01/1M = 10% of input write5m: 1.0, }, cacheStoragePerHour: 0.000001, @@ -60,10 +60,10 @@ export const endpoints = { output: 0.0000004, audio: { input: 0.0000003, // $0.30/1M audio input tokens - cachedInputMultiplier: 0.0833333, // $0.025/1M cached audio (8.33% of input) + cachedInputMultiplier: 0.1, // $0.03/1M cached audio (10% of input) }, cacheMultipliers: { - cachedInput: 0.25, + cachedInput: 0.1, // $0.01/1M = 10% of input write5m: 1.0, }, cacheStoragePerHour: 0.000001, diff --git a/packages/cost/models/authors/google/gemini-2.5-flash/endpoints.ts b/packages/cost/models/authors/google/gemini-2.5-flash/endpoints.ts index b67da68ca0..29f17df2d4 100644 --- a/packages/cost/models/authors/google/gemini-2.5-flash/endpoints.ts +++ b/packages/cost/models/authors/google/gemini-2.5-flash/endpoints.ts @@ -17,7 +17,7 @@ export const endpoints = { cachedInputMultiplier: 0.1, // $0.1/1M cached audio (10% of input) }, cacheMultipliers: { - cachedInput: 0.25, + cachedInput: 0.1, // $0.03/1M = 10% of input write5m: 1.0, }, cacheStoragePerHour: 0.000001, @@ -63,7 +63,7 @@ export const endpoints = { cachedInputMultiplier: 0.1, // $0.1/1M cached audio (10% of input) }, cacheMultipliers: { - cachedInput: 0.25, + cachedInput: 0.1, // $0.03/1M = 10% of input write5m: 1.0, }, cacheStoragePerHour: 0.000001, diff --git a/packages/cost/models/authors/google/gemini-2.5-pro/endpoints.ts b/packages/cost/models/authors/google/gemini-2.5-pro/endpoints.ts index 475630a94a..f55684b777 100644 --- a/packages/cost/models/authors/google/gemini-2.5-pro/endpoints.ts +++ b/packages/cost/models/authors/google/gemini-2.5-pro/endpoints.ts @@ -13,7 +13,7 @@ export const endpoints = { input: 0.00000125, output: 0.00001, cacheMultipliers: { - cachedInput: 0.25, + cachedInput: 0.1, // $0.125/1M = 10% of input write5m: 1.0, }, cacheStoragePerHour: 0.0000045, @@ -60,7 +60,7 @@ export const endpoints = { input: 0.00000125, output: 0.00001, cacheMultipliers: { - cachedInput: 0.25, + cachedInput: 0.1, // $0.125/1M = 10% of input write5m: 1.0, }, cacheStoragePerHour: 0.0000045,