Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
scope
object

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; the handler enforces that invariant.

match
object

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.

limits
object

At least one of amount / token_limit / rate_limit.requests_per_minute must be provided on the budget; the handler enforces that invariant.

rate_limit
object

Optional rate limit.

is_active
boolean

Whether the budget should be active immediately. Defaults to true when omitted (handler enforces).

expires_at
string<date-time>

Optional expiration. When set in combination with is_active=true, the value MUST be in the future; the handler rejects past values.

Response

200 - application/json

OK

budget
object

Newly created budget.