How it works
- Create an AI Gateway API Key via the dashboard, CLI, or API
- Use the key as the
apiKeyin your SDK orAuthorization: Bearerheader - ngrok validates the key on every request
- Invalid or missing keys are rejected—requests do not fall through to passthrough mode
Your AI Gateway API Key token is never sent to the provider—ngrok strips it and injects its own managed provider keys.
Per-client keys
Create separate AI Gateway API Keys for each client or application. This enables:- Independent revocation: disable one client without affecting others
- Usage tracking per client: each key tracks
last_usedso you can see activity - Organization: use different descriptions and metadata to identify each client
Revoking access
Delete the key via the dashboard, CLI, or API. The key immediately stops working.Additional security layers
You can layer additional protections on top of AI Gateway API Keys using Traffic Policy.Rate limiting
Limit requests per key to prevent abuse:IP restrictions
Restrict access to specific IP ranges for an additional layer of defense. See Securing Endpoints (BYOK) for full configuration examples.Using BYOK?
If you’re managing your own provider keys, you’ll need to add your own authorization layer. See Securing Endpoints (BYOK) for complete examples including secret-based auth, JWT validation, and IP restrictions.Next steps
AI Gateway API Keys
Learn how API keys work and how to manage them.
Securing Endpoints (BYOK)
Add authorization when managing your own provider keys.
Rate Limiting
Add rate limiting to your gateway.
Restricting Model Access
Control which providers and models clients can use.