Skip to main content
PUT
Update a token budget

Authorizations

Authorization
string
header
required

JWT obtained through Barndoor's authentication flow. Pass the token verbatim in Authorization: Bearer <token>. Use the Barndoor SDK's loginInteractive() helper to obtain a token in scripts and notebooks.

Path Parameters

id
string<uuid>
required

Body

application/json

All fields optional; sent fields replace the existing value.

name
string
token_limit
integer<int64>
alert_thresholds
integer[]
enabled
boolean
cost_limit
number | null
period
enum<string>
Available options:
daily,
weekly,
monthly,
quarterly,
yearly
action_on_exhaust
enum<string>
  • block — refuse new requests until the next period
  • alert — emit alerts at the configured thresholds but keep serving
Available options:
block,
alert
traffic_type
enum<string>
default:all

Whether the policy applies to LLM, MCP, or both kinds of traffic

Available options:
all,
llm,
mcp

Response

The updated budget

id
string<uuid>
required
org_id
string<uuid>
required
name
string
required
Example:

"Engineering monthly tokens"

scope_type
enum<string>
required

Who the rate limit applies to

Available options:
org,
team,
user,
role,
group,
api_key,
mcp_server,
agent,
project,
llm_provider,
model,
model_alias
period
enum<string>
required
Available options:
daily,
weekly,
monthly,
quarterly,
yearly
token_limit
integer<int64>
required
Example:

50000000

alert_thresholds
integer[]
required
Required range: 0 <= x <= 100
Example:
action_on_exhaust
enum<string>
required
  • block — refuse new requests until the next period
  • alert — emit alerts at the configured thresholds but keep serving
Available options:
block,
alert
traffic_type
enum<string>
default:all
required

Whether the policy applies to LLM, MCP, or both kinds of traffic

Available options:
all,
llm,
mcp
currency
string
default:USD
required
enabled
boolean
required
scope_id
string<uuid> | null
scope_value
string | null
cost_limit
number | null

Optional spend ceiling in currency

target_provider_id
string<uuid> | null

Restrict to traffic served by a specific provider

target_upstream_model
string | null

Restrict to traffic that ends up at this upstream model

target_model_alias
string | null

Restrict to requests that used this client-facing alias