Budgets for API keys on AI Gateway
Set spend caps on AI Gateway API keys to control costs and prevent budget overruns. Keys can be configured with dollar limits and optional refresh periods (daily, weekly, monthly, or none) via the dashboard or CLI, applying across all providers and models.
AI costs are getting harder to forecast. As teams lean more on coding agents and other token-heavy workflows, a key can burn cost faster than anyone notices:
Set a spend cap on any key, and rejects further requests on that key once the limit is exceeded, until the budget resets or you raise it. The cap applies to all AI Gateway providers and models running through the key, making it easier to consolidate and govern AI costs.AI Gateway
On the , click , enable the option, enter a limit in dollars, and choose a refresh period.AI Gateway API Keys pageCreate KeySpend Quota
You can also edit existing keys and add, change, or remove budgets by clicking the right hand side ... menu and .Edit Key
Create a budgeted API key programmatically via the Vercel CLI. The format is:
Pair a key with an optional refresh period (, , , or ) to scope the limit to a window. Each period resets at the start of its window in UTC.dailyweeklymonthlynone
Keys created programmatically will also appear in your team , so you can see all keys in one place. AI Gateway API Keys view
Read the for more information about setting and using budgets for API keys. API keys documentation
Autonomous workflows that can loop or fan out without supervision
Demos and prototypes that could catch unexpected traffic if shared or shipped
Developers exploring or experimenting without a sense of per-model cost
API key budgets in the Vercel Dashboard
API key budgets in the Vercel CLI
Source: original entry ↗