Author explains GPT-4.1-mini token billing surprises

flaviocopes.com32 min read

The author explains that unexpected LLM API bills are driven by output-to-input price asymmetry, tokenization differences for code and non-English text, hidden overhead like tool schemas and system prompts, and quadratic multi-turn scaling. To control costs, developers should maintain stable prompt prefixes to preserve cache hit rates, use asynchronous Batch APIs for offline workloads, and implement application-level budget guards with hard dollar caps. Open article →