InsightWorker Logo
  • contact@verticalserve.com
Docs / LLM providers / Google Gemini (AI Studio)

Google Gemini (AI Studio)

The fastest path to Gemini — API key only, no GCP project required. Use this for quick testing or when you don't have GCP set up.

For enterprise / regulated workloads, prefer Vertex AI (data stays in your GCP project, IAM-governed).

Configuration

~/.insightworker/.env:

LLM_PROVIDER=gemini
GEMINI_API_KEY=AIza...
GEMINI_MODEL=gemini-2.0-flash-001

Get an API key

  1. Visit aistudio.google.com/apikey
  2. Sign in with your Google account
  3. Create API key — pick or create a project
  4. Copy the key (starts with AIza)

Recommended models

Use caseModel
General apps, tool usegemini-2.0-flash-001
Long context, hard reasoninggemini-2.5-pro (2M context!)
Cheap classificationgemini-2.0-flash-lite

Gemini 2.5 Pro has a 2 million token context window — useful for apps that need to load lots of documents at once. InsightWorker's per-model output cap scales accordingly (~800k chars).

Where data goes

AI Studio is a consumer-tier endpoint. Prompts go to Google's cloud, governed by Google AI Studio's data terms. For regulated workloads, use Vertex AI instead (same models, in your GCP project).

Tool calling and schema

Gemini's function-calling schema is OpenAPI 3.0-ish — stricter than full JSON Schema. InsightWorker sanitizes tool schemas automatically (strips $ref, oneOf, additionalProperties and other features Gemini doesn't support).

If a custom tool fails on Gemini but works on OpenAI, the issue is likely an unsupported schema feature. Simplify the input_schema (avoid $ref and oneOf) and re-test.

Common gotchas

SymptomCauseFix
400 on tool callSchema feature not supported by GeminiSimplify your tool's input_schema
429 rate-limitedFree tier quotaAdd a paid tier or switch to Vertex
Empty content with tool callsGemini sometimes returns tool-only responsesAgent handles this; if visible to you, it's a bug — file an issue

See also


Source: docs/providers/gemini-ai-studio.md in the public repo. Open a PR with corrections.