ospalabs
Free tool

LLM budget calculator

Start from the budget instead of the bill: how many requests does $25 a day, or $500 a month, actually buy on the model you use? And how many if every reply runs to max_tokens?

Budget
The most a reply is allowed to be
Typical request
$0.00144
Worst case (full max_tokens)
$0.00735
Requests per day, typical
17,361
Requests per day, if every reply hits max_tokens
3,399

Your $25.00 a day buys about 17,361 typical requests. But before a reply is written, nobody knows how long it will be, so a hard limit has to hold the worst case: $0.00735, 5.1× the typical cost. Lowering max_tokens toward what you really need lets more requests run side by side under the same budget.

How it works

Typical vs worst case

A typical request uses the reply length you usually see. The worst case assumes the model writes all the way to max_tokens. Both use the same input size and the model's current prices.

Why the worst case matters

Before a reply is written, nobody knows how long it will be. A spending limit that's checked before a request is sent has to hold back the worst case, then release the difference when the real usage comes back.

Lowering max_tokens

Setting max_tokens close to what you need shrinks the worst case. More requests fit under the same budget at once, and a runaway reply can't cost more than you planned.

Want these numbers enforced instead of estimated? Put a hard dollar ceiling on your API keys · or see all free tools.

Questions

How do I set a daily budget for an LLM API?
Most providers only offer monthly limits or alerts. Fuse lets you set a daily and a monthly dollar ceiling per project and refuses the request that would cross it.
What max_tokens should I use?
A bit above the longest reply your feature really needs. Look at the usage of real responses and leave some room, rather than using the model's maximum.
Does max_tokens change what I pay?
You pay for the tokens actually written, not the cap. The cap changes the worst case, which is what a hard limit has to plan for.