Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ngrok.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Configuring provider API keys in Traffic Policy (providers[].api_keys) is deprecated for standard providers. Use Attached Provider Keys instead. Traffic Policy keys are still supported for custom or self-hosted providers.
The recommended way to use your own provider API keys is to attach them directly to your AI Gateway API Key. ngrok encrypts and stores them—no Traffic Policy configuration or Vaults & Secrets needed. See Attaching Provider Keys to get started.

When Traffic Policy keys are still needed

Traffic Policy providers[].api_keys configuration is still required for:
  • Custom or self-hosted providers: any provider with a base_url (Ollama, vLLM, custom endpoints). See Custom Providers.
For everything else, use attached provider keys.

Migrating from Traffic Policy keys

If you currently use providers[].api_keys, see Migrate to Attached Provider Keys for step-by-step instructions.

Comparing your options

AI Gateway API KeysAttached provider keysBYOK
Provider accounts neededNo (OpenAI & Anthropic only)YesYes
Credits requiredYesNoNo
Provider billingIncluded in credits (ngrok pays provider)Direct with providersDirect with providers
Setup complexityLow (create key, use it)Low (attach key to API key)Medium (configure secrets, Traffic Policy)
Key storagengrok managesEncrypted by ngrokngrok Vaults & Secrets
Key rotationManaged by ngrokUpdate attached keyUpdate secret or Traffic Policy
Multi-key failoverAutomaticAutomatic (most recently attached key tried first)Configurable (keys tried in list order)
Custom/self-hosted providersNot supportedNot supportedSupported
AuthBuilt-in (AI Gateway API Key)Built-in (AI Gateway API Key)DIY (secrets, JWT, etc.)
Supported providersOpenAI, AnthropicAny supported providerAny provider

Mixed mode

You can combine all three approaches in the same gateway. When you authenticate with an AI Gateway API Key, the per-provider lookup order is: attached provider keys → Traffic Policy BYOK → ngrok-managed keys. Attached keys fully replace BYOK for a provider; BYOK is only consulted when no key is attached for that provider. See Attaching Provider Keys and AI Gateway API Keys for details.

Guides

Attaching Provider Keys

Attach your own provider keys to an AI Gateway API Key

Migrate to Attached Provider Keys

Move existing Traffic Policy keys to attached keys

Configuring Providers

Set up custom and self-hosted providers in Traffic Policy