🎉 Join us at the kagent Community Party at KubeCon Atlanta on Nov 12
Documentation

Gemini is Google's AI model family that can be accessed directly through the Google AI Studio API.

Before you begin#

Make sure that your Google Cloud account has a project with the Gemini API enabled.

Configuring Gemini#

  1. Get your API key from Google AI Studio.

  2. Create a Kubernetes Secret that stores the API key.

    kubectl create secret generic kagent-gemini -n kagent --from-literal GOOGLE_API_KEY=<your_api_key>
  3. Create a ModelConfig resource using the Gemini provider.

You can find out the latest model names and capabilities on the Gemini API docs. Once you have chosen a model, replace the model field with the name such as gemini-2.5-pro.

apiVersion: kagent.dev/v1alpha2
kind: ModelConfig
metadata:
name: gemini-model-config
namespace: kagent
spec:
apiKeySecret: kagent-gemini
apiKeySecretKey: GOOGLE_API_KEY
model: gemini-2.5-flash
provider: Gemini
gemini: {}
  1. Apply the above resource to the cluster.

Once the resource is applied, you can select the model from the Model dropdown in the UI when creating or updating agents.

Kagent Lab: Discover kagent and kmcp
Free, on‑demand lab: build custom AI agents with kagent and integrate tools via kmcp on Kubernetes.