Skip to main content
PUT
/
admin
/
rate-limits
/
{id}
Update a rate limit
curl --request PUT \
  --url https://{organization_id}.platform.barndoor.ai/api/llm-gateway/admin/rate-limits/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "scope_value": "<string>",
  "requests_per_minute": 123,
  "tokens_per_minute": 123,
  "traffic_type": "all",
  "enabled": true
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "Engineering RPM cap",
  "traffic_type": "all",
  "enabled": true,
  "scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "scope_value": "<string>",
  "requests_per_minute": 123,
  "tokens_per_minute": 123
}

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

Send null for requests_per_minute or tokens_per_minute to clear that metric (the other must remain set). At least one metric must always be enforced.

name
string
scope_type
enum<string>

Who the rate limit applies to

Available options:
org,
team,
user,
role,
group,
api_key,
mcp_server,
agent,
project,
llm_provider,
model,
model_alias
scope_id
string<uuid> | null
scope_value
string | null
requests_per_minute
integer | null
tokens_per_minute
integer | null
traffic_type
enum<string>
default:all

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

Available options:
all,
llm,
mcp
enabled
boolean

Response

The updated policy

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

"Engineering RPM cap"

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
traffic_type
enum<string>
default:all
required

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

Available options:
all,
llm,
mcp
enabled
boolean
required
scope_id
string<uuid> | null

UUID for scopes that reference an entity (user, agent, api_key, etc.)

scope_value
string | null

String for name-based scopes (group name, role name, model alias, etc.)

requests_per_minute
integer | null
tokens_per_minute
integer | null