Skip to main content
404Not retryable
Google Gemini 404 Not Found
Model or resource not found — typo'd model name, model not available on your API version, or a referenced file/cached content expired.
Most likely causes
- 1.Model name typo (models/gemini-2.5-pro vs gemini-2.5-pro path confusion)
- 2.Model not available on the v1 endpoint (needs v1beta)
- 3.Uploaded file or cached content past its TTL
Fix checklist
- List models via the ListModels endpoint and copy names exactly
- Switch base path to v1beta for newer models/features
- Re-upload expired files; cached content lives ~48h by default
Retry guidance
Not retryable.
// 404 is NOT retryable — surface it and fix the request/config.
const res = await fetch("https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent", {
method: "POST",
headers: {
"content-type": "application/json",
"x-goog-api-key": process.env.GEMINI_API_KEY!,
},
body: JSON.stringify(payload),
});
if (res.status === 404) {
const body = await res.json();
// Do not retry: log the provider's message — it names the exact problem.
throw new Error(`Google Gemini 404: ${JSON.stringify(body.error ?? body)}`);
}Provider status page: status.cloud.google.com