Skip to main content
Google AI Studio provides Gemini models. The gateway supports three APIs:
  • OpenAI-compatible Chat Completions: if your OpenAI client already uses the gateway URL and your ngrok access key, change only the model name and send requests to /v1/chat/completions.
  • Native Gemini GenerateContent: send requests to /v1beta/models/{model}:generateContent or :streamGenerateContent with a Gemini client.
  • Native Gemini Interactions: send stateless create requests to /v1beta/interactions, with a JSON response or a stream of server-sent events (SSE).
The OpenAI Responses API (/v1/responses) doesn’t reach Google models.
Google is a built-in provider with ngrok.ai inference available, so a provider key is optional. Add your own Google key to bill usage to your Google account instead of your ngrok credits.

Setup

1

Create an access key and add credits

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

Store your Google API key (optional)

Skip this step to use ngrok.ai inference. To bring your own key, generate one at aistudio.google.com, then add a provider key.
3

Create a configuration

Create an access key configuration with a google routing rule and allow Google in the access scope. To use your own Google key, set the routing rule to Bring your own API key and select your stored Google key.
4

Assign and send requests

Assign the configuration to your access key. Follow the Google Gen AI SDK guide to install the SDK and send requests.

Native Gemini credentials

See SDK authentication for access key headers and credential precedence.

Generate content requests

See GenerateContent requests for native endpoints and cURL examples, or SDK streaming for Python and TypeScript examples.

Interactions requests

See SDK Interactions for examples and gateway restrictions, or Interactions requests for the REST endpoint.

Available models

See the model catalog.

Next steps