Skip to main content
Gemini 2.5 Flash Image is the original Nano Banana image generation and editing model. Existing API integrations use 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.
If production traffic still depends on gemini-2.5-flash-image, add a configurable replacement and complete regression testing before the upstream retirement window. Google’s date does not establish the exact date when this gateway will remove the model.

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 Gemini contents[].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 in candidates[].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-image when the workflow will remain at 1K;
  • choose gemini-3.1-flash-image for 2K, 4K, or extended aspect ratios;
  • compare gemini-3-pro-image for typography-sensitive layouts, professional mockups, or high-value assets.
Do not decide from request price alone. Compare prompt adherence, edit behavior, returned MIME types, failure handling, latency, and accepted-output rate with the application’s real inputs.

Migration checklist

  1. Move the model ID into configuration instead of embedding it in business logic.
  2. Run representative prompts and source images against the replacement.
  3. Update imageSize and aspect-ratio validation for the new model.
  4. Remove assumptions about PNG output or parts[0].
  5. Preserve a reversible configuration change for rollout.
Use the model comparison to select the target and the pricing page for current gateway rates. For capacity planning, use the separate traffic capacity and availability contract. Its request-rate figure describes gateway access, not completed image throughput or an SLA for this model.

API endpoints

Synchronous generation uses POST /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.
Last modified on September 3, 2026