Default-to-zero: a model-name mismatch silently wiped all LLM costs to $0

Atm1n9 · reddit · 2026-10-26

A dev building a tool that prices LLM API calls per feature, model, and customer hit a silent failure: the integration sent "gemini" but the price table stored models under "google", so the lookup failed, cost defaulted to $0, status said success, and nothing was logged. Costs are computed once at request time, so adding prices later didn't fix those rows.

Key insight: an overcharge gets noticed, but a zero looks like a free request — you only find out when the provider invoice disagrees.

Fixes applied:

Suggested self-audit: count rows costing exactly $0 in your logs and check how many are genuinely free — default-to-zero is probably in a lot of codebases.

Original post →

More from coding & agent

coding & agent channel →