Skip to content

AI Providers & Models3 min read

Google Gemini

Gemini models via AI Studio key

Google’s Gemini models pair very large context windows with aggressive pricing, which makes them a strong fit for context-heavy agent work — sweeping a big codebase, digesting long documents, or running high-volume tasks on the Flash tier. Setup takes about two minutes with a Google AI Studio key.

  1. Go to Google AI Studio (ai.google.dev) and sign in with a Google account. When no key is configured, the settings panel shows a Get Gemini API Key button that takes you there.
  2. Create an API key in the AI Studio console.
  3. Copy it — you’ll paste it into Nx IDE next.
  1. Open Settings → Providers.
  2. Choose Google Gemini in the API Provider dropdown.
  3. Paste the key into Gemini API Key. It is stored in the editor’s Secret Storage.
  4. Pick a model and save.

Optional: check Use custom base URL to route through a proxy instead of the default https://generativelanguage.googleapis.com.

The default model is gemini-3.1-pro-preview. The catalog spans three tiers:

Tier Examples Character
Pro gemini-3.1-pro-preview, gemini-3-pro-preview, gemini-2.5-pro Strongest reasoning and coding; ~1M-token context
Flash gemini-3.5-flash, gemini-3-flash-preview, gemini-2.5-flash, gemini-flash-latest Fast and inexpensive; the workhorse tier
Flash Lite gemini-3.1-flash-lite, gemini-flash-lite-latest Cheapest; bulk and utility work

Older dated 2.5-series previews remain selectable for compatibility. The dropdown in Settings → Providers is the authoritative roster for your installed version.

Capability notes, straight from the model definitions:

  • Image input and prompt caching are supported across the main line — screenshots and design mocks can go straight into your prompts, and repeated context bills at reduced cache-read rates.
  • Reasoning controls: Gemini 3.x models take a Model Reasoning Effort level (the 3.x Flash tiers add a “Minimal (Fastest)” option); the Gemini 2.5 family instead uses a Max Thinking Tokens budget — up to 32,768 thinking tokens on 2.5 Pro, which always reasons and cannot be set to zero.
  • Tiered pricing: on gemini-3.1-pro-preview, requests whose context stays under 200K tokens bill at a lower rate than longer ones — worth knowing before you deliberately fill a 1M-token window.

Google AI Studio keys typically include a free tier. It is fine for evaluation, but agent workloads send many requests per minute with large payloads, so free-tier quotas run out quickly — expect request-per-minute and daily caps to interrupt longer tasks. Two mitigations:

  • Enable billing on the key for production use.
  • Set a per-profile Rate limit (seconds between requests) in the provider settings to stay under a strict quota — see Model Behavior & Costs.
  • Whole-repository questions and cross-cutting analysis that benefit from the ~1M-token context.
  • High-volume, cost-sensitive pipelines on Flash / Flash Lite.
  • Multimodal tasks — feeding UI screenshots or diagrams into a coding task.
  • A budget-friendly second profile alongside a frontier model, switched per task.

Enterprises that need Gemini under their own cloud governance should use GCP Vertex AI instead — same models, different auth and billing path:

Google Gemini (this page) GCP Vertex AI
Auth AI Studio API key Service account / application default credentials
Billing Key-level, AI Studio Your Google Cloud project
Governance Minimal IAM, quotas, regional control
Setup time ~2 minutes Cloud-project setup required
Provider: Google Gemini
API Key: AIza… (from Google AI Studio)
Model: gemini-3.1-pro-preview (or a Flash model for volume work)
Rate limit: 10s (only if you're staying on the free tier)
  • Quota or rate-limit errors: you’re on free-tier limits or a low billing tier — enable billing, add a per-profile rate limit, or switch profiles and continue the task.
  • Preview model disappears: preview ids are retired as stable versions ship; reselect a current model in the dropdown.
  • Key works in AI Studio but not here: confirm the key was created for the Gemini API and hasn’t been restricted to other Google services.