Skip to content
Back to news
9/14/2026

Per-Key Spend Limits Arrive in the Gateway Portal

API keys in the AI Gateway can now carry an optional lifetime spend cap, set and edited from the Gateway Portal dashboard.

ai-gatewaybillingapi-keys

You can now put a lifetime spend ceiling on an individual API key in the AI Gateway — useful if you're issuing a key to a contractor, a side project, or a script you don't want to babysit.

What's new

When you create an API key in the Gateway Portal, there's now an optional "spend limit, credits" field. Set it, and that key stops working — with a clear error, not a generic "not enough credits" message — the moment its lifetime spend hits the cap. Leave it blank and the key behaves as it always has, unlimited.

Existing keys aren't left out: each one in your key list now shows what it's spent against its limit (or "spent · no limit" if none is set), as a button that opens an inline editor. Change the number, or clear it back to unlimited, without touching the key itself — no need to revoke and reissue.

How it's enforced

This is a genuinely new mechanic under the hood, not just a UI label. The gateway maintains a running total of what each key has actually spent — tracked from settled cost, not the worst-case estimate reserved up front — and checks it against the limit before a request is allowed to proceed. It's a lifetime cap, matching how OpenRouter's own per-key credit limits work, rather than a monthly or recurring budget. If you want a fresh allowance later, you raise or clear the limit yourself.

The underlying columns landed via a database migration first, with the enforcement logic and the customer-facing API (create, read, and update a key's limit) following in the same push, and the Portal's UI shipping alongside.

Where to find it

Gateway Portal → your API keys. Both the create-key form and each key's row now carry the spend-limit controls.