Skip to main content
The onboarding should have you covered, but this short quickstart guide is here just in case.

Making your first request

1

Sign in to app.ngrok.ai

Open app.ngrok.ai and sign in with your ngrok account.
2

Purchase credits

Top-up at least $5.00. Every request you make requires ngrok.ai credits.
3

Create your access key

Open Access Keys and create a new key. Copy the key right away—it’s shown only once—and store it somewhere safe. It looks like ng-xxxxx-g1-xxxxx.
4

Make your first request

Point your OpenAI SDK at the gateway using your access key:
import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://gateway.ngrok.ai/v1",
  apiKey: "ng-xxxxx-g1-xxxxx"
});

const res = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello, world!" }]
});
No need to sign up to OpenAI or bring your own keys for this request. ngrok.ai will handle the billing for you.

Already have credits and an access key?

Give this to your AI coding agent to complete the SDK integration step automatically.

Open in Cursor

Next steps