http
POST /budgetsCreate a monthly AI spending limit for a project, a member on a project, an API key, or a combination of these.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
scope | object | Yes | A 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_credits | number | Yes | Monthly 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
| Status | Description |
|---|---|
| 201 | Budget created |
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | API keys and runtime credentials are refused. A member cap cannot target the caller. A new member cap cannot target the project owner. |
| 404 | Not found |
| 409 | Conflict |
| 500 | Server error |