Gemini API returns 400 FAILED_PRECONDITION: "User location is not supported for the API use" on Wispbyte hosting

Hello,

I’m experiencing a persistent location-related error when calling the Gemini API from a Java application running on Wispbyte hosting.

Every request to generate content fails with the following error:

HTTP 400
FAILED_PRECONDITION
User location is not supported for the API use.

Environment

  • Hosting provider: Wispbyte

  • Runtime: Java 21 (Temurin 21.0.12.1)

  • Application: Java / Spring Boot

  • Public outbound IPv4: 78.154.103.40

  • IP geolocation: Bacău, Romania

  • Network provider identified by IP lookup services: FIVE CYBER HOST SECURITY S.R.L. (AS210718)

According to the official Gemini API supported-regions documentation, Romania is a supported country:

Tests performed

I ran independent network diagnostics directly inside the hosting container, without modifying my application code.

  1. IPv4 connectivity works. An external IP lookup service returns 78.154.103.40.

  2. Three IP geolocation services (ipinfo.io, ipwho.is, and ip-api.com) identify the IP as being in Romania.

  3. DNS resolution for generativelanguage.googleapis.com succeeds.

  4. An HTTPS request to the Gemini API endpoint reaches Google’s servers. An unauthenticated request to /v1beta/models returns HTTP 403, as expected when no API credentials are provided.

  5. IPv6 connectivity is unavailable in the container (Network is unreachable).

  6. I tried starting the application with -Djava.net.preferIPv4Stack=true, but the original location error remained unchanged.

The application uses its configured API credentials for actual Gemini requests. No API keys or private credentials are included in this report.

Questions

Could this be caused by Google’s internal geolocation or IP reputation data incorrectly classifying the hosting IP, even though external geolocation services identify it as a supported country?

Could the same error also indicate an API project or account eligibility issue?

Is there a way to check how Google classifies this IP for Gemini API access and request a review or correction if necessary?

I would appreciate any troubleshooting steps or information that could help determine the cause. I can provide additional sanitized logs and request timestamps if needed.

Thank you!

Hello @Caique_Castro ,

Please try the below steps:

  • Make sure you’re in one of the supported regions.

  • Turn off any VPN, proxy or iCloud Private Relay, and connect directly.

  • Make sure you’re 18 or older and have verified your age.

  • Try a different network, for example your phone’s hotspot.

If none of these help, please share the details using this form so we can investigate further: Gemini API & Google AI Studio Location Issue Report

Thank you for the suggestions. I ran additional diagnostics directly from my Wispbyte-hosted Java application on October 13, 2026.

Using the same API key and model (gemini-3.5-flash-lite), all three tests returned the exact same error:

  • GET /v1beta/models → HTTP 400, FAILED_PRECONDITION: User location is not supported for the API use.

  • POST /v1beta/models/gemini-3.5-flash-lite:generateContent with a minimal request and no tools → the same HTTP 400.

  • The same POST request with the url_context tool → the same HTTP 400.

The same API setup works from my local Windows computer. The main Wispbyte server’s outbound IPv4 address is 78.154.103.40, externally geolocated to Romania, which is listed as a supported region.

I also tested a separate Wispbyte server with a different IP address. That server returns a generic Google HTML HTTP 403 when calling generateContent.

These results suggest that the problem is not specific to the model, request payload, or URL Context tool.

Could you please investigate whether the outbound IP addresses or hosting network are being incorrectly classified for Gemini API access, or whether there might be an account/project eligibility restriction?

I will also submit the requested location issue report. No API keys or credentials are included in these results.

Thank you.

Hi Caique,

We’ve been investigating this. Sorry it’s taken a while. From the sound of it, your VPS is being misidentified as being from an unsupported country. The fastest solution may be to try a different VPS. Otherwise you can try the approaches below (although we can’t guarantee how long they will take or that they’ll be successful):