Skip to main content
AI Gateway · Cost control

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.

Definition

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.

Limits

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.

Signals

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

FAQ: LLM budgets and spend caps

Put intelligence in the middle.

Start on the free plan with 5,000 requests a month, no card required.