DE EN FR ES IT

Production & AI tools

AI cost cap

Also: cost gate, spending cap

An AI cost cap is a technical gate that every paid call to an image, voice or music model has to pass. It checks the cache, the price and the budget before any money is spent, and logs every item.

Background

Generative tools bill per image, per character or per minute. Single calls are cheap, but scripts running in loops, retries after errors and forgotten test runs add up quickly. If you only see costs on the invoice, you can no longer control them.

A cost cap therefore puts fixed steps in front of every call. If the result is already cached, it costs nothing. Live calls must be switched on explicitly. The price is calculated up front and checked against a budget. Only then does the request go out, and the item is written to a log.

Common mistakes: scripts that bypass the cap and call the provider directly; API keys that end up in files or logs; budgets with no buffer for retries. Every job should start with a dry run that only shows the expected cost.

How we do it

Every paid AI call in our games goes through one shared tool, in this order: cache, live-call switch, price, cost cap, cost log. The cache works on a hash of the prompt, so an identical job costs nothing the second time. API keys are only loaded into the environment of the one process at runtime.

We introduced this the hard way. The first generation runs for Spätlese 404 on 8 November 2026 went straight to the providers, and the costs had to be estimated afterwards from volumes and list prices (229.14 cents at list price, 277.60 cents conservatively). Since 9 November 2026 the old scripts are locked. FaxFight logged 257.40 cents through the gate for all its images, voices and music.

Related terms