Target API: Gemini API (v1beta)
SDK: @google/generative-ai (NPM Package)
Model used: gemini-1.5-flash
Environment: Client-side React/Vite application (Portugal IP)
Issue Description:
I am receiving a persistent 404 Not Found error specifically when attempting to use Google Search Grounding via the v1beta endpoint from a Portuguese IP address.
The standard text and multimodal generation calls work perfectly on the v1 endpoint. However, the moment I include the tools: [{ googleSearch: {} }] configuration on the v1beta endpoint, the API returns a 404 error claiming:
“models/gemini-1.5-flash is not found for API version v1beta”
JavaScript
const genAI = new GoogleGenerativeAI("YOUR_API_KEY");
const model = genAI.getGenerativeModel(
{
model: "gemini-1.5-flash",
tools: [{ googleSearch: {} }]
},
{ apiVersion: "v1beta" }
);
// This call returns the 404 Error
const result = await model.generateContent("Analyze this engine sound for a BMW M4");
-
Is Google Search Grounding through the Gemini API currently restricted in the EEA/Portugal due to DMA (Digital Markets Act) regulations or regional rollout delays?
-
If it is supported, why would the router fail to find gemini-1.5-flash specifically on the v1beta path?
-
Is there a specific regional endpoint (base URL) I should use for EU requests involving Search Grounding?
I have verified the model exists and works without the Search Tool. This seems specifically tied to the Grounding functionality.
Any insight into regional availability or routing issues would be appreciated.