Once in a while someone on the team writes up a mistake worth keeping. This one is about billing, from the engineer who lived it.

The scary part of launching an AI SaaS is not the empty launch day. It's the first week when real people start paying, burning credits, retrying requests, asking for refunds, running cron jobs, and finding every shortcut you left in the billing code.

Usage-based billing sounds simple when it's a pricing page. It gets messy when every AI action costs money, every retry can double-charge someone, and every support ticket starts with a number your database cannot explain.

My first credit system was one column on the users table: credits. Buy a pack, it goes up. Run a generation, it goes down. I built it in an afternoon and felt clever about how little code it took.

It held up right until real money showed up. One Tuesday I opened the billing dashboard to a refund, a chargeback from a name I didn't recognize, and a buyer who'd been charged twice because his request timed out and retried. Then an email landed that I still remember word for word: