Skip to main content

Google Gemini

Kenaz supports Google's Gemini model family through two endpoints:

  • AI Studio (generativelanguage.googleapis.com) — public API, authenticates with a Google AI Studio API key. Easiest path for personal use and experimentation.
  • Vertex AI (aiplatform.googleapis.com) — enterprise path, runs inside your Google Cloud project, authenticates with a service account or Application Default Credentials (ADC).

Pick the endpoint that matches how your Google Cloud access is set up.

What you need

  • A Google account
  • A Google AI Studio API key — free tier available, paid tier unlocks higher rate limits

Steps

  1. Get an API key. Open aistudio.google.com/app/apikeyCreate API key. The key starts with AIza.
  2. Add to Kenaz. Open Providers → Add provider → Google Gemini.
    • Endpoint: select AI Studio (default).
    • API Key: paste the key (AIza…).
    • Click Connect. Kenaz calls the AI Studio /v1beta/models endpoint and returns the list of models your key can access that support generateContent or streamGenerateContent.
  3. Pick one or more models from the list, then click Add provider.

Model discovery is live — the list reflects what your key has access to at the moment you click Connect.

Vertex AI

What you need

  • A Google Cloud project with the Vertex AI API enabled (aiplatform.googleapis.com)
  • A region where Vertex AI supports Gemini (e.g. us-central1, europe-west4)
  • One of three auth options (see below)

Steps

  1. Add to Kenaz. Open Providers → Add provider → Google Gemini.

  2. Endpoint: select Vertex AI.

  3. GCP Project ID: enter your Google Cloud project ID (e.g. my-gcp-project).

  4. Region: enter the Vertex AI region (e.g. us-central1). Default is us-central1.

  5. Auth method: pick one of:

    • ADC (Application Default Credentials) — Kenaz uses whatever credentials gcloud has configured. Run gcloud auth application-default login in a terminal before starting Kenaz. This is the right pick for developer machines already logged into gcloud.
    • Service account (paste) — paste the full contents of a service-account JSON key file directly into the API Key field. The JSON starts with { "type": "service_account", … }. Kenaz stores the JSON in your OS keychain.
    • Service account (path) — enter the filesystem path to a service-account JSON key file (e.g. /path/to/service-account.json). Kenaz reads the file at call time; it is not copied into the keychain.
  6. Model IDs: Vertex AI does not expose a simple /models list endpoint that Kenaz can poll, so enter the Gemini model IDs you want to use, one per line (e.g. gemini-2.5-pro, gemini-2.0-flash). Use the canonical model IDs from the Vertex AI model garden.

  7. Click Add provider.

Models and what they're for

Google publishes the canonical model list at ai.google.dev/gemini-api/docs/models (AI Studio) and cloud.google.com/vertex-ai/generative-ai/docs/learn/models (Vertex AI).

Notable picks:

  • gemini-2.5-pro — flagship. Long context, vision, strong reasoning.
  • gemini-2.5-flash — faster and cheaper than Pro; good daily-driver.
  • gemini-2.0-flash — previous generation Flash, still capable at lower cost.

Kenaz supports vision (image inputs) on all Gemini models that declare vision capability. Note the following limitations in the adapter:

  • PDF inputs are not supported inline — Gemini requires the File API for PDFs, which is out of scope. Attach PDFs via the harness's text-extraction path instead.
  • GIF images are rejected by the Gemini API; the harness will surface this as an error.
  • Tool call IDs are synthesised positionally (call_0, call_1, …) because Gemini does not assign stable IDs.

Pricing

Privacy posture

Troubleshooting

  • 401 Unauthorized / 403 Forbidden (AI Studio) — the API key is invalid or expired. Regenerate at aistudio.google.com/app/apikey.
  • 401 Unauthorized (Vertex AI / ADC) — ADC token is expired or not configured. Run gcloud auth application-default login again.
  • 403 Permission denied (Vertex AI) — the service account or ADC identity doesn't have the roles/aiplatform.user role on the project, or the Vertex AI API is not enabled. Enable it at console.cloud.google.com/apis/library/aiplatform.googleapis.com and check IAM.
  • gemini: AI Studio requires an API key — you selected AI Studio but left the API key blank. Paste the AIza… key.
  • No models listed after Connect (AI Studio). The key is valid but the account hasn't been provisioned for any generateContent-capable models yet. Try a different key or check the API key's associated project.
  • Vertex model not found. Confirm the model ID is spelled correctly and is available in the region you specified. Not all Gemini models are available in all regions.