Skip to content

404 Not Found error using gemini-1.5-flash from EU region (Portugal) - Working from US #1302

Description

@danielSamule

Issue Summary

I'm consistently getting 404 Not Found errors when calling gemini-1.5-flash from Portugal (EU) using @google/generative-ai@0.21.0 across all API versions. The same code works correctly from US-based servers.

Note: I understand this issue is being filed against the new @google/genai SDK repository, but I'm currently using the deprecated @google/generative-ai SDK (v0.21.0). I'm reporting this here because the deprecated repository is now read-only. If this is a regional API availability issue, it likely affects both SDKs.

Error Message

[GoogleGenerativeAI Error]: Error fetching from
https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent:
models/gemini-1.5-flash is not found for API version v1beta, or is not supported for generateContent.

Environment Details

  • Location: Portugal (Coimbra, PT) – EU region
  • SDK: @google/generative-ai@0.21.0 (deprecated SDK)
  • Model: gemini-1.5-flash
  • API versions tried:
    • v1beta with grounding tools → 404
    • v1beta without tools → 404
    • v1 explicit → 404
    • Auto-detect (no apiVersion) → 404
  • API key: Valid and verified (works with other Google Cloud APIs)
  • Network: No VPN, direct ISP connection
  • Node.js: v20.11.0
  • Browser: Chrome 131 (also tested Edge, Firefox)

Steps to Reproduce

  1. From Portugal (EU):
import { GoogleGenerativeAI } from "@google/generative-ai";

const apiKey = process.env.VITE_GEMINI_API_KEY;
const genAI = new GoogleGenerativeAI(apiKey);

// All of these fail with 404
const model1 = genAI.getGenerativeModel(
  { model: "gemini-1.5-flash" },
  { apiVersion: "v1beta" }
);

const result = await model1.generateContent("Test prompt");
// Error: 404 Not Found
  1. From US-based server: Same code works perfectly

Additional Context

  • Timeline: This was working perfectly fine last weekend (around Jan 31, 2026) and started failing without any code changes
  • Model name variations tested (all return 404 from Portugal):
    • gemini-1.5-flash
    • models/gemini-1.5-flash
    • gemini-1.5-flash-002
    • gemini-flash-latest
  • Network troubleshooting:
    • Disabled ad-blocker
    • Cleared browser cache/service workers
    • Tested in incognito mode
    • Tried different browsers
    • Tried direct HTTPS fetch calls → same 404

Questions for Maintainers

  1. Regional availability: Is gemini-1.5-flash currently restricted in EU regions (specifically Portugal)? Are there known regional restrictions or geofencing?
  2. EU DMA compliance: Could this be related to EU Digital Markets Act compliance measures?
  3. Model discovery: Is there an API endpoint to query available models by region, so developers can programmatically handle regional restrictions?
  4. Recommended alternatives: What model should EU users use if gemini-1.5-flash is not available?
  5. Migration path: Should I migrate to the new @google/genai SDK to resolve this? Would that help with regional availability?

Any guidance on whether this is a regional restriction, temporary outage, or configuration issue would be greatly appreciated.

Metadata

Metadata

Assignees

Labels

api:gemini-apipriority: p2Moderately-important priority. Fix may not be included in next release.status:awaiting user responseissues requiring a response from the userstatus:staleIssues tagged for cleanup by the stale issue workflow.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions