◉GEMINI LABJP
●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer
Articles/API / SDK
◈ API / SDK/2026-04-12Beginner

Fixing Gemini API 'Model Not Found' Errors: A Complete 2026 Guide

Getting a 'model not found' or INVALID_ARGUMENT error in the Gemini API? This guide explains every cause and fix, including correct model names for 2026 and how to use generativelanguage.googleapis.com properly.

gemini-api291troubleshooting98error15model-namegemini-2.5-pro13generativelanguage3

If you've been staring at an error like this for the past hour, you're not alone:

404 models/gemini-pro is not found
INVALID_ARGUMENT: model not found: models/gemini-2.5-pro
400 Request contains an invalid argument

Google regularly releases new models and retires old ones — and the Gemini 2.5 Pro / Gemini 3 series transition in 2026 has tripped up a lot of developers. In the vast majority of cases, the culprit is an incorrect model name, not a bug in your code.

Why Does This Error Happen?

There are three main reasons you'll see a model-not-found error:

① You're using a deprecated model name

gemini-pro and gemini-1.0-pro were retired at the end of 2025. Older tutorials and Stack Overflow answers still reference these names, so copying them verbatim will immediately break.

② Your model name format is wrong

There's a meaningful difference between gemini-2.5-pro, gemini-2.5-pro-latest, and gemini-2.5-pro-preview-06-05 — and only the latter two actually work. The bare name without a suffix (gemini-2.5-pro) is not a valid identifier on generativelanguage.googleapis.com.

③ You're calling a model that isn't available on Google AI

Some models (custom-tuned models, certain enterprise variants) are only accessible through Vertex AI and will return a 404 when called via the standard Google AI endpoint.

Valid Model Names for 2026

Here's a quick reference for model names that work with the Google AI API (generativelanguage.googleapis.com) as of April 2026:

Gemini 2.5 Series (Stable)

  • gemini-2.5-pro-latest — Latest stable Gemini 2.5 Pro (recommended for production)
  • gemini-2.5-pro-preview-06-05 — Preview with experimental features
  • gemini-2.5-flash-latest — Latest stable Gemini 2.5 Flash (fast and cost-effective)
  • gemini-2.5-flash-preview-05-20 — Flash preview

Gemini 3 Series (Newest)

  • gemini-3-pro-latest — Latest Gemini 3 Pro
  • gemini-3-flash-latest — Latest Gemini 3 Flash
  • gemini-3.1-pro-latest — Latest Gemini 3.1 Pro
  • gemini-3.1-flash-latest — Latest Gemini 3.1 Flash

Deprecated / Unavailable

  • gemini-pro — Retired
  • gemini-1.0-pro — Retired
  • gemini-1.5-pro-001 — Retired (use gemini-2.5-pro-latest)

Quick rule of thumb: When in doubt, use gemini-2.5-pro-latest (best quality) or gemini-2.5-flash-latest (faster, cheaper). The -latest suffix always points to the most recent stable version of that series.

How to List Available Models Programmatically

If you're unsure what's available in your account, check it directly — this is the most reliable approach.

Python SDK

import google.generativeai as genai
 
# Replace YOUR_API_KEY with your actual key
genai.configure(api_key="YOUR_API_KEY")
 
# List all models that support content generation
for model in genai.list_models():
    if "generateContent" in model.supported_generation_methods:
        print(f"Name: {model.name}")
        print(f"  Display: {model.display_name}")
        print()

If a model name doesn't appear in this output, calling it will return a model not found error.

REST API (curl)

# Replace YOUR_API_KEY with your actual key
curl "https://generativelanguage.googleapis.com/v1beta/models?key=YOUR_API_KEY" \
  | python3 -m json.tool | grep '"name"'

Node.js (@google/genai)

import { GoogleGenAI } from "@google/genai";
 
// Replace YOUR_API_KEY with your actual key
const ai = new GoogleGenAI({ apiKey: "YOUR_API_KEY" });
 
const models = await ai.models.list();
for await (const model of models) {
  console.log(model.name);
}

Step-by-Step Fixes for Common Error Messages

Error: 404 models/gemini-pro is not found

Cause: gemini-pro was deprecated and removed.

Fix: Swap in a current model name:

# Old code — will error
model = genai.GenerativeModel("gemini-pro")
 
# Fixed
model = genai.GenerativeModel("gemini-2.5-flash-latest")

Choosing a replacement:

  • Need best accuracy? → gemini-2.5-pro-latest
  • Want low latency and lower cost? → gemini-2.5-flash-latest
  • Building a real-time app? → gemini-3.1-flash-latest

Error: INVALID_ARGUMENT: model not found: models/gemini-2.5-pro

Cause: gemini-2.5-pro (without a version suffix) is not a valid identifier.

# Wrong
model = genai.GenerativeModel("gemini-2.5-pro")
 
# Correct
model = genai.GenerativeModel("gemini-2.5-pro-latest")

The same applies when calling the REST API directly:

# Wrong
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent?key=YOUR_API_KEY"
 
# Correct
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro-latest:generateContent?key=YOUR_API_KEY"

Error: 404 model not supported for generateContent

Cause: You're requesting a model that only exists on Vertex AI, not the Google AI API.

Fix: Either switch to a model listed by list_models(), or migrate to Vertex AI. For Vertex AI authentication setup, see Fixing Vertex AI Gemini Authentication Errors: Service Account and ADC.

Watching Out for Old SDK vs New SDK Confusion

The Python ecosystem has two Gemini SDKs and they look similar enough to cause real confusion. Make sure you're not mixing code from both:

# Old SDK: google-generativeai
import google.generativeai as genai
genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel("gemini-2.5-pro-latest")
response = model.generate_content("Hello!")
print(response.text)
 
# New SDK: google-genai (recommended going forward)
from google import genai as newgenai
client = newgenai.Client(api_key="YOUR_API_KEY")
response = client.models.generate_content(
    model="gemini-2.5-pro-latest",
    contents="Hello!"
)
print(response.text)

Both SDKs accept the same model name format (gemini-2.5-pro-latest). For help with installation conflicts or version issues, see Resolving Gemini API SDK Version and Installation Errors.

Looking back

"Model not found" errors in the Gemini API almost always come down to the model name. Here's the short version: gemini-pro and gemini-1.0-pro are gone, so stop using them. Always include a version suffix — gemini-2.5-pro-latest, not gemini-2.5-pro. Use list_models() or the REST endpoint to see exactly what's available to you. Avoid preview versions in production; use -latest for stability. And double-check which SDK you're using (google-generativeai vs google-genai) since the API signatures differ between them.

Once you have the right model name, most of these errors disappear instantly. If you're still seeing issues after updating the name, the problem may be authentication — see Gemini API Authentication Error Solutions for next steps.

Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◈ API / SDK2026-04-09
Classify Gemini API Errors by Status — Handling 429, SAFETY, and Token Limits in Production
Sort Gemini API failures along two axes — HTTP status and finish_reason — so you know instantly whether to wait or to fix. Covers the three distinct 429 limits, model-deprecation fallbacks, and how the exception hierarchy changes after moving to the google-genai SDK.
◈ API / SDK2026-10-19
When 404 and 429 Show Up in the Same Gemini API Log, Check the Model Name Before the Quota
A triage order for Gemini API logs that mix 404 NOT_FOUND and 429 RESOURCE_EXHAUSTED, plus a small Python script that separates a bad model name from a real quota limit without generating anything.
◈ API / SDK2026-10-16
The Day /models Returns 200 but generateContent Returns 403 — Decide Your Triage Order Before It Happens
A triage order for the case where listing models succeeds with 200 but generation fails with 403 permission_denied. Includes a small diagnostic script that checks key, project, and billing in turn, why you should not retry a 403, and how to assemble what support needs.