Skip to main content
GET
/
admin
/
budgets
List token budgets
curl --request GET \
  --url https://{organization_id}.platform.barndoor.ai/api/llm-gateway/admin/budgets \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Engineering monthly tokens",
    "token_limit": 50000000,
    "alert_thresholds": [
      80,
      90
    ],
    "traffic_type": "all",
    "currency": "USD",
    "enabled": true,
    "scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "scope_value": "<string>",
    "cost_limit": 123,
    "target_provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "target_upstream_model": "<string>",
    "target_model_alias": "<string>"
  }
]

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.

Response

200 - application/json

List of token budgets

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:
[80, 90]
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