> ## 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.

# Pay with credits

> Call supported providers without adding provider keys.

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](/docs/ai-gateway/concepts/access-keys) to the gateway. The gateway authenticates to the supported upstream provider, and credits cover the model cost plus the gateway processing fee.

<Note>
  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](/docs/ai-gateway/reference/model-catalog#billing-and-provider-credentials) shows which providers support it. For providers that require your own credentials, [bring your own provider key](/docs/ai-gateway/guides/attaching-provider-keys).
</Note>

## What you'll need

* An ngrok account.
* An [access key](/docs/ai-gateway/concepts/access-keys) from [app.ngrok.ai](https://app.ngrok.ai).
* Credits in your AI Gateway account.

## Create an access key

Create an access key in [app.ngrok.ai](https://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

```json theme={null}
{
  "model": "openai:gpt-4o",
  "messages": [{"role": "user", "content": "Hello"}]
}
```

You can also use the model ID directly:

```json theme={null}
{
  "model": "gpt-4o",
  "messages": [{"role": "user", "content": "Hello"}]
}
```

## Call a supported Anthropic model

```json theme={null}
{
  "model": "anthropic:claude-sonnet-4-6",
  "messages": [{"role": "user", "content": "Hello"}]
}
```

## 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`](/docs/ai-gateway/reference/error-codes#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](/docs/ai-gateway/guides/attaching-provider-keys).

## 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

* [Credits](/docs/ai-gateway/concepts/credits): Learn how credits work
* [Choose a model](/docs/ai-gateway/guides/model-selection-strategies): Choose model IDs and provider-qualified models
* [Bring your own provider key](/docs/ai-gateway/guides/attaching-provider-keys): Use your own upstream provider credentials


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.