GEMINI LABJP
NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20
Articles/API / SDK
API / SDK/2026-06-11Intermediate

Gemini 3.2 API Developer Guide — Correct Model IDs, Migration from 3.1, and Production Checklist

A practical guide to calling Gemini 3.2 via the API: correct model IDs, what changed from Gemini 3.1, Python and TypeScript code examples, and a production migration checklist.

Gemini 3.26Gemini API192gemini-3.2-promodel migration2Python38TypeScript8

"I specified gemini-3.2-pro but got a model-not-found error — what's the correct model ID?"

This question keeps coming up in developer communities. There's plenty of content covering Gemini 3.2 for general users, but a focused implementation guide for API developers has been hard to find. This article fills that gap.

We'll cover the right model IDs to use, what actually changed at the API level from Gemini 3.1, working code examples in Python and TypeScript, and a checklist to run through before switching production traffic.

Gemini 3.2 Model IDs

Let's start with the model identifiers. As of May 2026, the available Gemini 3.2 model IDs are:

# Available Gemini 3.2 model IDs (May 2026)
MODELS = {
    "pro": "gemini-3.2-pro",           # Highest capability, long-context tasks
    "flash": "gemini-3.2-flash",       # Fast, balanced cost and quality
    "flash_lite": "gemini-3.2-flash-lite",  # Lowest latency, high-frequency calls
}

Here's when to use each:

  • gemini-3.2-pro: Long document analysis, complex reasoning, multimodal tasks requiring the largest context window
  • gemini-3.2-flash: General-purpose text generation, classification, and chat — the best starting point for most applications
  • gemini-3.2-flash-lite: Real-time applications or high-volume pipelines where latency and cost are the top priorities

Note that gemini-3.2 alone (without the -pro or -flash suffix) doesn't exist as a valid model ID. You need the full string. For a broader overview of how Google structures model ID aliases like latest and stable, see Gemini API: Understanding Model IDs — stable, latest, preview, and experimental explained.

What Changed from Gemini 3.1 to 3.2

The good news: you won't need to refactor anything major. Here's what actually changed at the API level.

① Response structure is backward compatible

The response object shape is identical between 3.1 and 3.2. Your existing response.text calls, token count access, and finish reason checks will all work without modification.

# Same code works with both 3.1 and 3.2
response = model.generate_content("A simple question")
print(response.text)                 # Text output
print(response.usage_metadata)      # Token usage

thinking_budget behavior changed in Pro

In Gemini 3.1 Pro, omitting thinking_budget defaulted to approximately 8,000 tokens of reasoning. In Gemini 3.2 Pro, the model now dynamically adjusts thinking depth based on task complexity when no budget is specified.

Simple prompts consume fewer thinking tokens automatically; complex tasks trigger deeper reasoning. In practice, this tends to reduce cost on straightforward requests while maintaining quality on demanding ones. If you want the same fixed budget as before, just set it explicitly:

import google.generativeai as genai
 
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
 
model = genai.GenerativeModel(
    model_name="gemini-3.2-pro",
    generation_config=genai.GenerationConfig(
        temperature=0.7,
        max_output_tokens=4096,
    )
)
 
# Explicit thinking budget — omit for automatic adjustment
response = model.generate_content(
    "Analyze the architectural tradeoffs in this system design: ...",
    generation_config={
        "thinking_config": {
            "thinking_budget": 10000
        }
    }
)

③ Stricter Function Calling schema validation

Gemini 3.1 silently tolerated mismatched types in tool parameter schemas — a string value passed where an integer was defined would often slip through. Gemini 3.2 now raises an INVALID_ARGUMENT error on schema violations.

If you see more INVALID_ARGUMENT errors after switching, audit your tool definitions first:

# Type-precise tool definition for Gemini 3.2
weather_tool = {
    "name": "get_weather",
    "description": "Get current weather for a specified city",
    "parameters": {
        "type": "object",
        "properties": {
            "city": {
                "type": "string",          # Must match actual values sent
                "description": "City name"
            },
            "days": {
                "type": "integer",         # Use "integer", not "number"
                "description": "Forecast days (1–7)",
                "minimum": 1,
                "maximum": 7
            }
        },
        "required": ["city"]
    }
}

Python Implementation (Minimal Setup)

Here's a working Gemini 3.2 Pro call — the smallest useful implementation:

import google.generativeai as genai
import os
 
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
 
model = genai.GenerativeModel("gemini-3.2-pro")
 
def ask_gemini(prompt: str) -> str:
    """Send a prompt to Gemini 3.2 Pro and return the text response."""
    try:
        response = model.generate_content(prompt)
        return response.text
    except genai.types.BlockedPromptException as e:
        print(f"Content blocked by safety filter: {e}")
        return ""
    except Exception as e:
        print(f"API error: {e}")
        raise
 
# Usage
result = ask_gemini("Explain Python context managers in plain terms")
print(result)
 
# Expected output:
# Context managers in Python let you manage resources cleanly...

For production-grade error handling with retries and backoff, see Gemini API Error Handling & Retry Patterns — Building a Production-Ready API Client.

