Restriction methods
Hivenet Router supports two ways to define model access:quota.per_model is both a quota configuration and a model allowlist.
For predictable behavior, use either an explicit allowlist or
quota.per_model on one key.Avoid defining different model sets in both places. A single source of truth is easier to review and less likely to produce inconsistent access expectations.Full model access
An empty or omitted allowlist grants access to every registered model, provided thatquota.per_model is not configured.
Static key
models:
Dynamic key
allowed_models.
Explicit allowlist
List every model the key may use.Static key
Dynamic key
Restrict a key to one model
Use per-model quotas as the allowlist
When a key usesquota.per_model, every permitted model must appear in that map.
0 when a particular limit should be unlimited.
How discovery is filtered
Model restrictions apply to:List models
A restricted key sees only its permitted models:Get one model
When a key requests details for a model it cannot use:404:
Operator discovery is unfiltered
The administration catalog always shows every registered model:- is registered
- is hidden only from a particular key
- has healthy agents
- has the expected capability and engine
Inference access errors
The response depends on which restriction mechanism rejects the request.Explicit allowlist rejection
A request outsidemodels or allowed_models returns HTTP 403:
Missing per-model quota entry
Whenquota.per_model is configured and the requested model is absent from the map, quota admission returns HTTP 429:
Restrictions apply before routing
Hivenet Router checks model access before selecting an agent. A disallowed request does not:- enter the routing queue
- consume backend capacity
- try fallback agents
- reach an external provider
- expose whether a healthy backend exists
Provider fallback
Provider fallback authorizes the model originally requested by the client. For example:Capability and model restrictions
Model restrictions use model names. They do not independently restrict capabilities or endpoints. For example, a key allowed to use:Multi-tenant isolation
Give each tenant its own key and model set.Model restrictions isolate API access. They do not create separate router processes, storage databases, logs, or physical infrastructure.Use separate deployments when tenants require stronger operational or infrastructure isolation.
Service isolation
Restrict internal services to the workload they need.Environment separation
Use distinct keys and explicit model lists for development, staging, and production workloads.Share models without sharing quotas
Two keys may use the same model while keeping independent quota state. Give them different owners:Update static restrictions
Editauth.yaml, then send SIGHUP:
Update dynamic restrictions
Update the key through:Test a restricted key
Check discovery
Check an allowed request
Check a denied request
403 or 429 based on the key’s restriction type.
Check detail privacy
404.
Monitor denied access
Audit logs provide the clearest view of explicit model-access failures. With Loki:models or allowed_models denials. A model missing from quota.per_model is recorded as rate_limit_exceeded, the same broad code used for RPM exhaustion. Use the request ID and router logs when you need to distinguish those two cases.
Inspect successful routed traffic by tenant and model:
Security guidance
- Give every application its own key.
- Use explicit allowlists for production credentials.
- Keep model names stable after granting access.
- Review provider fallback with the original model permission.
- Use separate owners when quota buckets should be independent.
- Avoid sharing one model name across capabilities.
- Test discovery and inference after every restriction change.
- Use the admin catalog for operator diagnosis.
- Audit and alert on repeated
model_forbiddenevents. - Use separate router deployments when logical filtering is not strong enough.
Troubleshooting
A key sees every model
Check whether its model list is empty or omitted:A permitted model is missing
Compare the configured name with the operator catalog:quota.per_model is present, confirm that the model has an entry there.
The list endpoint hides a model, but the admin endpoint shows it
The client key is restricted. Review:modelsallowed_modelsquota.per_model
Inference returns 403 model_forbidden
The key uses an explicit allowlist and the requested model is not permitted.
Add the exact model name or use an unrestricted list when that is intentional.
Inference returns 429 for an unlisted model
The key uses quota.per_model.
Add a complete quota entry for the model:
A model is allowed but the request still fails
Model authorization succeeded. Check the later routing stages:- registered capability
- agent health
- available capacity
- routing-policy filters
- backend compatibility
- request validity
A changed static restriction does not take effect
SendSIGHUP and inspect the router logs:
A dynamic restriction disappears after restart
Dynamic key state is memory-only. Repopulate the registry through the administration API after every router restart.Next steps
Key rotation
Replace client, administrator, agent, and provider credentials safely.
Models
Understand filtered client discovery and the unfiltered operator catalog.
Audit logging
Track owners, keys, models, denials, and request outcomes.

