{"slug": "how-i-got-a-340-aws-bill-from-a-side-project-and-what-i-built-to-prevent-it", "title": "How I Got a $340 AWS Bill from a Side Project (And What I Built to Prevent It)", "summary": "A developer received a $340 AWS bill for a side-project LLM summarization tool after underestimating costs due to system prompt tokens and higher-than-expected usage. To prevent such surprises, they built APICalculators.com, a set of 16 free browser-based calculators that compare costs across LLM APIs, vector databases, serverless platforms, auth providers, and payment processors. The calculators run client-side with no signup required.", "body_md": "The invoice arrived on a Tuesday morning.\n\n$340. For a side project I'd built in a weekend. A small LLM-powered summarization tool — users paste text, model returns a summary. I'd done the math before launching: roughly $0.002 per request, ~500 requests/day, around $30/month. Totally fine.\n\nWhat I hadn't accounted for:\n\nsystem_prompt_tokens = 800\n\nrequests_per_day = 2000 # not 500 — it went viral in a group chat\n\ninput_price_per_1M = 2.50 # GPT-4o\n\ndaily_cost = (800 * 2000 / 1_000_000) * 2.50\n\nPlus the actual user input tokens. Plus output tokens. $340 later, I had learned my lesson.\n\nThe Real Problem: API Pricing Is Designed to Be Hard to Compare\n\nEvery provider uses different units:\n\nOpenAI → per million tokens (input vs output, different rates)\n\nPinecone → read units + write units + storage GB/month\n\nStripe → % of transaction + fixed fee + monthly platform fee\n\nAWS Lambda → per GB-second + per request + data transfer\n\nNone of it is comparable at a glance. You end up either building a spreadsheet from scratch every time or just guessing — and guessing gets expensive.\n\nWhat I Built\n\nAfter the invoice incident I started keeping a cost estimation spreadsheet. It grew. Eventually I turned it into APICalculators.com — 16 free, browser-based calculators covering the infrastructure decisions most AI/SaaS developers face:\n\nLLM APIs\n\nGPT-4o, Claude Sonnet, Gemini Flash, Llama — cost by model, context length, daily volume\n\nSide-by-side comparison at your exact usage\n\nVector Databases\n\nPinecone vs Qdrant vs Supabase vs Weaviate\n\nEnter index size + queries/day → monthly cost\n\nServerless\n\nAWS Lambda vs Cloudflare Workers vs Vercel Functions\n\nCost at your invocation volume and memory config\n\nAuth Providers\n\nClerk vs Auth0 vs Supabase Auth vs Cognito\n\nMonthly cost by MAU tier\n\nPayment Processors\n\nStripe vs Paddle vs Lemon Squeezy\n\nReal fee comparison on your transaction volume\n\nThe System Prompt Problem, Solved in 30 Seconds\n\nHere's what the LLM cost calculator would have shown me before I shipped:\n\nModel: GPT-4o\n\nSystem prompt: 800 tokens\n\nAvg user input: 200 tokens\n\nAvg output: 150 tokens\n\nRequests/day: 2,000\n\n→ Input cost: (800+200) × 2,000 / 1M × $2.50 = $5.00/day\n\n→ Output cost: 150 × 2,000 / 1M × $10.00 = $3.00/day\n\n→ Monthly: $240\n\nvs my estimate of $30. 8x off.\n\nThe fix was obvious once I saw it: cache the system prompt, shorten it, switch to a cheaper model for summarization. Cut the cost by 70%.\n\nEverything Runs in Your Browser\n\nNo signup. No data sent anywhere. All calculations happen client-side — your usage numbers never leave your machine.\n\nIf you're building anything that touches LLM APIs, vector databases, or cloud infrastructure, check your numbers before you ship.\n\nSurprise invoices are optional.\n\nWhat's the most unexpected cloud bill you've received? Drop it in the comments.", "url": "https://wpnews.pro/news/how-i-got-a-340-aws-bill-from-a-side-project-and-what-i-built-to-prevent-it", "canonical_source": "https://dev.to/muhammed_aliceylan_db433/how-i-got-a-340-aws-bill-from-a-side-project-and-what-i-built-to-prevent-it-gi3", "published_at": "2026-06-19 15:37:59+00:00", "updated_at": "2026-06-19 16:07:44.178723+00:00", "lang": "en", "topics": ["large-language-models", "developer-tools", "ai-infrastructure"], "entities": ["OpenAI", "Pinecone", "AWS Lambda", "Cloudflare Workers", "Vercel", "Clerk", "Auth0", "Stripe"], "alternates": {"html": "https://wpnews.pro/news/how-i-got-a-340-aws-bill-from-a-side-project-and-what-i-built-to-prevent-it", "markdown": "https://wpnews.pro/news/how-i-got-a-340-aws-bill-from-a-side-project-and-what-i-built-to-prevent-it.md", "text": "https://wpnews.pro/news/how-i-got-a-340-aws-bill-from-a-side-project-and-what-i-built-to-prevent-it.txt", "jsonld": "https://wpnews.pro/news/how-i-got-a-340-aws-bill-from-a-side-project-and-what-i-built-to-prevent-it.jsonld"}}