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

How to specify region in Gemini API request?

Hello,

I'm currently using the Gemini API to generate content for my app. I'm trying to specify the region in the API request, but I couldn't find how to do it in the documentation.

I tried appending ?location=us-central1 to the API URL like this:

https://us-central1-generativelanguage.googleapis.com/v1/models/gemini-1.0-pro-vision-latest:generateContent?key=MY_API_KEY

 However, it doesn't seem to work and I get an error response(the URL seems to be wrong).

Could you please advise on the correct way to specify the region in the Gemini API request? 

Thank you in advance for your help!

Best regards,

1 8 6,327
8 REPLIES 8