by techlessons | 2026-02-10 00:52:38+00:00
A cautionary tale for anyone using AI assistants to write code that touches paid APIs

I'm Usually Paranoid About Costs
Let me start by saying: I'm the guy who reads the fine print.

I've been building a community business directory—a passion project to help connect diaspora-owned businesses across my country. When I planned this project, I obsessed over every cost. I have a 3,800-line requirements document where I compared hosting providers, rejected options that cost $10-20/month in favor of free tiers, and proudly calculated my total operating cost: $1/month.

Yes, one dollar. I chose Vercel (free tier), Supabase (free tier), Cloudinary (free tier), Resend (free tier). I documented why I rejected Railway.app ("more expensive than Vercel free tier"), DigitalOcean ("no free tier"), and Render.com ("free tier sleeps").
I'm not bragging. I'm setting up the irony of what comes next.

The Task That Seemed Simple

To populate my directory, I needed to find businesses owned by my community across major cities. Manually searching would take weeks. So I asked my AI assistant to help me write a Python script to query Google's Places API.

The AI was helpful. It wrote a comprehensive script with batch processing, retry logic, rate limiting, and even a cost estimation feature. Before running it, I asked: "How much will this cost?"

The AI calculated: ~$89 for the full run.

Text Search API calls at $0.032 per call. Math checked out. Seemed reasonable for the value I'd get.

I ran the script.

The First Sign of Trouble

The script worked beautifully. It found thousands of businesses. I was excited—this was exactly what I needed.

Then I checked my Google Cloud billing dashboard.
$3.98
That's what the billing report showed. Strange, but okay—maybe it just hadn't updated yet.

Then I clicked on "Payment Overview."
$443.43
My stomach dropped.

I refreshed. $504.57

I killed the script immediately. But the damage was done.

What Went Wrong

Here's what I learned in the panicked hours that followed:

The AI's cost estimate only counted one type of API call.

When you search for businesses using Google's Places API, you make a Text Search call ($0.032). But for each business returned, if you want details like ratings, phone numbers, or hours, you make another call—a Place Details call ($0.017).

My script found 20,000+ businesses. That's not 2,800 API calls. That's 2,800 searches + 20,000 detail lookups.

The AI didn't account for this. And I didn't check.

The billing dashboard lies (temporarily).

Google's billing reports lag 24-48 hours. The "Billing Reports" page showed $3.98. The "Payment Overview" showed the real number: $504. If I had only looked at the reports, I would have kept running the script.

The worst part? Of those 20,000+ businesses, fewer than 1,000 were actually relevant to my project. The rest were false positives—businesses that matched my search terms but weren't actually what I was looking for.

I paid $505 for data I couldn't even use.

The Freak Out

I'm not going to pretend I handled this gracefully.

I'm currently unemployed—laid off last year and still trying to land on my feet. I have two young kids. We're living on a tight budget. $505 isn't "oops, that sucks" money for me right now. It's "how do we pay for groceries" money.

I stayed up that night researching. Reddit threads about Google Cloud billing nightmares. Stories of students hit with $55,000 bills. Articles about "goodwill adjustments." I learned that Google sometimes waives charges for first-time users who make honest mistakes.

I also learned that sometimes they don't.