TypeScript / JavaScript Implementation

For Node.js, Next.js, or edge runtimes:

import { GoogleGenerativeAI } from "@google/generative-ai";
 
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY!);
 
// Gemini 3.2 Flash — good default for most web applications
const model = genAI.getGenerativeModel({ model: "gemini-3.2-flash" });
 
async function generateText(prompt: string): Promise<string> {
  try {
    const result = await model.generateContent(prompt);
    return result.response.text();
  } catch (error) {
    if (error instanceof Error) {
      console.error(`Gemini API error: ${error.message}`);
    }
    throw error;
  }
}
 
// Multi-turn chat
async function chatWithGemini() {
  const chat = model.startChat({
    history: [
      {
        role: "user",
        parts: [{ text: "Tell me about TypeScript generics" }],
      },
      {
        role: "model",
        parts: [{ text: "TypeScript generics allow you to..." }],
      },
    ],
  });
 
  const response = await chat.sendMessage("Show me a practical example");
  console.log(response.response.text());
}

To migrate from 3.1, change the model string and update your packages:

# Update to latest SDK version
npm install @google/generative-ai@latest
# or
pip install google-generativeai --upgrade

That's usually all you need. If you're using only text generation without Function Calling, no other code changes are required.

Production Migration Checklist

Before switching live traffic to Gemini 3.2:

Before migrating:

  • [ ] Decided which variant to use (gemini-3.2-pro vs gemini-3.2-flash vs gemini-3.2-flash-lite)
  • [ ] Reviewed Function Calling tool schemas for type precision if applicable
  • [ ] Decided whether to set thinking_budget explicitly or use auto-adjustment
  • [ ] Updated SDK packages to latest version

After migrating:

  • [ ] Compared outputs from 3.1 and 3.2 on your actual prompts — quality and format as expected?
  • [ ] Monitored error rate and latency — no unexpected spikes
  • [ ] Checked token consumption via usage_metadata — no significant increase
  • [ ] Confirmed Function Calling success rate is stable

For rate limits and quota management details, Gemini API Rate Limiting & Quota Management — Complete Production Guide covers everything you need.

If you want the full picture of what's new in Gemini 3.2 beyond the API, Gemini 3.2 Complete Guide — What Changed, Real-World Usage, and Comparison with Previous Models is worth reading alongside this.


May 2026 Updates

A few additions since this guide was first published.

Gemini 2.0 Flash Deprecation — June 1, 2026

If any of your projects are still using gemini-2.0-flash, migrate now. Gemini 2.0 Flash is being deprecated on June 1, 2026, after which the model will stop responding. Drop-in replacements are gemini-2.5-flash (optimized for cost and speed) or gemini-3.2-flash (latest generation). Step-by-step migration instructions are in Gemini 2.0 Flash Deprecation: Migrate to 2.5 Flash Before June 1.

May 2026 API Changes

There were several Gemini API changes in May 2026, particularly around Function Calling behavior and streaming responses. If you're running production systems, check Gemini API Developer Update: May 2026 for a full rundown of what changed and what you need to review.

June 2026 update — Gemini 3.5 arrived at I/O 2026

This guide is written around Gemini 3.2, but at Google I/O 2026 on May 19, the next generation — Gemini 3.5 Flash — was announced. It offers flagship-class intelligence at Flash speed, reportedly beats 3.1 Pro on coding and agentic benchmarks, and brings the cost of long-horizon tasks down sharply. Gemini 3.5 Pro is in internal use, with general rollout flagged for the following month.

The migration discipline covered above — start from the model-ID swap, then check the Function Calling and streaming deltas — carries straight over to a 3.5 move. I would still settle your setup on 3.2 first, then switch the model ID and run regression tests once 3.5's general availability stabilizes. I/O also introduced Managed Agents, where a single API call provisions an isolated environment, so if you are building agent-style processing it is worth weighing during the migration.

Where to Start

The fastest way to evaluate Gemini 3.2 for your use case: swap the model ID to gemini-3.2-flash in your dev environment and run your existing test suite.

If you're not using Function Calling, a single string change is all it takes. You'll immediately get a sense of how 3.2 handles your specific prompts and whether the migration is straightforward or needs extra attention. Production switchover decisions are much easier with a few hours of real data.

Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

API / SDK2026-05-11
Gemini 3.2 API Suddenly Broke — 5 Common Errors and How to Fix Them
Switched to Gemini 3.2 API and hit a wall? This guide covers 5 common errors developers encounter during migration — wrong model IDs, rate limits, context overflow, streaming interruptions, and Function Calling schema failures — with working code fixes.
API / SDK2026-04-27
Cancelling Gemini API Streams the Right Way — AbortController, asyncio, and the User-Initiated Stop Button
Hitting your chat UI's stop button shouldn't just freeze the screen — it should also stop billing. This guide shows how to wire up AbortController, request.is_disconnected, and the buffered-history pattern so cancellation actually does what users expect.
API / SDK2026-03-11
Gemini API Quickstart — Getting Started with Python and TypeScript
Step-by-step guide to set up and use Gemini API with Python and TypeScript SDKs
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →