Bill Gemini 2.5 Pro at its current list rates

Cache reads are $0.125/M, and prompts over 200k tokens bill every rate at
the long-context tier ($2.50 in, $15 out, $0.25 cached).
This commit is contained in:
Daniel Salazar committed 2026-10-17 00:27:23 -04:00
1 parent 9843f26c84
commit dbf851badf
2 files changed
+30 -1

No files matched your search

@@ -612,6 +612,24 @@ describe('GeminiChatProvider pricing tiers', () => {
expect(listedCosts(entry, NOW)).toBe(entry.costs);
});
});
it('prices gemini-2.5-pro at its list rates on both sides of 200,000 tokens', () => {
const entry = GEMINI_MODELS.find((m) => m.id === 'gemini-2.5-pro')!;
const now = new Date('2026-10-14T12:00:00Z');
expect(costsForRequest(entry, 200_000, now)).toMatchObject({
prompt_tokens: 125,
completion_tokens: 1000,
thinking_tokens: 1000,
cached_tokens: 12.5,
});
expect(costsForRequest(entry, 200_001, now)).toMatchObject({
prompt_tokens: 250,
completion_tokens: 1500,
thinking_tokens: 1500,
cached_tokens: 25,
grounding_requests: 3_500_000,
});
});
});
// ── Non-stream completion ───────────────────────────────────────────
@@ -407,10 +407,21 @@ export const GEMINI_MODELS: IChatModel[] = [
prompt_tokens: 125,
completion_tokens: 1000,
thinking_tokens: 1000,
cached_tokens: 31,
cached_tokens: 12.5,
// Gemini 2.x grounding is $35 / 1,000 requests
grounding_requests: 3_500_000,
},
pricingOverrides: [
{
minPromptTokens: 200_000,
costs: {
prompt_tokens: 250,
completion_tokens: 1500,
thinking_tokens: 1500,
cached_tokens: 25,
},
},
],
max_tokens: 65_536,
},
{