资产生成 Budgets and Spend Limits
A budget caps 资产生成 spend at one of four scopes:
- Team: everything your team spends, across every project and key.
- Project: what one project's deployments spend, through their OIDC tokens.
- API key: what one API key spends.
- User: what one team member spends, across every API key attributed to them.
资产生成 checks every budget in scope before each request and rejects further requests once a limit is exceeded, until the budget resets or you raise it. Budgets are optional, and a team, project, key, or member without one has unlimited spend.
To create, view, or delete the API keys themselves, see API Keys.
Budgets stack, and which ones apply depends on how a request authenticates. A request has to pass every budget in scope, so if any one is exceeded, 资产生成 rejects the request even when the others have room.
Take a team with all four budget scopes in use:
| Budget in scope | Limit | Spent this period |
|---|---|---|
Team acme | $500 | $110 |
Project storefront in team acme | $100 | $100 |
API key, attributed to member teammate | $50 | $10 |
Member teammate (user budget) | $40 | $10 |
A single request adds its cost to every budget in scope at once. A $1 request from a storefront deployment adds $1 to the project budget and $1 to the team budget, exactly as the diagram shows.
The totals above are cumulative, so they overlap rather than add up. The team's $110 is the project's $100 plus the key's $10, because each of those requests also counted toward the team. The key's $10 and teammate's $10 are the same $10, counted once against the key and once against the member it is attributed to.
Two requests against that team get different outcomes:
| Request | Budgets in scope | Outcome |
|---|---|---|
A deployment in storefront, using its OIDC token | Team, project | Rejected. The project budget is exhausted. |
| Any request using the API key | Team, API key, user | Succeeds. No project budget applies, and the rest have room. |
Each budget counts a specific set of authentication types:
- Team budget: API keys, OIDC tokens, app tokens, and personal access tokens
- Project budget: OIDC tokens from that project's deployments
- API key budget: that one API key
- User budget: API keys attributed to that team member
- No budget: BYOK provider keys
An API key's spend is never attributed to a project, no matter which project uses the key. Spending down a project budget requires an OIDC token from that project's deployments.
Each API key is also attributed to either your team or the member who created it. A key attributed to a member counts its spend toward both the team budget and that member's user budget; a key attributed to the team counts toward the team budget only. Only API keys carry this attribution, so OIDC tokens, personal access tokens, and app tokens never count toward a user budget. See Spend attribution to set it.
A default budget is a catch-all cap for one scope, with one default for projects, one for API keys, and one for team members:
- It applies to every project, key, or member without a custom budget, including ones that already exist and ones added later.
- Each covered resource gets its own allowance. A $50 API key default caps every covered key at $50 per period; it isn't $50 split across them.
- It never overrides a custom budget. The custom budget wins whether you set it before or after the default.
- Metering starts when the default takes effect. Spend from before that point doesn't count against it, so a key that has already spent $10,000 starts at $0 against a new $40 default.
A default takes effect as soon as you save it. 资产生成 caps every covered resource and lists it with the default's limit and a Default label. Spend shows as $0 until the resource's first request arrives, then starts filling in.
A default carries a limit and a refresh period only. It doesn't send spend alerts; set a custom budget on a resource to get alerts for it.
Removing a default lifts that cap from every resource it covered. After that, only the team budget still applies to them, if you've set one.
Each refresh period resets at the start of its window in UTC:
| Period | Resets at |
|---|---|
daily | Midnight UTC each day |
weekly | Monday at midnight UTC |
monthly | The first of the month at midnight UTC |
none | Never resets; the limit is cumulative |
Editing a budget keeps the spend already accumulated in the current period. Deleting a budget removes that cap immediately. A project, key, or member covered by a default budget falls back to the default rather than becoming unlimited. Re-creating a budget later starts metering from that point, not retroactively.
Once spend reaches the limit, 资产生成 rejects further requests for that scope with an HTTP 402 response until the budget resets or you raise it. The type is always quota_for_entity_exceeded, and the message names the scope that was exceeded along with its current spend and limit.
A team or project budget:
{
"error": {
"message": "Project budget exceeded. Current spend: $200.00, limit: $200.00. Please contact your administrator to increase the budget.",
"type": "quota_for_entity_exceeded"
}
}An API key budget:
{
"error": {
"message": "Quota limit exceeded for \"api_key_id_<your_key_id>\". Current spend: $10.00, limit: $10.00. Please contact your administrator to increase the quota.",
"type": "quota_for_entity_exceeded"
}
}A user budget rejects the same way once a member's user-attributed keys exceed it, with the message naming the user scope.
Handle a 402 in your client by backing off until the budget resets, or raise the limit.
SDK error classes can differ from the HTTP status. A budget rejection can surface as GatewayInternalServerError in 创意脚本 7 or ProviderInternalServerError in the Python beta. Check the quota details before retrying. See 创意脚本 error handling for handling SDK exceptions and streaming errors.
Spend alerts email someone as spend crosses a chosen percentage of the limit within a refresh period. They are off by default. When you add or edit a team, project, API key, or user budget, pick any combination of 50%, 75%, and 100% under Email ... when usage reaches. Each threshold you select fires at most once per period.
Who receives the email depends on the budget's scope:
| Budget scope | Alerts go to |
|---|---|
| Team or project | Team owners and members with the Billing role |
| API key | The key's creator |
| User | The team member whose budget it is |
Alerts are informational. Crossing a threshold below 100% never blocks requests.
Every team role except Contributor can see budgets. Owner, Member, Developer, Security, Viewer, and Billing all have read access to the Budgets page and its tabs.
Writing is more restricted. Besides the Owner role, an Owner can grant a member the 资产生成 Budget Manager permission from the team's member settings; it covers every budget action below without the rest of the Owner role.
| Action | Who can do it |
|---|---|
| View every budget, default, and spend | Every team role except Contributor |
| Create, edit, or remove the team budget | Owners and Budget Managers |
| Create, edit, or remove a project budget | Owners, Budget Managers, and that project's admins |
| Create, edit, or remove a user budget | Owners and Budget Managers |
| Add, change, or remove an API key budget | Owners and Members (anyone who can edit the key) |
| Set or remove a default budget (project, API key, or user) | Owners and Budget Managers |
| Change a key's spend attribution | Owners and Budget Managers |
API key budgets are the one exception to the Budget Manager grant. They follow key-editing permission, so a Budget Manager changes them through their base role rather than the grant.
These rules apply the same way whether you use the dashboard or the CLI.
The two scopes are independent, and you can use either or both:
- A team budget caps all 资产生成 spend across your team for the refresh period. When it is exceeded, every gateway request from your team is rejected until the budget resets.
- A project budget caps the spend attributed to one project. When it is exceeded, only that project's requests are rejected; the rest of your team is unaffected.
- Choose the scope. Open the Team tab for a team budget, or the Projects tab to pick a project.
- Add the budget. Click Add budget, enter a spending limit in dollars, and choose a refresh period.
- Save. The budget takes effect within a few minutes.
Set the team budget, or scope a budget to a single project by name or ID (every budget subcommand and flag is in the CLI reference):
vercel ai-gateway budgets set team --limit 500 --refresh-period monthly
vercel ai-gateway budgets set project my-project --limit 200 --refresh-period monthly✓ Set budget team
Limit $500
Refresh monthly| Flag | Description |
|---|---|
--limit <AMOUNT> | Spending limit in dollars (minimum $1). |
--refresh-period <PERIOD> | daily, weekly, monthly (default), or none. |
The Team and Projects tabs show each budget's spend against its limit with a usage bar. The Overview tab breaks spend down across every scope, and the team budget includes a spend history chart.
A budget inherited from the project default is labeled Default until you set a custom one.
vercel ai-gateway budgets list> Budgets
scope name limit spent refresh
team acme $500 $110.00 monthly
project storefront $100 $100.00 monthly- Find the budget. Open the Team tab or the Projects tab.
- Open the budget's menu. Find the budget and open its ··· menu.
- Edit or remove. Select Edit budget to change the limit, refresh period, or spend alerts. Select Remove budget to lift the cap.
Re-run budgets set with new values to change a budget. Removing one lifts that cap; a project covered by the project default falls back to it:
vercel ai-gateway budgets remove team
vercel ai-gateway budgets remove project my-project✓ Removed team budgetA default budget applies to every project without a custom budget, including projects that already exist. Setting a custom budget on a project overrides the default; see Default budgets for the full semantics. API keys have a separate default, covered in API key default budgets.
- Open the projects tab. Go to the Projects tab of the 资产生成 Budgets page.
- Set the project default. Click Set Default (or the current default value, if one is set) and enter a spending limit in dollars and a refresh period in the Project Default dialog.
- Save. Every project without its own budget now inherits this limit, shown as Default in the projects list.
vercel ai-gateway budgets set project --default --limit 200 --refresh-period monthly✓ Set default project
Limit $200
Refresh monthly
Applies to every project without its own budget, including existing onesList defaults with vercel ai-gateway budgets list --defaults, and remove the project default with vercel ai-gateway budgets remove project --default.
An API key budget caps how much a single key can spend, independently of any team or project budget. You manage it from the API Keys page or the CLI.
Add a budget at the time you create the key:
- Open the create-key dialog. On the 资产生成 API Keys page, click Create key.
- Enable a budget. Turn on the budget option and enter a spending limit in dollars.
- Choose a refresh period. Select how often the budget resets (see refresh periods).
- Save the key. Save the key, and copy its value immediately. You cannot retrieve it again.
vercel ai-gateway api-keys create --name my-api-key --limit 10 --refresh-period monthlyyour_new_api_key_here
> Success! API key my-api-key (key_123) created [212ms]| Flag | Description |
|---|---|
--limit <AMOUNT> | Spending limit in dollars (minimum $1). |
--refresh-period <PERIOD> | daily, weekly, monthly, or none (default). |
--expiration <PERIOD> | 7d, 30d, 60d, 90d, 1y, or none (default). |
--alert-thresholds <LIST> | Comma-separated subset of 50, 75, and 100, for example 75,100. |
To bound spend in time as well as amount, pair the budget with an expiration. Budgets never end on their own, so this is how you cap a contractor or experiment key in both dimensions. The key below allows at most $50 total, and stops working entirely after 30 days.
vercel ai-gateway api-keys create --name contractor --limit 50 --refresh-period none --expiration 30dOn the API Keys page, a budgeted key shows its spend against the limit (for example, $1.04 / $10 spent) with the refresh period. A key without a budget shows Unlimited budget.
To compare every key's budget in one place, use the API Keys tab of the Budgets page.
List every key with its budget, spend, and refresh period:
vercel ai-gateway api-keys list> API keys [387ms]
id name key budget spend refresh created
key_123 my-api-key …1fAj $10 $1.04 monthly 8/24/2026Inspect one key for the full picture, including BYOK spend and alert thresholds:
vercel ai-gateway api-keys inspect key_123> API key my-api-key [154ms]
id key_123
name my-api-key
key …1fAj
purpose ai-gateway
project all projects
created 8/24/2026, 10:15:03 AM
last used 8/24/2026, 11:02:47 AM
expires never
created by your_user_id_here
budget $10
spend $1.04
byok spend $0
include byok no
refresh monthly
alerts none
active yesBoth commands accept --format json for scripting; in the JSON output, a key without a budget has a null quota.
Give an existing key a budget, or change the one it has, from the dashboard or the CLI.
- Open the API Keys page. Go to the 资产生成 API Keys page.
- Edit the key. Find the key, open its ··· menu, and select Edit key.
- Add or change the budget. Enable or update the budget, set the limit and refresh period, and save.
Identify the key by name or ID (a name shared by several keys errors and asks for the ID; find IDs with api-keys list):
vercel ai-gateway budgets set api-key my-key --limit 50 --refresh-period weekly✓ Set budget api key my-key
Limit $50
Refresh weekly| Flag | Description |
|---|---|
--limit <AMOUNT> | Spending limit in dollars (minimum $1). |
--refresh-period <PERIOD> | daily, weekly, monthly (default), or none. |
Removing a budget lifts that key's own cap. A key covered by the API key default falls back to it; otherwise the key reverts to unlimited.
- Open the API Keys page. Go to the 资产生成 API Keys page.
- Edit the key. Find the key, open its ··· menu, and select Edit key.
- Remove the budget. Turn off the budget and save. The key falls back to the API key default if your team has one, and is otherwise unlimited.
vercel ai-gateway budgets remove api-key my-key✓ Removed budget for my-keyRemoving the budget doesn't touch the key itself. To give the key a budget again later, re-run budgets set api-key; metering starts from that point, not retroactively.
A default budget applies to every API key without a custom budget, including keys that already exist. Setting a custom budget on a key overrides the default; see Default budgets for the full semantics.
- Open the API Keys tab. Go to the API Keys tab of the 资产生成 Budgets page.
- Set the API key default. Click Set Default (or the current default value, if one is set) and enter a spending limit in dollars and a refresh period in the API Key Default dialog.
- Save. Every key without its own budget now inherits this limit.
vercel ai-gateway budgets set api-key --default --limit 50 --refresh-period monthly✓ Set default api-key
Limit $50
Refresh monthly
Applies to every API key without its own budget, including existing onesList defaults with vercel ai-gateway budgets list --defaults, and remove the API key default with vercel ai-gateway budgets remove api-key --default.
A user budget caps how much a single team member can spend, across every API key attributed to that member. It stacks with the team budget, so a member's request has to pass both their user budget and the team budget.
Only API keys attributed to a member count toward their user budget. OIDC tokens, personal access tokens, and app tokens carry no member attribution, so their spend never counts toward a user budget. See Spend attribution for how a key is attributed to a member or the team.
- Open the Users tab. Go to the Users tab of the 资产生成 Budgets page.
- Add the budget. Click Add budget, pick a team member, enter a spending limit in dollars, and choose a refresh period.
- Save. The budget takes effect within a few minutes.
Identify the member by email, username, or user ID:
vercel ai-gateway budgets set user teammate@example.com --limit 100 --refresh-period monthly✓ Set budget user teammate
Limit $100
Refresh monthly| Flag | Description |
|---|---|
--limit <AMOUNT> | Spending limit in dollars (minimum $1). |
--refresh-period <PERIOD> | daily, weekly, monthly (default), or none. |
The Users tab groups spend by the team member who owns the key used for each request, showing each member's spend against their limit with a usage bar.
vercel ai-gateway budgets list> Budgets
scope name limit spent refresh
user teammate $100 $12.40 monthlyUser-scoped budgets are listed by member handle.
- Open the Users tab. Go to the Users tab.
- Open the budget's menu. Find the member and open the ··· menu.
- Edit or remove. Select Edit budget to change the limit, refresh period, or spend alerts. Select Remove budget to lift the cap.
Re-run budgets set user with new values to change a budget. Removing one lifts that cap; a member covered by the user default falls back to it:
vercel ai-gateway budgets remove user teammate@example.com✓ Removed budget for teammateA default budget applies to every team member without a custom budget, including members who join later. Setting a custom budget on a member overrides the default; see Default budgets for the full semantics.
- Open the Users tab. Go to the Users tab of the 资产生成 Budgets page.
- Set the user default. Click Set Default (or the current default value, if one is set) and enter a spending limit in dollars and a refresh period in the User Default dialog.
- Save. Every member without their own budget now inherits this limit.
vercel ai-gateway budgets set user --default --limit 50 --refresh-period monthly✓ Set default user
Limit $50
Refresh monthly
Applies to every team member without their own budget, including existing onesList defaults with vercel ai-gateway budgets list --defaults, and remove the user default with vercel ai-gateway budgets remove user --default.
Budgets limit usage; they do not reserve or purchase capacity. Your team still needs credits or a payment method to make requests.
Was this helpful?