client icon indicating copy to clipboard operation
client copied to clipboard

User location is not supported for the API use

Open severfire opened this issue 1 year ago • 0 comments

Hello,

First, thank you for great API PHP Client! This is something Google seems to forget, great support for PHP.

While trying your examples, I got error:

Fatal error: Uncaught RuntimeException: Gemini API operation failed: operation=models/gemini-pro:generateContent, status_code=400, response={ "error": { "code": 400, "message": "User location is not supported for the API use.", "status": "FAILED_PRECONDITION" } } in C:\xampp\htdocs\app\vendor\gemini-api-php\client\src\Client.php:250

in my Google Cloud I do have this: API_ENDPOINT="us-central1-aiplatform.googleapis.com" PROJECT_ID="my-secret" LOCATION_ID="us-central1"

I am located in Poland and I have Generative Language API and Vertex AI API enabled in Cloud Console

How can I fix it?

I do not know if its possible, but I would love to use: MODEL_ID="gemini-1.5-pro-preview-0409"

Thanks! a.

severfire avatar Apr 24 '24 12:04 severfire