Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User location is not supported for the API use #32

Open
severfire opened this issue Apr 24, 2024 · 0 comments
Open

User location is not supported for the API use #32

severfire opened this issue Apr 24, 2024 · 0 comments

Comments

@severfire
Copy link

severfire commented Apr 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant