Cost‑engineering an "AI Generate" button in a freemium product (from $0.08 to $0.029 per click)
说明与用途
通过成本工程,将 freemium 产品中 AI 生成按钮的每次点击成本从 0.08 美元降至 0.029 美元,消除了免费用户的费用,并将付费用户的毛利率提升至 96%。
问题
A freemium coding‑prep app’s AI‑generated visualizations cost ~$0.08 per click, making free‑tier usage unsustainable and eroding margins for paid users.
结果
Reduced per‑click AI cost from $0.08 to $0.029, eliminating free‑tier cost and increasing Pro user gross margin from ~90% to ~96%.
工作流
- 1. Detect user tier; if free, serve cached visualization or preview without calling Claude.
- 2. For Pro users, check cache; if miss, call Claude with cached system prompt and problem description.
- 3. Use prompt caching to reduce input token cost to ~$0.00084 per hit.
- 4. Apply output constraints and max_tokens=3500 to limit output to ~1,850 tokens, saving ~$0.032 per call.
- 5. For regenerations 1–5, route to Groq Llama 3.3 70B; beyond that, rate‑limit.
- 6. Run a Haiku classification pass offline to filter out non‑visualization‑worthy problems, saving ~13% of calls.
- 7. Store successful visualizations in DB for future cache hits.
证据
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 … I got the per‑click cost to $0.029 and pushed free‑tier users to a $0‑marginal‑cost path entirely.
Free users never trigger Claude.
Prompt caching charges ~10% of full input‑token price on cache hits.
Output tokens cost 5x more than input tokens on Sonnet 4.5.
- 记录日期: 2026-09-06T02:52:53.239Z