/v1/chat/completions with an OpenAI client and change only the model name. The native Gemini generateContent API and the OpenAI Responses API (/v1/responses) do 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: