Set up Google Gemini
Configure a Google Gemini provider in Aperture so your team can access Gemini models through your tailnet. This topic covers the direct Gemini API with API key authentication. The Gemini Enterprise Agent Platform uses service account authentication and separate endpoint formats for Gemini and Anthropic models.
For the Gemini Enterprise Agent Platform with service account authentication (which also supports Anthropic models), refer to set up a Gemini Enterprise Agent Platform provider.
Aperture routes requests based on the model name, not the LLM client. Any LLM client configured to use Aperture can access any provider your admin has set up. Refer to the provider compatibility reference for the full list of supported providers and API formats.
Prerequisites
Before you begin, you need:
- An Aperture gateway accessible from your device. Refer to get started with Aperture if you have not set this up.
- A Google AI Studio API key.
Configure the provider
Add Google Gemini as a provider in your Aperture configuration:
{
"providers": {
"gemini": {
"baseurl": "https://generativelanguage.googleapis.com",
"apikey": "<your-gemini-key>",
"authorization": "x-goog-api-key",
"models": ["gemini-2.5-flash", "gemini-2.5-pro"],
"name": "Google Gemini",
"compatibility": {
"gemini_generate_content": true
}
}
}
}
The authorization field controls how Aperture sends the API key. The x-goog-api-key value sends the key in a x-goog-api-key header, which the direct Gemini API requires. The gemini_generate_content flag configures Aperture to use the Gemini API format instead of the default OpenAI chat completions format.
Google publishes -latest aliases (such as gemini-flash-latest) that resolve to the current stable version, so you can use either specific or alias model names. For the full list of available models, refer to the Google AI documentation. Refer to the provider compatibility reference for the full list of flags.
Verify the provider
The best way to verify a connection to a specific model is to send a test request through the Models tab of the Aperture dashboard.
- Open the Aperture dashboard and select the Models tab.
- Find the model you want to test in the list of configured models. If the model is not listed, check your provider configuration and ensure the model name is correct.
- Select the Play icon to the left of the model name to send a test request. If the request succeeds, the icon changes to a green check mark. If it fails, the icon changes to a red "X".
This sends a request from your web browser to the tailnet to verify that Aperture can successfully route requests to the model through the configured provider and that your user account has the necessary permissions to access the model.
Next steps
- Grant model access: Control which models each user or group can access through Aperture.
- Set up the chat UI: Let users talk to your configured models from their browser.
- Set up LLM clients: Connect coding tools to route requests through Aperture.