We just shipped AI Gateway API Keys and prepaid credits. You can now use the AI Gateway without signing up for provider accounts.
At its core, AI traffic is HTTP and WebSocket requests, the same primitives ngrok has routed since the beginning. When AI usage started compounding, building a gateway was the obvious next step. So we did.
We wanted to get the basics right for the AI Gateway and shipped the first version with bring-your-own-keys: you stored your OpenAI or Anthropic keys in a vault, wired them into your Traffic Policy rules, and routed requests through the gateway. It worked. But it was clear pretty quickly that what most people coming to use the AI Gateway actually wanted was something closer to what OpenRouter offers—start making requests without setting up provider accounts first.
For a lot of people, that meant first going to create an OpenAI account, setting up billing, generating a key—then doing the same at Anthropic if they wanted a fallback—and only then coming back to actually use the gateway. Many hadn't done any of that yet. It's a lot to ask before someone's made their first request.
So we built that.
Create an AI Gateway API Key from the dashboard. Purchase some credits. Point your SDK at your gateway.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://your-gateway.ngrok.app/v1",
apiKey: "ng-xxxxx-g1-xxxxx", // Your AI Gateway API Key
});
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});That ng-xxxxx... is an AI Gateway API Key—not an OpenAI key. ngrok validates it and injects the right provider keys on your behalf. No vault setup, no need to manually tweak your Traffic Policy rules to forward your own keys safely.
Currently, ngrok-managed keys cover OpenAI and Anthropic. For other providers—Google, DeepSeek, and even open models you run locally on your own hardware—you can still bring your own keys, and both modes work in the same gateway. If you use ngrok-managed keys for OpenAI and Anthropic while supplying your own key for Google, all three work together.
Set model: "ngrok/auto" and the gateway picks from available providers automatically.
const response = await client.chat.completions.create({
model: "ngrok/auto",
messages: [{ role: "user", content: "Hello!" }],
});Without any provider config or explicitly specifying a model, it's about as few decisions as we could get it down to.
Credits are a prepaid USD balance with a minimum purchase of $5. Credits expire after one year, and you'll get email warnings before your balance runs low.
Two things come out of your balance:
The processing fee is small relative to provider costs. At GPT-4o pricing, $5 in credits covers a substantial amount of testing and development.
Credits work the same way they do at OpenAI, Anthropic, and OpenRouter—prepaid balance you draw down as you use it. When your balance hits zero, all AI Gateway traffic stops until you top up.
If you've bought API credits before, this should feel like familiar territory.
This is available on the pay-as-you-go plan only for now, with free and hobbyist to follow.
If you're already using BYOK, nothing about your setup changes. BYOK is free at launch—no processing fee.
Simpler model routing. The current CEL-based selection is powerful but steep. Most users want "prefer cheapest" or "prefer fastest" without writing expressions. That's what we're building toward.
BYOK without the traffic policy. We're bringing your own provider keys into the same managed experience—add them directly through the dashboard instead of wiring them into a traffic policy. Same failover and routing, less configuration.
Better streaming failover. If a stream stalls mid-response, we don't automatically recover today. That's on the list.
And finally, we will be continuing to add more providers to our ngrok managed key offering. Gemini and MiniMax are up next. If there's a provider you need, let us know on Discord.
We are shipping this feature now because it's useful in its current state, not because everything is done.
See the quickstart for the full walkthrough. The API Keys and Credits concept pages cover how each works in detail.
Questions or running into something? Find us on Discord.