Skip to content

Build1 publisher2 min readPublished

Vercel's stacked AI Gateway budgets reject a request at whichever cap runs out first

AI Gateway Budgets went generally available with ceilings at team, project, key and teammate scope. The check runs at the start of each request, so a tight loop can finish slightly past the number you set.

The Engineer · Build desk

Illustration accompanying Vercel's stacked AI Gateway budgets reject a request at whichever cap runs out first

What happened

  • Vercel's AI Gateway Budgets are generally available, with the docs behind them last updated on September 7, 2026.
  • The feature caps spend at team, project, API-key or individual-teammate level, and the gateway rejects requests once a limit is reached.
  • Budgets stack, so a request from a project has to clear both its project budget and the team budget, and an exhausted budget at either scope rejects it outright.
  • A rejection comes back as a 402 with a quota_for_entity_exceeded type and the scope, spend and limit named in the message.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • cost Unlimited spend is the default state of an unconfigured gateway, and a ceiling costs nothing to add, so the bill from a runaway loop is now traceable to a setting nobody set.
  • constraint A team routing part of its traffic through its own provider keys has to enforce those caps at the provider, because Vercel budgets never see that spend.
  • decision Anyone who has been treating the 75 percent alert email as a brake needs a second, lower budget instead, since only the limit rejects requests.

With a $500 team ceiling and a $200 cap on one project, that project can spend $200 and the other $300 of team headroom stays available to everything else [16]. Two commands do it. `vercel ai-gateway budgets set team --limit 500 --refresh-period monthly` caps everything the team spends across every project and key [4]. `vercel ai-gateway budgets set project my-project --limit 200 --refresh-period monthly` scopes the tighter one [5].

The throwaway-credential case is the same idea with two different ceilings. `vercel ai-gateway api-keys create --name contractor --limit 50 --refresh-period none --expiration 30d` sets `--refresh-period none`, so the $50 covers the whole life of the key, and the key stops working after 30 days whatever it has spent [6].

Where I would temper expectations is the enforcement point. Vercel's docs, quoted in a dev.to walkthrough, say "the check runs at the start of each request, so the request that crosses the limit still completes and total spend can end up slightly over the budget" [7]. For one chat completion, the overshoot is rounding. For a batch job in a tight loop, the overshoot is whatever the loop already had in flight when the check flipped.

Timing matters at setup too. A new budget or key takes up to a minute or two before it is enforced, and spend starts appearing in the dashboard about 20 seconds after that [8]. Add them and roughly 140 seconds can pass between typing the command and watching a number move [9]. The dev.to walkthrough advises pulling the API key outright if you need spend stopped immediately [18].

That lag is also why the older control is not interchangeable with this one. Spend Management covers all of Vercel's metered resources, bandwidth and functions included, and it can pause your entire production deployment; Budgets never pauses a deployment [13]. The post says Pro-plan docs still point people at Spend Management, and that the two features get confused constantly [14].

What to watch

  • Whether Vercel moves the budget check to request completion, closing the overshoot window on batch loops.
  • Whether BYOK spend ever lands inside budget scope instead of being metered separately.
  • Whether the enforcement lag drops below the current minute or two, which is what makes budgets useless mid-incident.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories