Hello there,
First post here so let me know if I am not doing it correctly or forgot something.
Anyway, I’ve been trying to integrate Gemini 2.5 Light/Pro (want to test both) TTS preview models to handle the TTS workflow in my backend.
Now this works as expected from my local machine (you know the drill: “works on local but not in production”) but once deployed on a VPS (located in Finland) I’m not able to have it work similarly to local (I’m in France by the way).
Here’s what the logs are saying:
2025-05-31 14:05:32,208 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro-preview-tts:generateContent "HTTP/1.1 400 Bad Request"
2025-05-31 14:05:32,210 - app.services.third_parties.gemini_services - ERROR - An error happened during Gemini TTS execution. Error: [Gemini TTS API Error: 400 FAILED_PRECONDITION. {'error': {'code': 400, 'message': 'User location is not supported for the API use.', 'status': 'FAILED_PRECONDITION'}}]
By the way, I already am using gemini-2.0-flash-lite in production from the same server and already encountered this error but was able to solve by moving to a Vertex-based implementation.
In the case of the TTS-preview model I’m not aware of a Verte implementation (yet ?) but anyway since my VPS is in Finland and it is an eligible country for Gemini API, I really don’t understand what would be issue here.
Can someone help on this please ?
Thank you !