Skip to main content
PUT
Update a budget

Authorizations

Authorization
string
header
required

An access token from Barndoor's identity provider, sent as Authorization: Bearer <token>. Use a service-account token from the OAuth 2.0 client-credentials grant for scripts and CI, or a signed-in user's token. The caller needs the admin role in the organization. Gateway API keys (bd-...) are not accepted here.

Path Parameters

id
string<uuid>
required

Record ID (UUID)

Body

application/json
action_on_exhaust
string | null

block, throttle, or warn.

alert_thresholds
integer<int32>[] | null
change_note
string | null

Optional note explaining this change. Omitting it clears the previous note.

cost_limit
number<double> | null

New spending cap per period.

enabled
boolean | null
name
string | null
period
string | null

daily, weekly, or monthly.

token_limit
integer<int64> | null

New token limit per period.

traffic_type
string | null

Response

OK

A budget.

action_on_exhaust
enum<string>
required
Available options:
block,
throttle,
warn
alert_thresholds
integer<int32>[]
required
enabled
boolean
required
id
string<uuid>
required
name
string
required
org_id
string<uuid>
required
period
enum<string>
required

How often a budget resets. All boundaries are UTC: daily at 00:00, weekly on Monday at 00:00, monthly on the 1st at 00:00.

Available options:
daily,
weekly,
monthly
scope_type
enum<string>
required

Who a policy applies to. llm_provider and model remain for compatibility only; to limit a budget or rate limit to a provider or model, use its target_* fields.

Available options:
org,
team,
user,
project,
api_key,
mcp_server,
llm_provider,
model,
agent,
role,
group
token_limit
integer<int64>
required

Tokens allowed per period. 0 on a cost-only budget.

traffic_type
enum<string>
required
Available options:
all,
llm,
mcp
cost_limit
number<double> | null

Spending cap per period in currency, enforced on estimated cost in addition to tokens.

created_at
string<date-time> | null

When the budget was created.

currency
string

ISO 4217 currency code (e.g. "USD"). Defaults to "USD".

member_of_group
string | null

Give each member of this IdP group their own allowance from this one policy. Only valid with scope_type: user and no scope_id or scope_value. A group-scoped policy, by contrast, shares one allowance across all members.

scope_id
string<uuid> | null
scope_value
string | null
target_mcp_server_id
string<uuid> | null

Only apply to requests to this MCP server. Requires traffic_type mcp or all, and cannot be combined with the LLM target fields.

target_model_alias
string | null

Only apply to requests whose model is this alias. Cannot be combined with the other target fields.

target_provider_id
string<uuid> | null

Only apply to requests routed to this provider. Can be combined with target_upstream_model; cannot be combined with target_model_alias or target_mcp_server_id.

target_upstream_model
string | null

Only apply to requests routed to this upstream model. Requires target_provider_id.

created_by_email
string | null
created_by_name
string | null
created_by_user_id
string<uuid> | null
last_change_note
string | null

Note explaining the last change.

last_modified_at
string<date-time> | null

When the last attributed change was made.

last_modified_by_email
string | null
last_modified_by_name
string | null
last_modified_by_user_id
string<uuid> | null