TL;DR My coding-interview prep app has a "Generate Visualization" button . Click it on any algorithm problem and Claude Sonnet 4.5 produces a self-contained interactive widget that teaches it β a sliding-window expanding, a two-pointer racing, a DP table filling cell by cell. (That's what the GIF above is showing.) At naive implementation, each click cost me about $0.08 . Workable for Pro subscribers. Ruinous if I let free-tier users click freely. Through five cost decisions β tiering the call path, prompt caching, output capping, a Haiku gatekeeper, and a Groq fallback on regenerations β I got the per-click cost to $0.029 and pushed free-tier users to a $0-marginal-cost path entirely. If you're building anything with a "Generate with AI" button in a freemium product, these are the moves that matter before you ship. The product problem I'm building Crackly β a DSA interview prep tool. 474 problems, each with an "AI Visual" panel.β¦