Overview
The Users page turns theuser_path hierarchy
behind your API keys into a tree of groups and users, and lets each node
restrict which models requests under it may call:
/acmeand/acme/engare groups — they contain other paths./acme/eng/aliceis a user — API keys are bound directly to it.
Rules
- New keys and nodes allow everything. A node or key with no
allowed_modelsimposes no restriction of its own. - Listing models restricts. Once a node lists models, requests under it may only use models matching that list.
- Lists intersect down the tree. A request must satisfy the allowlist of
its API key, of its user path, and of every ancestor up to
/. A child can narrow what its group allows but never widen it. - Model-side rules still apply. A virtual model access policy that hides a model from a subtree keeps hiding it.
GET /v1/models returns only the models the caller may use, so clients see
the same picture the gateway enforces.
Requests authenticated by other means follow the same path rules: an
OIDC SSO session or a request carrying only the
user-path header is limited by the policies on its user_path; only managed
API keys additionally carry a per-key allowlist. The master key has no bound
user path: without the header it is unrestricted, with the header it is
scoped like any other request on that path.
How access is resolved
Policies hang off the user-path tree and are combined top-down. Every list on the way from the root to the request’s path must match, and the API key’s own list is applied last: For one request the gateway checks, in order: Where the pieces come from:
A node without a list contributes nothing to the chain; it neither widens nor
narrows. This is why a new key or a fresh group starts with access to
everything, and why
/acme/sales above still sees both providers.
Selectors
Each entry in an allowlist is one selector:
Provider names must match a configured provider; unknown names are rejected
when the policy is saved. Virtual models are not selectors: an alias or a load
balancer resolves to the concrete provider model before the check runs, so allow
the target models, not the virtual model. A virtual model name in a list is
accepted as a bare model ID but never matches anything; a load balancer whose
targets span providers is only usable when every target it can pick is allowed,
otherwise requests fail with
400 whenever it picks a disallowed target. The
user tree shows such a node with an empty effective list.
Example
An API key bound to
/acme/eng/alice with its own
allowed_models: [anthropic/claude-sonnet-4-6] narrows Alice further to that
single model.
A denied request receives 400 with code model_access_denied.
Request policy
A node can also shape the requests below it. All three fields are unset by default, so nothing changes until you set one:
Ceilings are upper bounds. The lowest ceiling between a path and
/
applies, so a child can tighten its group’s ceiling but setting a higher one on
a child changes nothing. Efforts use the scale none, minimal, low,
medium, high, xhigh, max. The token ceiling covers max_tokens,
max_completion_tokens, and max_output_tokens in whichever spelling the
client used, inside extra_body too, and a request that sends no limit gets
the ceiling as its limit, in the field the upstream model takes. The gateway
picks that field by model name: for a deployment it cannot recognize as an
OpenAI reasoning model, such as an Azure deployment with a name of your own,
set default_params.max_completion_tokens on the
model, so that requests
carry the limit in the field the deployment takes. When the model catalogue knows the
model’s own output maximum and it is lower than the ceiling, that maximum is
the limit such a request gets, since the model would refuse the ceiling; for a
model without a known maximum, keep the ceiling at or below what the model
accepts. A limit sent only in a spelling the
endpoint does not have (max_output_tokens on Chat Completions, max_tokens
on the Responses API) is moved to the endpoint’s own field, and a value that is
not a whole number of at least 1 is replaced by the ceiling. Inside
extra_body such a value is dropped instead, so that it cannot lift the limit
the request sets at the top level. A limit whose name
is in another letter case (MAX_TOKENS) is not sent upstream; when it is within
the ceiling it lowers the request’s limit first, so a ceiling never raises a
limit the client sent. The effort ceiling only lowers an effort
the request sends and never adds one, because adding an effort would switch
reasoning on for requests that did not ask for it. A request without an effort
therefore runs at the model’s default, and a model that cannot think less than
some level (Gemini 3 and 4, OpenAI o-series, OpenCode Zen, Claude Fable 5.x,
Mythos 5.x, and Opus 5.5) still gets that level under a lower ceiling. A model
that takes only some of the levels gets the highest one it takes within the
ceiling, never the next one up: under a medium ceiling Z.ai’s GLM-5.3, which
takes low, high, and max, gets low, and
DeepSeek, whose only levels are high and max, runs
with reasoning off.
Besides reasoning_effort and reasoning.effort, an effort ceiling checks the
provider-specific reasoning controls that reach upstreams, at the top level of
the body or inside extra_body, with names in any letter case and in every
occurrence of a repeated member:
A control that turns reasoning off (
false, a zero budget,
{"type": "disabled"}) and a level within the ceiling are kept. Anything the
scale cannot place, such as a token budget or true, counts as above the
ceiling: the gateway drops every client reasoning control and sends the ceiling
as the effort instead. A request that also turns reasoning off (for example
enable_thinking: false next to a thinking_budget) is not switched on that
way, and neither is a control object that repeats type and is disabled only
in the last one: those controls are dropped too, and what replaces them is the
highest effort the request names elsewhere within the ceiling, or none when
it names no other. A Messages budget_tokens above the
budget the gateway itself sends for the ceiling level (5000 for low, 10000
for medium, 20000 for high and up) is lowered to that budget. The one
exception to never adding an effort is adaptive Messages thinking
(thinking: {"type": "adaptive"}) that names no output_config.effort:
thinking is already on there and Anthropic runs it at high, so under a lower
ceiling the ceiling is sent as its effort. Where an adapter fills in a value
of its own (Anthropic’s default max_tokens and the room it adds above a
thinking budget, OpenCode Zen’s default effort), that value is kept within the
ceilings too: a thinking budget shrinks to fit under the capped max_tokens,
and thinking is turned off when not even the minimum budget fits. Adaptive
thinking (Claude Opus 4.6, Sonnet 4.6, and later) has no budget: it stays on,
and the capped max_tokens bounds what it spends. Claude Opus 4.6 and Sonnet
4.6 take max but not xhigh, so under an xhigh ceiling they are sent
high.
Ceilings apply after virtual model overrides,
on every attempt, including failover legs, so they also bound an effort or a
max_tokens that a virtual model forces or defaults. They apply to Chat
Completions, the Responses API, and the Anthropic Messages API. Ceilings do
not take a Messages request off native forwarding to Anthropic: where it
would be forwarded natively without them, one above the ceilings has its
max_tokens, thinking budget, and output_config.effort lowered in the
forwarded body, and keeps its other members and its anthropic-beta headers.
A request that uses the response cache, failover, a forced reasoning effort or
request parameters, or a guardrail or plugin that rewrites it takes the
translated path as before, and is lowered there. Under a none ceiling a
natively forwarded request’s thinking is turned off
with thinking: {"type": "disabled"}; a model that always thinks (Fable 5.x,
Mythos 5.x, Opus 5.5) gets low instead, as on the translated path. Known
limit: Sonnet 5.5 rejects disabled, so such a request to it fails with
Anthropic’s 400. A natively forwarded body
that repeats one of these members or spells it in another letter case reaches
Anthropic with a single one: the lowest max_tokens, the last thinking and
output_config. A body the gateway cannot bring within the ceilings is refused
with 400, never forwarded above them. Embeddings and
media endpoints are not rewritten. Response cache entries
are scoped to the ceilings in force, so an answer cached before a ceiling was
set or changed is not served under the new one.
A policy on / binds every request, including those with no user path (the
master key, or a key without a bound path that sends no header). A credential
without a bound path chooses its own path through the
user path header and with it its own subtree’s policy,
so it can step out of a cap set lower in the tree. Bind caps to callers through
API keys with a fixed user_path, or set them on /.
The default model is used only when a Chat Completions, Responses, or
Messages request (including Messages token counting) names neither a model
nor a provider; a model the client names always wins. It is resolved exactly
like a model the client sent: it may be a virtual model,
and it is still checked against the allowlists, so a default the path may not
use is denied. A request without a user path answers to the default on /,
if any; paths without a default keep getting 400 model is required.
Managing policies
Dashboard
Users lists every node with its own allowlist, the request policy in
force on it (with the path each value comes from), its effective models —
the path-level result once its own list, every parent’s list, and the
model-side virtual-model policies are applied (a red None flags a node
whose lists intersect to nothing) — and how many API keys are bound to it. A
managed API key’s own allowed_models can narrow a request further than the
path shows. The editor warns while you type when the
list would leave no model available. Add or edit a node to
set its models, default model, and ceilings; remove the policy to fall back to
the parents’ limits.
The key count links to the API Keys page filtered to that path’s subtree,
and each row has an Add API key action that opens the create-key form with
the path prefilled.
Per-key allowlists live on the API Keys page: set Allowed models when
creating a key or edit them later from the key’s row. Its Effective models
column is the final answer for that credential — path policies, the key’s own
list, and model-side policies combined.
Configuration
Declare policies inconfig.yaml under users: (see the example above) or
in the USERS environment variable as a JSON array with the same fields:
Admin API
PUT /admin/users takes user_path, allowed_models, default_model,
max_reasoning_effort, max_output_tokens, and description. It replaces the
allowlist and the description, and keeps a request policy field
(default_model, max_reasoning_effort, max_output_tokens) that the body
leaves out or sets to null, so a client that does not send them cannot lift a ceiling; send
"" or 0 to clear one. GET /admin/users returns each
node’s own fields and a request_policy object with the values in force and
the path each comes from (default_model_from, max_reasoning_effort_from,
max_output_tokens_from). A credential scoped to a subtree cannot change the
policy of its own scope root, only of paths below it.
POST /admin/auth-keys accepts allowed_models at creation time. See
Admin Endpoints for request and response shapes.