◉GEMINI LABJP
●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●COMPUTER — Computer Use is now generally available in the Interactions and GenerateContent APIs (10/30)●LIVE — Live and TTS preview models shut down as early as 11/17 (16 days left). Move to gemini-3.8-live and the 3.8 TTS models●CLI — Gemini API CLI (gemini-api) is out in beta (10/27): a zero-dependency client for agents and CI●STORE — New paid projects now save Generate Content requests by default (store on) as of 10/26●NEW — Stop Re-Reading Every Crash Report: Gre…●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●COMPUTER — Computer Use is now generally available in the Interactions and GenerateContent APIs (10/30)●LIVE — Live and TTS preview models shut down as early as 11/17 (16 days left). Move to gemini-3.8-live and the 3.8 TTS models●CLI — Gemini API CLI (gemini-api) is out in beta (10/27): a zero-dependency client for agents and CI●STORE — New paid projects now save Generate Content requests by default (store on) as of 10/26●NEW — Stop Re-Reading Every Crash Report: Gre…
Articles/API / SDK
◈ API / SDK/2026-06-12Intermediate

Gemini's Preview Image Models Shut Down on June 25 — Code Diffs and Checks From an Actual GA Migration

How I moved my image pipeline off Gemini's preview image models before the June 25 shutdown — confirming GA model IDs, Python code diffs, regression checks, and a safe cutover order.

gemini-api291image-generation9model-migration8deprecation9gemini-3-1-flash-imagePython52TypeScript8

✦ Premium Article

On June 25, the Gemini API shuts down two preview image-generation models: gemini-3.1-flash-image-preview and gemini-3-pro-image-preview. The date is confirmed on the official deprecations page, which leaves roughly two weeks.

I run a batch pipeline that generates image variations for a wallpaper app I maintain as an indie developer, and I assumed my main path had long been migrated. Then I did an actual audit and found a side script — a prototyping tool I had written months ago — still pointing at the preview model. What I had budgeted as a "swap one model ID" task turned out to involve a wrong-ID 404, and a category of verification that becomes permanently impossible after the shutdown date.

Here is the working log: every step from audit to cutover, plus the differences I could actually measure between the preview and GA models, with runnable code.

What stops, and what replaces it

Two dedicated image-generation preview models are being retired, and each has a GA counterpart that has been generally available since May 28. So there is no "the replacement isn't ready yet" problem here.

  • gemini-3.1-flash-image-preview → migrate to gemini-3.1-flash-image
  • gemini-3-pro-image-preview → migrate to gemini-3-pro-image

Let me share the first trap I stepped into. I typed the pro-tier GA model as gemini-3.1-pro-image and got a 404 NOT_FOUND. The flash model carries the "3.1" version, but the pro model's official ID stays at "3" — the correct ID is simply the preview name with -preview removed. Product announcements sometimes write the pair loosely as "Gemini 3.1 Flash Image / 3.1 Pro Image," so if you reconstruct IDs from memory, you may take the same detour I did.

One scoping note: this shutdown concerns the dedicated image-generation model family. It does not affect the native Image Output capability of the main Gemini 3.2 Flash model — if that is all you use, you can stop reading here.

June has been a month of stacked deadlines for the Gemini API. The legacy Interactions API schema was deleted on June 8 (I wrote up that migration in Gemini Interactions API: Fixing What Broke When the Legacy outputs Schema Was Removed on June 6), the individual tiers of Gemini CLI and the Code Assist IDE extension wind down on June 18, and the image preview models follow on June 25. Putting all three dates on a calendar is a small act that prevents exactly the kind of straggler script I found.

Audit your code first — model IDs hide outside the code, too

The first job is finding every reference to the preview models, and I recommend searching for the substring image-preview rather than the full model IDs. A partial match still catches alias constants and abbreviated config values.

# Search broadly for the substring instead of exact model IDs
grep -rn "image-preview" \
  --include="*.py" --include="*.ts" --include="*.js" \
  --include="*.env*" --include="*.yaml" --include="*.yml" \
  --include="*.json" --include="*.toml" \
  .

In my repository this turned up two Python scripts and one .env file. The near miss was an environment variable hard-coded inside a GitHub Actions workflow definition — it shows up if you grep from the repository root, but it is exactly the kind of place you skip once you have told yourself "code is fixed, config is fixed."

Some references live entirely outside the repository. If you distribute model IDs through Firebase Remote Config or a settings table in your database, grep will never see them; open the actual admin console and read the live values.

I keep a general checklist for deprecation work in How to Handle Gemini API Model Deprecation and Migration Errors, but this particular migration is narrow — two models — so an accurate audit is most of the work.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Move your code off gemini-3.1-flash-image-preview and gemini-3-pro-image-preview before the June 25 shutdown, from audit to full cutover
✦Get working Python and TypeScript snippets: confirming GA model IDs with models.list, before/after call diffs, and error handling that separates 404 from 429
✦Run the preview-vs-GA regression comparison that becomes impossible after the shutdown, and adapt the 60-prompt method to your own image pipeline
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
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 →

Related Articles

◈ API / SDK2026-05-18
Rebuilding My Wallpaper App's Color Variations on Nano Banana 2 — Life After the Imagen 4 Shutdown, and Why Resolution Decides the Margin
How I moved my wallpaper app's color-variation pipeline onto gemini-3.1-flash-image (Nano Banana 2): where Imagen 4 users have to go now, the current Interactions API call shape, a two-stage design derived from published per-resolution pricing, and a script that finds retired model IDs still sitting in your code.
◈ API / SDK2026-10-22
Before You Swap in gemini-4-argon, Search Your Own Code for What to Remove
Four habits can break or silently change when you move to gemini-4-argon: explicit caches, sampling parameters, small max_output_tokens and short timeouts. A stdlib-only script finds them in your repository, with what to check after the swap and when to stay on Flash.
◈ API / SDK2026-10-19
When 404 and 429 Show Up in the Same Gemini API Log, Check the Model Name Before the Quota
A triage order for Gemini API logs that mix 404 NOT_FOUND and 429 RESOURCE_EXHAUSTED, plus a small Python script that separates a bad model name from a real quota limit without generating anything.