HNHacker News
TopNewBestAskShowJobs

ahmed_hassan7

6 karma · joined July 11, 2026

Building periphcheck.com — browser-based hardware testing tools Building costperprompt.com — live AI API pricing & cost calculators
submissionscomments
ahmed_hassan7··on Show HN: CostPerPrompt – Live AI API pricing and real-workload cost calculators
Author here — great question, and you've hit the exact reason the calculator uses an adjustable cache-hit ratio (default ~70%) instead of assuming 100%: real hit rates depend on session gaps, and TTLs differ a lot by provider.

Rough current state: OpenAI's automatic caching typically keeps prefixes warm for ~5–60 min depending on load; Anthropic's default cache TTL is 5 min (extendable to 1h for an extra write fee); Gemini's explicit caches let you set your own TTL with per-hour storage pricing. So your 20-minute coffee break is usually fine on OpenAI, a cold cache on default Anthropic, and whatever you paid for on Gemini.

Adding an "average gap between messages" input that derates the hit rate per provider is a really good idea — putting it on the list. Thanks!