Skip to main content
POST
Create a rate limit

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.

Body

application/json
name
string
required
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
scope_id
string<uuid> | null
scope_value
string | null
requests_per_minute
integer

At least one of requests_per_minute or tokens_per_minute is required

Required range: x >= 0
tokens_per_minute
integer
Required range: x >= 0
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 newly created 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