- OpenAI-compatible Chat Completions: send requests to
/v1/chat/completionswith an OpenAI client and change only the model name. - Native Gemini: send requests to
/v1beta/models/{model}:generateContentor:streamGenerateContentwith a Gemini client.
/v1/responses) does not 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
Follow the quickstart to create an access key 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.4
Assign and send requests
Assign the configuration to your access key and send requests with your access key:
Native Gemini API
Point a Gemini client athttps://gateway.ngrok.ai and send your access key.
The gateway accepts it as Authorization: Bearer or as X-Goog-Api-Key, the header Google’s own SDKs set.
Content-Type, responses on this surface carry Ngrok-AIG-Request-Id, Ngrok-AIG-Attempts, and Ngrok-AIG-Model.
See Response headers.