imagen-4.0-generate-001 — Deprecated
- Deprecated
- —
- Shutdown
- 2026-06-24
- Status
- deprecated
- Replacement
- gemini-3-pro-image-preview orgemini-2.5-flash-image
Action required
Production code calling imagen-4.0-generate-001 will return errors after 2026-06-24.
Quick fix — copy & paste
Choose your language. The "before" block matches the deprecated call; the "after" block is the drop-in replacement.
# Gemini: imagen-4.0-generate-001 (deprecated)
model = "imagen-4.0-generate-001" # Replacement
model = "gemini-3-pro-image-preview orgemini-2.5-flash-image" // Gemini: imagen-4.0-generate-001 (deprecated)
const model = "imagen-4.0-generate-001"; // Replacement
const model = "gemini-3-pro-image-preview orgemini-2.5-flash-image"; "model": "imagen-4.0-generate-001" "model": "gemini-3-pro-image-preview orgemini-2.5-flash-image" This migration was generated automatically from the model rename. If your code does more than swap a model id, double-check request/response shapes against the official Gemini migration guide.
Error messages
Seeing one of these? You're in the right place.
-
model_not_found: imagen-4.0-generate-001 -
The model `imagen-4.0-generate-001` has been deprecated -
The model `imagen-4.0-generate-001` does not exist or you do not have access to it
Replacement options
-
gemini-3-pro-image-preview orgemini-2.5-flash-imageCompare token cost →
Other Gemini deprecations
What this means for your code
imagen-4.0-generate-001 is an image-generation model called through the images endpoint. Image generation models often change their quality enums, default response format (URL vs base64), supported sizes, and per-image pricing between versions. Migration is rarely a clean string swap.
Gemini has scheduled imagen-4.0-generate-001 for shutdown on 2026-06-24. That gives you 47 days to migrate. Until then the model still works, but every API call after that date will return a model_not_found error.
Find every call in your codebase
Before you change anything, locate every place the deprecated model id is referenced. Search source files, environment files, feature flags, and config repos. Use these commands from your project root:
Python projects
grep -rn '"imagen-4.0-generate-001"' --include="*.py" . JavaScript / TypeScript projects
grep -rn '"imagen-4.0-generate-001"' --include="*.{js,ts,tsx,jsx}" . Anywhere (configs, scripts, infra)
grep -rn "imagen-4.0-generate-001" . Migration checklist
Steps in order. Skip any that don't apply, but read the whole list — for image gen models, the non-obvious steps are usually the ones that break in production.
- 1. Update the model id in image generation calls
- 2. Map the old quality enum (standard/hd) to the new model's enum (low/medium/high/auto)
- 3. Verify supported sizes — newer models may not support 256x256 or 512x512
- 4. Check response_format default — gpt-image-1 returns base64 by default while DALL-E returned URLs
- 5. Recompute per-image cost; some new models charge by tile count, not by image
Will this migration cost more?
Switching from imagen-4.0-generate-001 to gemini-3-pro-image-preview orgemini-2.5-flash-image could change your costs significantly. Calculate the exact difference for your prompts.
Open the cost calculator →