Skip to main content
This guide walks through using Anthropic Claude models with the AI Gateway. Anthropic is a built-in provider you can pay for with credits, so you can use Claude models without an Anthropic account of your own, or bring your own key.

Pay with credits (no Anthropic account)

You can use Claude models without your own Anthropic account. ngrok.ai supplies the Anthropic credentials and bills the model cost to your credits.
1

Create an access key and add credits

Follow the quickstart to create an access key and purchase credits in app.ngrok.ai.
2

Send requests

Point your SDK at the gateway with your access key:
The gateway supports both the Anthropic Messages API (/v1/messages) and OpenAI-compatible Chat Completions.

Bring your own Anthropic key

Want requests billed to your own Anthropic account instead of through credits? Store your Anthropic key once—the gateway attaches it for you on every request.
1

Create an access key

Follow the quickstart to create an access key in app.ngrok.ai if you don’t have one yet.
2

Add your Anthropic key

Add a provider key for Anthropic. ngrok stores it encrypted, so it never has to live in your application or get shared around—and you can reuse it across as many access keys as you need.
3

Route to it with a configuration

Create an access key configuration with an Anthropic routing rule set to Bring your own API key, then assign it to your access key.
4

Keep sending your access key

Your code doesn’t change. Send the same access key as before—the gateway swaps in your Anthropic key before the request leaves for Anthropic.

Explicit provider routing

Available models

Browse the model catalog for the full list of Claude models you can call through the gateway.

Files

Anthropic also supports the Files API for uploading documents and images once and referencing them by ID.

Next steps