The ngrok.ai API lets you manage ngrok.ai directly from your code, so you don’t have to rely on the dashboard. You can use it to create access keys, add provider keys, set up routing and access rules, register custom providers, check usage, and keep an eye on your credit balance. Note, that the API doesn’t handle model requests itself. To call models, send your requests to
https://gateway.ngrok.ai using an access key.
Base URL
When you make requests to the ngrok.ai API, send them to:Authentication
To authenticate, include your ngrok.ai API key in theAuthorization header of each request:
What you can manage
Use the AI Gateway API to manage:- Access keys: Manage keys for making gateway requests
- Access key configurations: Manage access controls and rules for which providers, models, and keys an access key can use
- Providers: Manage which providers the gateway can route to
- Provider keys: Manage your credentials for providers
- API keys: Manage keys that grant ngrok.ai API access
- Configuration: Manage your account level gateway settings
- Credits: View your credit balance and transactions
- Usage: View data on requests, tokens, providers, models, and costs
Common workflows
Use the ngrok.ai API to automate common setup and operational tasks.Create access keys
Create access keys for applications, environments, teams, or customers. Each access key can have its own configuration for routing, model access, and provider credentials.Add provider keys
Store upstream provider credentials so ngrok.ai can call providers on your behalf without exposing those credentials in your application code.Configure routing and access
Define access key configurations to control which providers and models an access key can call, and which provider keys are used for upstream authentication.Register custom providers
Create custom providers for self-hosted models, private deployments, or other OpenAI-compatible and Anthropic-compatible APIs.Monitor usage and credits
Query usage and credit data to track requests, tokens, costs, and remaining balance.Next steps
- Access keys: Create and manage access keys
- Provider keys: Add and rotate upstream provider credentials
- Access key configurations: Configure access, routing, and credential selection
- Providers: Manage built-in and custom providers
- Usage: Query request usage