Create budget

http
POST /budgets

Create a monthly AI spending limit for a project, a member on a project, an API key, or a combination of these.

Request body

FieldTypeRequiredDescription
scopeobjectYesA budget caps monthly AI spending for a project, person, API key, or combination of these fields. A request must match every field in the budget scope. If several budgets apply, the most specific exhausted budget rejects the request before account credit and provider spending checks. Only one budget is allowed per scope (409); change an existing limit with an update. The scope cannot change later; create a separate budget for a different scope. API keys and runtime credentials are refused. A member cap cannot target the caller. A new member cap cannot target the project owner.
monthly_limit_creditsnumberYesMonthly AI spending limit in credits. Usage already recorded this month counts toward the limit. At most 8589934591.999999 credits, with at most six decimal places. A value of 0 blocks all spending within the scope.

Responses

StatusDescription
201Budget created
400Bad request
401Unauthorized
403API keys and runtime credentials are refused. A member cap cannot target the caller. A new member cap cannot target the project owner.
404Not found
409Conflict
500Server error