Skip to main content
Pay with credits when you want the AI Gateway to supply the provider credentials for you, so you don’t need a provider account. 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.
You can pay with credits for models from OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot AI, Z.ai, and other built-in providers. Availability is per model; the model catalog shows which providers support it. 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

You can also use the model ID directly:

Call a supported Anthropic model

How billing works

When you pay with credits, credits cover:
  • The upstream model cost.
  • Hosted tools the provider bills, such as web search, code execution, and image generation.
  • The AI Gateway processing fee.
Before sending a request, the gateway checks that you can pay for it with credits. If you can’t pay for a model or feature with credits, you get an error asking you to add your own provider key. See ERR_NGROK_27238. For providers or models you can’t pay for with credits, or when you want usage billed directly by the provider, 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