The ngrok AI Gateway is now app.ngrok.ai. One key, one URL to access any model, including the ones you run yourself, with access controls and per-call cost visibility.
Create an AI Gateway API Key, add credits, and start making requests to OpenAI and Anthropic—ngrok handles the rest.
ngrok.ai is now an all-new experience at app.ngrok.ai, with a dedicated dashboard, API, and gateway URL, and new accounts get $1 in credit to make their first requests. Read The new ngrok.ai for the full story.
Today we’re opening early access to the ngrok AI gateway—a
single endpoint that routes your AI requests to OpenAI, Anthropic, Google, and
any other provider you want, with automatic failover when things go wrong.
The problem
You’ve probably been here: your app hammers OpenAI’s API, hits a rate limit, and
your users stare at spinning loaders while you scramble to add Anthropic as a
backup. Or maybe you’re burning through API credits on GPT-4o when a cheaper
model would work fine. Or you’re trying to route to your self-hosted Ollama
instance during development but production runs against cloud providers.
All of these problems share the same root cause: your app talks directly to AI
providers, and that means you’re stuck writing routing, failover, and retry
logic yourself.
A better approach
The AI gateway sits between your app and AI providers. Point your OpenAI
SDK at your AI gateway, and we
handle the rest:
That’s it. Your code stays the same. Behind the scenes, the gateway:
Receives your request
Selects which model and provider to use (based on your configuration)
Forwards the request with the appropriate provider API key
Retries with the next option if it fails
Returns the response
What you can do
Use any SDK. We’re OpenAI-compatible, so if your SDK can set a baseURL, it
works with us—that includes the official OpenAI
SDK, Vercel AI
SDK,
LangChain,
and pretty much everything else.
Rotate API keys. Use multiple API
keys for the
same provider. When one hits rate limits, we switch to another. Your app keeps
running.
Define selection strategies.Control exactly how models get
selected using CEL
expressions. Prefer cheaper models? Lowest latency? Only models with
tool-calling support? Write a one-liner:
1model_selection:⋯2 strategy:⋯3 # First, prioritise low latency.4 - "ai.models.filter(m, m.metrics.global.latency.upstream_ms_avg < 1000)"5 # If that gets no results, prioritise low cost.6 - "ai.models.sortBy('price')"
This is early access, which means we’re building this with you. We want to know:
Which providers and models are you using?
What selection strategies would be most useful?
What observability features would actually help?
What’s broken, confusing, or missing?
The feature set will evolve based on what you tell us. That’s not marketing
speak—we genuinely don’t know exactly what this needs to become until we see how
people use it.