Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Gemini Pro API-KEY not working in the Netherlands

Hi,

It seems that for some obscure reason I can enable the genrative AI API in a paid GCP project, but API-KEY says: 
error: Uncaught (in promise) Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent: [400 Bad Request] User location is not supported for the API use.

Why is the netherlands not supported?, I can access the model via Vertex-AI with python on my local machine (using my local login credentials)
This. is hampering the use of langchain js in a project I am investigating, which requires the use of API_KEY.

So the question in the end is why is the location Netherlands not suported?


Solved Solved
0 4 3,303
1 ACCEPTED SOLUTION

Same thing happening in Melbourne Australia

View solution in original post

4 REPLIES 4

same issue also Frankfurt, DE

Something went wrong. Here's the specific error message we encountered: [GoogleGenerativeAI Error]: Error fetching from https : // generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 Bad Request] User location is not supported for the API use.

Same thing happening in Melbourne Australia

what was the solution?

Ok Solved it:
- Create a service account with predict endpoint and proper roles to interact with VertexAI
- use

from langchain_google_vertexai import ChatVertexAI

and it works, make sure the CloudRun runs under mentioned service account