Set up Google Gemini

Last validated:

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.

Your client and selected provider must support the same API format. Refer to Supported providers and clients for available setup options and requirements.

Prerequisites

Before you begin, you need:

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-3.8-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.

For available model IDs and aliases, refer to the Google AI documentation. Refer to the compatibility flags reference for the full list of flags.

Verify the provider

Administrators can test a connection to a specific model from the Models page of the Aperture admin dashboard.

  1. Open the Aperture admin dashboard at /admin/ and select Administration > Models.
  2. 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.
  3. 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".

Aperture sends a test request through the configured provider. This tests the gateway's provider configuration, not a separate client's credentials or another user's grants.

Next steps