Skip to main content
Use access key configurations to control which providers and models an access key can call. Restrictions are checked before the gateway routes a request upstream. That means a request can fail fast if a client asks for a provider or model the key shouldn’t use.

What you’ll need

Allow specific providers

Use provider restrictions when an access key should only call certain providers.
With this configuration, requests can only route to OpenAI or Anthropic.

Allow specific models

Use model restrictions when an access key should only call certain models.
Model entries accept three forms: Use the provider: prefix when you always want to use that provider. Combine model rules with a provider allowlist to block resellers.

Allow providers and models together

Combine provider and model restrictions when you want a key to stay within a small set of approved providers and models.
Requests outside the allowed providers or models are rejected before they reach an upstream provider.

How this works with fallback

Every model in a fallback request must be allowed.
If the primary model is allowed but the fallback model is not, the gateway drops the fallback and names it in the Ngrok-AIG-Rejected-Models response header. The request fails only when none of the models you listed are allowed.

Common patterns

Next steps