gemini-2.5-flash-image, but Google lists October 2, 2026 as the model’s earliest shutdown date. Treat it as a migration source, not the default for a new long-lived application.
Gemini 2.5 Flash Image lifecycle and API status
Google continues to document the stable model ID while its Gemini API deprecation schedule lists the earliest shutdown date. The Gemini 2.5 Flash Image model page describes the upstream generation and conversational editing capabilities.API capabilities
Requests use the Geminicontents[].parts[] structure. A generation request includes a text part; an edit request places the instruction and one or more Base64 source images in the same parts array.
The model supports ten aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9. It does not expose 2K or 4K output, and sending imageSize: "1K" is not equivalent to omitting the field.
See Gemini 2.5 Flash Image parameters for the full request contract.
Integration constraints
Parse all response parts
Images appear incandidates[].content.parts[].inlineData. Text may be returned beside an image, so a client must scan every part and use inlineData.mimeType to determine the file extension.
Remove preview-era model names
gemini-2.5-flash-image-preview is deprecated. Do not use a preview identifier as a fallback when migrating the stable model.
Keep upstream and gateway scope separate
The public API implements the documented Gemini image generation subset. A field or tool appearing in Google’s broader Gemini reference is not automatically available unless it is present in the OpenAPI and model parameter pages.Choose a migration target
The replacement depends on the output contract:- choose
gemini-3.1-flash-lite-imagewhen the workflow will remain at 1K; - choose
gemini-3.1-flash-imagefor 2K, 4K, or extended aspect ratios; - compare
gemini-3-pro-imagefor typography-sensitive layouts, professional mockups, or high-value assets.
Migration checklist
- Move the model ID into configuration instead of embedding it in business logic.
- Run representative prompts and source images against the replacement.
- Update
imageSizeand aspect-ratio validation for the new model. - Remove assumptions about PNG output or
parts[0]. - Preserve a reversible configuration change for rollout.
API endpoints
Synchronous generation usesPOST /v1beta/models/gemini-2.5-flash-image:generateContent. For work that must survive the client connection, submit /v1/images/tasks with action=generate|edit and retrieve GET /v1/tasks/{task_id}.
Check the 2.5 parameters
Confirm the omitted imageSize field and ten supported ratios.
Run the API examples
Copy generation, asynchronous, editing, and parsing code.