Skip to navigation

Per-customer restrictions

Block or pin specific combinations of customer identifiers, providers, and models for your org

Model restrictions deny, or limit to an allow-list, models and providers for specific customers or for everyone. Use them to enforce a customer contract, keep out an unapproved provider, or pin a pilot customer to a few models.

Create rules

Manage rules in the dashboard, under Customers → Model restrictions (dashboard), or with /v1/blocklist-rules. Changing rules needs Manage organization settings, and every change is recorded in the audit trail. An organization can have up to 100 rules, and changes apply to new requests within seconds.

Each rule combines up to three lists, plus an optional reason such as a ticket or contract clause:

ListMatches
Customer IDsThe value of the X-Customer-ID request header, such as customer_abc
ProvidersThe model’s provider, the prefix of its ID, such as anthropic in anthropic/claude-sonnet-5-5
ModelsFull model IDs, such as openai/gpt-5.5

Customer rules match only the X-Customer-ID header, not a customer named only through an Embedded Routing key or customer field.

Providers are model authors, not serving vendors; to limit vendors, use routing restrictions.

Rule types

TypeRequiresEffect
BlockAt least one listDenies a request when its customer matches and its model or provider matches. An empty customer list matches everyone, and empty provider and model lists match every model.
PinCustomer IDs, plus providers or modelsThe listed customers can use only the pinned providers and models. Several pin rules for one customer combine.

A block always wins over a pin.

Blocked requests

A denied request returns HTTP 403:

{
"error": {
"message": "Request blocked by organization policy.",
"type": "blocked_by_policy",
"code": "customer_model_blocked"
}
}
codeRule that matched
customer_blockedA block rule with customers and no providers or models
customer_model_blockedA block rule with customers and providers or models
provider_blockedA block rule with providers only
model_blockedA block rule with models and no customers
customer_pinnedA pin rule, when the model is outside the pin

With routing policies

Blocked models are removed from a routing policy’s targets, so failover moves to the next permitted model. If every target is blocked, Gateway returns 403 with type: "permission_error", the message “Every model in the routing policy for this request is blocked by your organization’s policy.”, and the code of the rule that blocked the first target.

Rules apply to BYOK traffic too, and GET /v1/models leaves out models the caller is blocked from.

Next steps