I am experiencing a 400 FAILED_PRECONDITION error while using the google-genai Python SDK, despite being located in Singapore (a supported region). Interestingly, the gemini-cli tool works perfectly fine on the same machine/network, but the SDK consistently fails with the “location not supported” error.
Error Message:
google.genai.errors.ClientError: 400 FAILED_PRECONDITION.
{‘error’: {‘code’: 400, ‘message’: ‘User location is not supported for the API use.’, ‘status’: ‘FAILED_PRECONDITION’}}
Environment & Setup:
-
Location: Singapore (Local ISP)
-
SDK: adk, version 1.27.0
-
Model: gemini-3-flash-preview
-
CLI Status:
gemini-cliworks as expected with the same google account.