Budgets for API keys on AI Gateway
TL;DR · AI Summary
Vercel 推出 AI Gateway API 密钥预算功能,可设置消费上限以控制 AI 成本。
Key Takeaways
- 设置 API 密钥预算后,AI Gateway 会在超出限额时拒绝请求。
- 预算适用于所有 AI Gateway 提供商和模型。
- 可通过 Vercel CLI 或仪表板创建和管理预算密钥。
Outline
Jump quickly between sections.
- §引言
AI 成本难以预测,Vercel 推出 API 密钥预算功能以控制成本。
设置预算后,AI Gateway 会在超出限额时拒绝请求。
预算适用于所有 AI Gateway 提供商和模型。
可通过 Vercel CLI 或仪表板创建和管理预算密钥。
Mindmap
See how the topics connect at a glance.
查看大纲文本(无障碍 / 无 JS 友好)
- AI Gateway API 密钥预算
- 功能机制
- 设置预算后拒绝请求
- 适用于所有 AI Gateway 提供商和模型
- 创建方式
- Vercel CLI
- Vercel 仪表板
Highlights
Key sentences worth saving and sharing.
设置预算后,AI Gateway 会在超出限额时拒绝请求。
预算适用于所有 AI Gateway 提供商和模型。
可通过 Vercel CLI 或仪表板创建和管理预算密钥。
Budgets for API keys on AI Gateway - Vercel
2 min read
Copy URL
Jun 9, 2026
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:
- 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
Set a spend cap on any key, and AI Gateway 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.
Link to heading API key budgets in the Vercel Dashboard
On the AI Gateway API Keys page , click Create Key , enable the Spend Quota option, enter a limit in dollars, and choose a refresh period.
You can also edit existing keys and add, change, or remove budgets by clicking the right hand side ... menu and Edit Key .
Link to heading API key budgets in the Vercel CLI
Create a budgeted API key programmatically via the Vercel CLI. The format is:
vercel ai-gateway api-keys create
--name
<
NAME
>
--budget
<
DOLLARS
>
--refresh-period
<
PERIOD
>Pair a key with an optional refresh period ( daily , weekly , monthly , or none ) to scope the limit to a window. Each period resets at the start of its window in UTC.
Keys created programmatically will also appear in your team AI Gateway API Keys view , so you can see all keys in one place.
Read the API keys documentation for more information about setting and using budgets for API keys.