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 featuresgemini-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 Progemini-3-flash-latest— Latest Gemini 3 Flashgemini-3.1-pro-latest— Latest Gemini 3.1 Progemini-3.1-flash-latest— Latest Gemini 3.1 Flash
Deprecated / Unavailable
gemini-pro— Retiredgemini-1.0-pro— Retiredgemini-1.5-pro-001— Retired (usegemini-2.5-pro-latest)
Quick rule of thumb: When in doubt, use
gemini-2.5-pro-latest(best quality) orgemini-2.5-flash-latest(faster, cheaper). The-latestsuffix 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.