LLM Pricing Data

A living version of Appendices A and B (model tier pricing, cache discounts, and provider differences) plus a cross-provider table covering Anthropic, OpenAI, Google, and xAI that the book doesn't print. Updated as providers change their pricing; the book's printed tables are a snapshot, this page isn't.

Last verified: July 2026 , matches the book's current edition
Appendix B

Model Tier Pricing

Representative rates by capability tier. All figures per million tokens.

TierInput $/MOutput $/MCached $/MTypical Latency (500 tok)
Fast (Haiku-class)$1.00$5.00$0.10~300ms
Mid (Sonnet-class)$3.00$15.00$0.30~800ms
Premium (Opus-class)$5.00$25.00$0.50~1,500ms

Anthropic pricing, current as of this edition. Substitute the equivalent tier from your provider: the ratios (output ≈5x input, cached ≈0.1x input) are the durable part.

Live: not in the book

Cross-Provider Model Pricing

The book's tables use Anthropic's Fast/Mid/Premium framework throughout. It doesn't print competitor $/M rates, since they'd be stale before the ink dried. This table does, and gets updated when providers change theirs.

ProviderModelTierInput $/MCached $/MOutput $/M
AnthropicClaude Haiku 4.5Fast$1.00$0.10$5.00
OpenAIGPT-5.6-LunaFast$1.00$0.10$6.00
GoogleGemini 3.1 Flash-LiteFast$0.25$0.025$1.50
xAIGrok 4.1 FastFast$0.20$0.50
AnthropicClaude Sonnet 5 (intro, thru Aug 31 '26)Mid$2.00$0.20$10.00
OpenAIGPT-5.6-TerraMid$2.50$0.25$15.00
GoogleGemini 3.5 FlashMid$1.50$0.15$9.00
xAIGrok 4.3Mid$1.25$2.50
Moonshot AIKimi K3 (NEW)Mid$3.00$0.30$15.00
AnthropicClaude Opus 4.8Premium$5.00$0.50$25.00
OpenAIGPT-5.6-SolPremium$5.00$0.50$30.00
GoogleGemini 3.1 Pro (Preview)Premium$2.00$0.20$12.00
xAIGrok 4.5Premium$2.00$0.50$6.00
AnthropicClaude Fable 5 (NEW)Frontier$10.00$1.00$50.00

"—" means the provider hadn't published a cached-input rate for that model at verification time. Tier assignment (Fast/Mid/Premium) is this page's mapping onto Anthropic's framework, not an official designation. Frontier is a new tier as of July 2026: Anthropic shipped Claude Fable 5 (and a limited-availability Mythos 5) at roughly 2x Opus pricing; OpenAI, Google, and xAI haven't released a comparable above-flagship tier yet. Claude Sonnet 5's introductory pricing ($2/$10) reverts to standard pricing ($3/$15, cached $0.30) on September 1, 2026. Kimi K3 (Moonshot AI, announced July 16, 2026) is the first open-weight model in this table: full open weights are due July 27, 2026; the rate shown is Moonshot's own hosted API, not a third-party reseller (OpenRouter, for example, doesn't currently pass through the cached-input discount).

Appendix A

Provider Differences

Pricing, caching behavior, and model capabilities vary across providers. These differences affect architecture decisions.

FeatureAnthropic (Claude)OpenAI (GPT)Google (Gemini)
Prompt cachingAutomatic with cache breakpointsManual with cached_contentContext caching via API
Cache pricing90% discount on cached input50-90% discount (90% on newest models)75% discount on cached input
Cache TTL5 min default (auto-extends on use); 1 hr optionalAutomatic; retained up to 24 hr on current modelsUp to 1 hour
Output cost ratio5x input cost, uniform across tiers~8x input cost on flagship models2-4x input cost
StreamingSSE with tool useSSE with function callingSSE with grounding
Max context1M (200K on fast tier)1M+ across current model family1M+ tokens
Fast tier modelHaikuGPT mini / nano classFlash

Verify output cost ratio and cache discount against the provider's current price sheet before relying on it for planning.

Chapter 5

Cache Implementation Differences

Prompt caching mechanics differ enough to change how you structure requests, not just what they cost.

FeatureAnthropic (Claude)OpenAI (GPT-5 series)AWS Bedrock
Minimum cache sizeModel-dependent, ~1K–4K tokens1,024 tokensModel-dependent, ~1K–4K tokens (mirrors Anthropic)
Default TTL5 min (1-hour extended tier available)Up to 24 hours (default since mid-2026)5 min (1-hour extended tier available)
Max breakpoints4AutomaticVaries by model
Cache marker syntax"cache_control": {"type": "ephemeral"}Automatic prefix caching"cache_control": {"type": "ephemeral"}
Pricing: cache write1.25x input price (5-min TTL); 2x (1-hour TTL)Included1.25x input price (5-min TTL); 2x (1-hour TTL)
Pricing: cache read0.1x input price0.1x input price (~0.25x on GPT-4.1-era models)0.1x input price

Pricing and features change. Verify with your provider's current documentation before implementation.

Read Before You Plan Around These Numbers

Design Rule Do not hardcode provider-specific behavior. Abstract model calls behind a common interface so the system can switch providers or use multiple providers for different tiers. Cache behavior is the most provider-dependent feature. Test cache hit rates on actual traffic patterns, not synthetic benchmarks.
Invariant Provider pricing and capabilities change frequently. The architectural principles (cache what is static, filter what is irrelevant, tier by task complexity) remain stable across providers. Design for the principles; configure for the provider.

These three tables are Appendices A and B, plus one table from Chapter 5. The book has 59 more, including the reference architecture that turns these numbers into a deployable cost model.

Buy on Amazon →