Skip to main content
Prerequisite: Complete the Quickstart to get an access key. All requests go to https://gateway.ngrok.ai.
The AI Gateway works with any SDK or HTTP client that supports OpenAI API or Anthropic Claude API format. If your language or framework isn’t covered in the dedicated guides, you can still use the gateway.

Requirements

For any SDK or client to work with the AI Gateway, it must:
  1. Support the OpenAI API or Anthropic Claude API format
  2. Allow customizing the base URL / endpoint
  3. Send requests with proper authorization headers (for OpenAI API, Authorization; for Anthropic Claude API, x-api-key)

Authentication

Pass your access key (ng-xxxxx-g1-xxxxx) as the API key. The AI Gateway injects upstream provider credentials from your access key configuration.

cURL

For testing or shell scripts:

HTTP request format

Any HTTP client can call the AI Gateway:

Using provider prefixes

All clients support routing to specific providers using model prefixes:

Supported endpoints

The AI Gateway supports these endpoints:

Next steps