Skip to main content
Budgets and policies let you hand keys to a team or a contractor without watching every request. Use this guide to cap spending per workspace or person, limit how long keys live, and allow only the models you have approved.

Before you begin

You need the Owner or Admin role in a team or personal organization; see Roles. Admins of a workspace also set that workspace’s model policy. Every setting here adds to the key’s own credit limit and expiry. The stricter one applies. A new budget or model policy, or a change to one, takes effect within 10 seconds.

Cap spending with budgets

A budget is an amount in USD that resets every day, week or month, or never. Periods follow the same UTC calendar as a key’s credit limit. To set a budget for a workspace:
  1. Open the workspace’s Settings page, or its row menu on Account → Workspaces.
  2. Set the amount and the period. The budget covers every key in the workspace, and the Playground while it works there. Default can have one too.
To set a budget for a person:
  1. Open Organization → Members.
  2. In the person’s row menu, set the amount and the period. The budget covers every key that person created in the organization, in any workspace.
Members can create keys in any workspace they work in, so a person’s budget, not a workspace’s, is the way to cap one person. Only the owner sets the owner’s budget. Members with the Billing role see every person’s budget, and everyone else sees their own.

How a budget counts

A request goes through only if no budget that covers its key is spent, and the key’s own credit limit still applies. Members can lower the limit on their own keys, but the budget an admin set for them holds anyway.
  • Spend counts from the moment the budget is set. Changing its period starts the count at zero.
  • The check runs before each request. A request that starts with room left can take a budget past its amount, and so can several requests running at once.
  • Once a budget is spent, paid requests with the keys it covers fail with 403 credit_limit_exceeded until it resets or an admin raises it. Free models cost nothing and still work. The balance and the keys stay as they were.
When a budget reaches 50, 75 or 100% of its current period, a notice at the top of every dashboard page names it. The notice shows what the budget has spent and, once it’s spent, when it resets. Admins and Billing see every budget that has reached a threshold, and a member sees their own. The notice goes away when the period resets or an admin raises the budget.

Limit how long keys live

When every key expires, a leaked key, or one that a departed contractor kept, stops working on its own.
  1. Open Organization → General → API key lifetime.
  2. Pick 7, 30, 90, 180, or 365 days. From then on, a key created in the organization, or given a new expiry, expires within that many days.
A later or empty expiry is shortened to the limit, from the dashboard and the account API alike, and the response shows the expiry the key got. Keys that already live without an expiry keep working until someone changes it. A workspace can have a shorter limit of its own. Set it with Set policy in its row menu on Account → Workspaces. A key in that workspace expires within the shorter of the two limits. Moving a key into the workspace shortens its expiry to that limit too.

Choose which models keys can use

Allowing only approved models keeps data with the vendors you have a contract with, or keeps a test workspace on cheap models.
  1. Open Organization → General → Model access.
  2. Pick Only selected models.
  3. Choose vendors, such as All Anthropic models, or single models. A vendor covers its models released later as well.
The list applies to the Playground too. A workspace can narrow it further with Set policy on its Settings page or in its row menu on Account → Workspaces. A key in that workspace can call a model only when both lists allow it, so a workspace never opens a model the organization closed. Default has no list of its own and follows the organization. GET /v1/models called with the key lists only the models it may use. A request for any other model fails before it reaches a provider and costs nothing.

Troubleshooting

403 credit_limit_exceeded

A budget that covers the key is spent, and the request is for a paid model. The message names the budget and when it resets:
The Playground gets the last message when the budget of the workspace it works in is spent. Wait for the reset, use a model whose id ends in :free, or ask an admin to raise the budget. A key’s own credit limit gives the same code with another message; see API keys.

403 model_not_allowed

The organization or the key’s workspace allows only some models, and this one isn’t among them. The message says which list refused it and where an admin changes it:
Pick a model from GET /v1/models called with the same key, or ask an admin to allow the model.

See also