Skip to content
Nilay Kabariya

Entry No.051·AI··3 min read

Gemini 2.5 Flash "no longer available to new users" (404)

Code that worked yesterday 404s with a new API key. Every old Gemini model name tested: three different messages, and why the model list won't warn you.

by Nilay#gemini#google#nodeAI

The error, verbatim

Jump to the fix ↓
{
  "error": {
    "code": 404,
    "message": "This model models/gemini-2.5-flash is no longer available to new users. Please update your code to use models/gemini-3.8-flash for the latest features and improvements. We recommend you to use the Interactions API (https://ai.google.dev/gemini-api/docs/get-started).",
    "status": "NOT_FOUND"
  }
}

Tested on

@google/genai
2.27.0
API key
new, free tier (AI Studio)
Node / OS
24.14.0 / Windows 11 Pro
Date
October 7, 2026
Contents
  1. The model list doesn’t warn you01
  2. The fix02
  3. Don’t jump straight to the suggested model03
  4. What didn’t work04
  5. How this was tested05

This isn’t your code, and it isn’t your key’s permissions. Google has retired the 2.x models for keys and projects that didn’t use them before. That’s why the same code keeps working on a colleague’s old key and fails on yours, or works on your laptop and fails in a new deployment with a fresh key.

I called every older model name with a brand-new key. There are three different messages, depending on how old the model is:

Model Message
gemini-2.5-flash, gemini-2.5-pro, gemini-2.5-flash-lite 404 “no longer available to new users”
gemini-2.0-flash, gemini-2.0-flash-lite 404 “no longer available” (gone for everyone)
gemini-1.5-flash, gemini-1.5-pro 404 “is not found for API version v1beta, or is not supported for generateContent”

Each 404 for a 2.x model names its own replacement:

You asked for The error suggested
gemini-2.5-flash gemini-3.8-flash
gemini-2.5-pro gemini-3.1-pro-preview
gemini-2.5-flash-lite gemini-3.5-flash-lite
gemini-2.0-flash gemini-3.8-flash
gemini-2.0-flash-lite gemini-3.5-flash-lite

The model list doesn’t warn you

If you check ai.models.list() first, you’ll still find gemini-2.5-flash, gemini-2.5-pro and gemini-2.5-flash-lite in it, listed as supporting generateContent. Then the call 404s. So “it’s in the list” doesn’t mean your key can use it: only a real call tells you.

The fix

Change the model name. These worked with the new free key:

const res = await ai.models.generateContent({
  model: 'gemini-3.5-flash', // or 'gemini-3.5-flash-lite'
  contents: 'hi',
});

To stop this happening at the next retirement, you can use the moving alias instead of a version number. gemini-flash-lite-latest answered, and the response’s modelVersion showed it was serving gemini-3.5-flash-lite:

const res = await ai.models.generateContent({ model: 'gemini-flash-lite-latest', contents: 'hi' });
console.log(res.modelVersion); // gemini-3.5-flash-lite

The cost of an alias: the model behind it changes without notice, so output and pricing can shift under you. Log modelVersion so you can see when it does.

Don’t jump straight to the suggested model

The 404 for gemini-2.5-flash says to use gemini-3.8-flash. Every time I tried it that evening, it returned 503 “This model is currently experiencing high demand” or timed out, and gemini-flash-latest did the same. Meanwhile, older models kept answering. The newest model is the busiest one. Test the replacement before you ship it.

And for the Pro suggestion (gemini-3.1-pro-preview): on the free tier its quota is 0, so switching to it turns your 404 into a 429. That one is covered in Gemini API 429 RESOURCE_EXHAUSTED: why your limit is 0.

What didn’t work

How this was tested

A free Google AI Studio key on October 7, 2026 (a new one: it got the “to new users” 404), with @google/genai 2.27.0 on Node 24.14.0 (Windows 11). Every model was called once with a one-word prompt and maxOutputTokens: 1. The model list came from ai.models.list() with the same key. I didn’t have an older key to confirm that the 2.5 models still work for existing users. That part is what the error message itself says (“to new users”), not something I saw. Google retires models on its own schedule, so check the date above.

The code for every case above is public, so you can run it yourself: gemini-429 in nk-repro.

— N.K., end of entry No.051

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.050

    Gemini API 429 RESOURCE_EXHAUSTED: why your limit is 0

    Gemini's 429 hides three different limits, and one of them never resets. Each hit on purpose with a free key, plus the 503 high demand error.

    > {

    AI4 min
  2. No.046

    Fix: Groq API error 413, 429 and model_not_found

    Groq's 413 and 429 need different fixes. Its old Llama models now just say not found. All three reproduced on the free tier, with the fix for each.

    > 413 Request too large for model `openai/gpt-oss-20b` in organization `org_…` service tier `on_demand` on tokens per minute (TPM): Limit 8000, Requested 30074, please reduce your message size and try again.

    AI4 min
  3. No.045

    Fix: APIConnectionError "Connection error." (OpenAI, Anthropic)

    OpenAI's and Anthropic's SDKs both say only Connection error. Five real causes reproduced, from a local model that isn't running to antivirus HTTPS scanning.

    > APIConnectionError: Connection error.

    AI5 min

Post card · Newsletter

Get the next fix in your inbox.

One short email when a new entry is published. No spam, never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text