Create a new budget
Creates a new budget in the workspace. Exactly one scope variant must be set (workspace / project / identity / api_key / provider / model). At least one of limits.amount, limits.token_limit, or rate_limit.requests_per_minute MUST be provided. Uniqueness is enforced across (workspace_id, scope_kind, scope_target_id). Requires a Management Key with the Budgets permission; project-scoped API keys cannot manage budgets.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Structured scope. Mutually exclusive with match: provide a scope
for the six canonical kinds (the server derives the matching CEL),
or provide match for a dynamic budget. Exactly one of the two
must be set.
Raw CEL matching expression for dynamic budgets (e.g.
metadata.team == "ml" && provider == "openai"). Validated via
CEL parse at write time. Mutually exclusive with scope.
At least one of amount / token_limit / rate_limit.requests_per_minute must be provided on the budget.
Optional rate limit.
Whether the budget should be active immediately. Defaults to true when omitted (handler enforces).
Optional expiration. When set in combination with is_active=true, the value MUST be in the future; the handler rejects past values.
Optional threshold notifications. Ids are assigned by the server, so
alerts[].id must be omitted here; supplying one is rejected.
Response
OK
Newly created budget.