SunsetDiff

Replacement for gemini-2.5-flash-image (Google Gemini API): what changes when you switch

The official replacement is gemini-3.1-flash-lite-image. gemini-2.5-flash-image shuts down on 2027-03-15 per Google Gemini API's deprecation page (checked 2026-11-12). On the labeled example of 10 million input tokens and 2 million output tokens, gemini-3.1-flash-lite-image costs $5.5 a month, higher than $3.08 for gemini-2.5-flash-image.

gemini-2.5-flash-image model page · Google Gemini API

Official replacement. Full diff page

gemini-2.5-flash-image to gemini-3.1-flash-lite-image

All values from official sources Checked 2026-11-12.

Price per 1M tokens

Price comparison. Example monthly cost for 10M input tokens and 2M output tokens. Labeled example, not a bill.
FieldOldNewChange
Input $0.3 $0.25 -16.7% (lower)
Output $0.039 $1.5 +3746.2% (higher)
Cached input Not published Not published Not published
Example monthly cost $3.08 $5.5 Example only

Context and max output

Token limits
LimitOldNewChange
Context window 65,536 65,536 0% (same)
Max output 32,768 4,096 -87.5% (lower)

Capabilities that differ

No differing capability values are published for both models.

API changes

No parameter change is listed on the official pages we checked. The sample below only swaps the model id.

Code

python before
from google import genai
client = genai.Client()
interaction = client.interactions.create(
    model="gemini-2.5-flash-image",
    input="Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme",
)
python after
from google import genai
client = genai.Client()
interaction = client.interactions.create(
    model="gemini-3.1-flash-lite-image",
    input="Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme",
)
typescript before
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
  model: "gemini-2.5-flash-image",
  input: "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme",
});
typescript after
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
  model: "gemini-3.1-flash-lite-image",
  input: "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme",
});
curl before
curl -s -X POST \
  "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gemini-2.5-flash-image","input":[{"type":"text","text":"Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"}]}'
curl after
curl -s -X POST \
  "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gemini-3.1-flash-lite-image","input":[{"type":"text","text":"Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"}]}'

Checklist

  1. Read the shutdown date for gemini-2.5-flash-image on the linked official page.
  2. Point your requests at gemini-3.1-flash-lite-image.
  3. Re-check price, context, and parameters on the provider pages linked here.
  4. Ship the change before the published shutdown date.

Related models

Questions

What is the replacement for gemini-2.5-flash-image?

The official replacement is gemini-3.1-flash-lite-image. gemini-2.5-flash-image shuts down on 2027-03-15 per Google Gemini API's deprecation page (checked 2026-11-12). On the labeled example of 10 million input tokens and 2 million output tokens, gemini-3.1-flash-lite-image costs $5.5 a month, higher than $3.08 for gemini-2.5-flash-image.

Is gemini-3.1-flash-lite-image cheaper than gemini-2.5-flash-image?

No. The labeled example monthly cost is $3.08 for the old model and $5.5 for the replacement.

Does gemini-3.1-flash-lite-image have a bigger context window than gemini-2.5-flash-image?

The context window stays 65,536 tokens.

Sources

Deprecation alerts

We email you before models shut down. Unsubscribe anytime.

Deprecation alert signup
Providers (optional)