What you’ll need
- An access key.
- An access key configuration.
- The provider IDs and model IDs you want to allow.
Allow specific providers
Use provider restrictions when an access key should only call certain providers.Allow specific models
Use model restrictions when an access key should only call certain models.
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.How this works with fallback
Every model in a fallback request must be allowed.Ngrok-AIG-Rejected-Models response header.
The request fails only when none of the models you listed are allowed.
Virtual models
Model restrictions apply to the models in a virtual model, not to its name. To let a key use a virtual model, allow the models in it. The gateway skips each model the key can’t use and names it in theNgrok-AIG-Rejected-Models response header.
You can’t add a virtual model name to access.models.allow.
The API rejects it with the message 'chat-default' is a virtual model. Add its models to the key instead.
Common patterns
Next steps
- Access key configurations: Full configuration flow
- Choose a model: Use model IDs in requests
- Configure fallback models: Use allowed fallback models