Skip to main content
1

Login to the ngrok Dashboard

Go to dashboard.ngrok.com and sign in to your account.
2

Navigate to AI Gateways

In the left sidebar, click on AI Gateways under the Universal Gateway section.
3

Create a New AI Gateway

Click the + New AI Gateway button to create your gateway.
4

Enter a URL

Enter a URL for your AI Gateway endpoint. If the domain is available, it will automatically be reserved for you. Click Create & Configure to finish setup.
5

Integrate with Your Application

Update your OpenAI SDK configuration to point to your new AI Gateway endpoint:
const openai = new OpenAI({
  baseURL: "https://your-ai-gateway.ngrok.dev",
  apiKey: process.env.OPENAI_API_KEY
});
Then use your SDK as normal:
const res = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello, world!" }]
});

Next steps