<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo" -->

---
title: LLM Context Cost Modeling & Tiered Pricing Over 200k Tokens
description: A TypeScript library and CLI tool model nonlinear LLM context pricing across Anthropic, OpenAI, and Google APIs. It covers tiered pricing thresholds (e.g.,...
canonical: https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: LLM Context Cost Modeling & Tiered Pricing Over 200k Tokens | daily.dev
og:description: A TypeScript library and CLI tool model nonlinear LLM context pricing across Anthropic, OpenAI, and Google APIs. It covers tiered pricing thresholds (e.g.,...
og:url: https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo
og:image: https://api.daily.dev/og/posts/VEmeDtIlO.png
og:image:alt: LLM Context Cost Modeling & Tiered Pricing Over 200k Tokens
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# LLM Context Cost Modeling & Tiered Pricing Over 200k Tokens

**[SitePoint](https://daily.dev/sources/sitepoint)** · 18 min read · 0 upvotes · 0 comments

## Summary

A TypeScript library and CLI tool model nonlinear LLM context pricing across Anthropic, OpenAI, and Google APIs. It covers tiered pricing thresholds (e.g., Gemini's cost doubling above 128k tokens), prompt caching break-even math (Anthropic's break-even hit ratio can be as low as 1.4%), and a crossover calculator comparing long-context versus RAG costs, showing RAG can be roughly 40x cheaper at high query volumes with large corpora. Full source for pricing tiers, cost calculation, cache break-even, and RAG comparison functions is included alongside a Commander.js CLI with cost, cache-breakeven, and compare commands.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.sitepoint.com/modeling-llm-context-costs-tiered-pricing-beyond-200k-tokens>

## Questions this post answers

### Why does a 300k-token prompt cost more per token than a 100k-token prompt on Gemini?

Gemini pricing is tiered rather than flat: Gemini 1.5 Pro and 2.5 Pro charge $1.25 per million input tokens for prompts up to 128k tokens, then $2.50 per million above that threshold, doubling the effective input rate. Output pricing follows the same pattern, jumping from $5.00 to $10.00 per million tokens (Gemini 1.5 Pro) once the 128k boundary is crossed.

_Budgeting LLM spend against real usage patterns is easier with cost breakdowns like this surfaced on daily.dev._

### At what cache hit ratio does Anthropic prompt caching for Claude 3.5 Sonnet start saving money?

For Claude 3.5 Sonnet with a 200k-token prompt across 100 requests, the break-even hit ratio is just 1.4%, meaning a single cache write followed by only two cache hits already saves money. This is because Anthropic discounts cached reads by 90% off the base rate, even though it charges a 25% premium ($3.75 per million vs $3.00 base) on the initial cache write.

_Developers weighing whether prompt caching is worth implementing can track cost breakdowns like this via daily.dev._

### When is retrieval-augmented generation (RAG) cheaper than sending a full long context to an LLM?

RAG becomes cheaper at higher query volumes with large corpora, since each request processes only a few thousand retrieved tokens instead of the full corpus. At 500k tokens and 100 daily queries on Gemini pricing, RAG costs $3.45/day versus $140.00/day for long-context processing, though at fewer than 10 queries per day vector database hosting costs can make long context cheaper instead.

_Teams deciding between RAG and long-context architectures can follow cost-modeling breakdowns like this on daily.dev._

## Similar posts on daily.dev

- [LLM pricing is 100x harder than you think](https://daily.dev/posts/llm-pricing-is-100x-harder-than-you-think-kkrtkstrv) · portkey · 0 upvotes · 0 comments
- [How To Reduce LLM Token Costs by 70–90%](https://daily.dev/posts/how-to-reduce-llm-token-costs-by-70-90--lqaosovr2) · C\# Corner · 1 upvotes · 0 comments
- [Prompt Compression and Cache Tuning: Cut Your LLM API Costs by 60%](https://daily.dev/posts/prompt-compression-and-cache-tuning-cut-your-llm-api-costs-by-60--llr6ntsis) · SitePoint · 0 upvotes · 0 comments
- [5 Open-Source Tools to Control Your AI API Costs at the Code Level](https://daily.dev/posts/5-open-source-tools-to-control-your-ai-api-costs-at-the-code-level-wncyok6uu) · finout · 0 upvotes · 0 comments
- [OpenAI and Anthropic cut their LLM prices by up to 80% within a few months. Why?](https://daily.dev/posts/openai-and-anthropic-cut-their-llm-prices-by-up-to-80-within-a-few-months-why--qwjt9m0rl) · Max Woolf's Blog · 12 upvotes · 6 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#cli](https://daily.dev/tags/cli), [#rag](https://daily.dev/tags/rag), [#ai-inference](https://daily.dev/tags/ai-inference)

[View this post on daily.dev](https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"LLM Context Cost Modeling \u0026 Tiered Pricing Over 200k Tokens","url":"https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo"},"datePublished":"2026-09-14T21:12:13.725Z","dateModified":"2026-09-14T21:17:34.379Z","description":"A TypeScript library and CLI tool model nonlinear LLM context pricing across Anthropic, OpenAI, and Google APIs. It covers tiered pricing thresholds (e.g.,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/83d5a06597d447dbc26ed5ff63705046?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/83d5a06597d447dbc26ed5ff63705046?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"SitePoint","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SitePoint","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/sitepoint","url":"https://daily.dev/sources/sitepoint"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"typescript,cli,rag,ai-inference","timeRequired":"PT18M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SitePoint","item":"https://daily.dev/sources/sitepoint"},{"@type":"ListItem","position":3,"name":"LLM Context Cost Modeling \u0026 Tiered Pricing Over 200k Tokens"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/llm-context-cost-modeling-tiered-pricing-over-200k-tokens-vemedtilo#faq","mainEntity":[{"@type":"Question","name":"Why does a 300k-token prompt cost more per token than a 100k-token prompt on Gemini?","acceptedAnswer":{"@type":"Answer","text":"Gemini pricing is tiered rather than flat: Gemini 1.5 Pro and 2.5 Pro charge $1.25 per million input tokens for prompts up to 128k tokens, then $2.50 per million above that threshold, doubling the effective input rate. Output pricing follows the same pattern, jumping from $5.00 to $10.00 per million tokens (Gemini 1.5 Pro) once the 128k boundary is crossed. Budgeting LLM spend against real usage patterns is easier with cost breakdowns like this surfaced on daily.dev."}},{"@type":"Question","name":"At what cache hit ratio does Anthropic prompt caching for Claude 3.5 Sonnet start saving money?","acceptedAnswer":{"@type":"Answer","text":"For Claude 3.5 Sonnet with a 200k-token prompt across 100 requests, the break-even hit ratio is just 1.4%, meaning a single cache write followed by only two cache hits already saves money. This is because Anthropic discounts cached reads by 90% off the base rate, even though it charges a 25% premium ($3.75 per million vs $3.00 base) on the initial cache write. Developers weighing whether prompt caching is worth implementing can track cost breakdowns like this via daily.dev."}},{"@type":"Question","name":"When is retrieval-augmented generation (RAG) cheaper than sending a full long context to an LLM?","acceptedAnswer":{"@type":"Answer","text":"RAG becomes cheaper at higher query volumes with large corpora, since each request processes only a few thousand retrieved tokens instead of the full corpus. At 500k tokens and 100 daily queries on Gemini pricing, RAG costs $3.45/day versus $140.00/day for long-context processing, though at fewer than 10 queries per day vector database hosting costs can make long context cheaper instead. Teams deciding between RAG and long-context architectures can follow cost-modeling breakdowns like this on daily.dev."}}]}
```

