LLM budgets and spend caps
Limits that hold under load: each request reserves its maximum cost before it is served, so requests running at the same time cannot together pass a budget.
How LLM spend is capped
An LLM budget is a limit on what a team, an application or a single key may spend on model calls in a period. Most gateways count spend after each response arrives, so a burst of concurrent requests can overshoot the limit before the count catches up. Inferbase checks before serving: each request reserves its maximum possible cost, from its input and its max_tokens, and is admitted only if that fits in what is left.
The reservation is settled to the actual cost when the answer completes. A request whose maximum cost does not fit is refused with a 402 that says which limit it met, so the caller can ask for less output or wait for the period to reset.
Where a limit can be set
Project budget
A hard monthly limit across every key in a project. Reached, the project’s requests get a 402 until the month rolls over or the budget is raised.
Key spend caps
A daily cap (UTC) and a monthly cap per API key. Use the daily cap on keys that run unattended, such as agents or a public chat.
Session limits
A routing policy can cap the requests and the spend of one session, so a single agent run cannot run away.
Organization budget
A monthly budget with a warning threshold that raises events without blocking, for finance visibility across projects.
Knowing before the invoice
Events
Budget warning, budget exceeded, key spend cap reached and project budget reached, in the portal and to owners and admins.
Webhooks
The same events as signed JSON to an endpoint you run, to page someone or open a ticket.
Usage by project and key
Spend broken down by project, key and model, with the cost of each request on its record.
What is counted
What Inferbase charges: managed inference, guardrail checks and requests past the plan. Usage on your own provider key or cloud account is billed by that provider and not counted.
FAQ: LLM budgets and spend caps
Set a monthly budget on a project for a hard limit across its keys, and a daily or monthly spend cap on individual keys. Both are checked before a request is served, and a request that would pass a limit is refused with a 402.
No. Each request reserves its maximum cost against the budget and the key’s caps when it starts, and is admitted only if that reservation fits in what is left, so requests running at the same time cannot together pass the limit.
Because its maximum cost did not fit in what was left. A request’s maximum cost comes from its input and its max_tokens; asking for less output, or choosing a cheaper model, lets it fit.
No. Budgets and caps count what Inferbase charges. Requests served on your own provider key or cloud account are billed by that provider to you; set limits there for that spend.
Put intelligence in the middle.
Start on the free plan with 5,000 requests a month, no card required.