Skip to main content
Use ngrok.ai inference when you want the AI Gateway to supply upstream provider credentials for you. Your app sends an access key to the gateway. The gateway authenticates to the supported upstream provider, and credits cover the model cost plus the gateway processing fee.
Today, ngrok.ai inference supports built-in OpenAI and Anthropic models. Other supported providers may be added over time. For providers that require your own credentials, bring your own provider key.

What you’ll need

Create an access key

Create an access key in app.ngrok.ai. Use this key as the API key in your SDK. The access key authenticates your application to the gateway. It is different from a provider key, which authenticates the gateway to an upstream provider.

Call a supported OpenAI model

{
  "model": "openai:gpt-4o",
  "messages": [{"role": "user", "content": "Hello"}]
}
You can also use the model ID directly:
{
  "model": "gpt-4o",
  "messages": [{"role": "user", "content": "Hello"}]
}

Call a supported Anthropic model

{
  "model": "anthropic:claude-sonnet-4-6",
  "messages": [{"role": "user", "content": "Hello"}]
}

How billing works

For supported ngrok.ai inference requests, credits cover:
  • The upstream model cost.
  • The AI Gateway processing fee.
For other built-in providers, or when you want usage billed directly by OpenAI or Anthropic, bring your own provider key.

When to bring your own key instead

Bring your own provider key when:
  • You already have a provider account.
  • You want usage billed directly by the provider.
  • You have negotiated provider pricing.
  • You need a provider or model that requires your own credentials.

Next steps