Genace

Image generation is not available in your country. — Gemini API image generation region error (400)

HTTP 400 FAILED_PRECONDITION Do not retry as-is

The exact error

Image generation is not available in your country.

What it means

The Gemini API refused an image-generation request because of where the request came from. This message, unlike the general location error, is scoped to image generation only. It comes back as HTTP 400 with status FAILED_PRECONDITION. Google’s API errors page describes that status as a prerequisite that is not met.

The clearest report is Google Developer forums thread 187143, from April 2025. A developer had used image generation with gemini-2.0-flash-exp for about a month without problems. It kept working on their development machine in Türkiye. Once the same app was deployed to a server in France, image requests from that server returned this error, starting a few days before the post. The thread has no reply.

A similar case appears in n8n issue #14741, also from April 2025. An n8n Cloud user called gemini-2.0-flash-exp through generateContent with responseModalities set to text and image. The calls worked for a week and then failed with a country restriction. The issue does not quote the exact error text. An n8n team member explained that n8n’s cloud runs in Frankfurt, that they could not quickly move regions, and suggested using a different model provider or self-hosting.

Both reports involve servers in countries that appear on Google’s current list of available regions for the Gemini API. That list covers the Gemini API and AI Studio as a whole and has no separate entry for image generation. The public sources do not explain why image generation was refused in those locations at the time.

How to confirm it’s this

  • The response is 400 FAILED_PRECONDITION and the message is the one at the top of this page, not the broader “User location is not supported” wording.
  • The same key and code work from another machine or network, as in thread 187143.
  • Find where your outgoing traffic actually leaves from. That means the server, container, serverless region or hosted automation platform, not your laptop. Google’s regions page notes that for Colab, the Colab instance’s location is what counts, and suggests running !curl ipinfo.io to check it.
  • Because the wording is limited to image generation, try a text-only request from the same host. If text works and image generation does not, you are looking at this error rather than the general location block. The sources do not confirm this split, so treat it as a test, not a rule.

Fix

  1. Find the real egress location of every service that calls the API.
  2. Compare it with Google’s available-regions list. If you and your users are in supported countries but your server is not, run image generation from infrastructure located in a supported country.
  3. If you are not in a supported country, Google’s regions page points to the Gemini API in Gemini Enterprise Agent Platform as the alternative, and to the Terms of Service for access requirements. Making traffic appear to come from somewhere else is not a fix.
  4. On a hosted platform, you may not control the egress. As in the n8n case, your options may be limited to what the platform itself offers: a different provider, or self-hosting in a supported location.
  5. Handle it cleanly in code. Catch this message separately from safety blocks and quota errors, and tell the user that image generation is unavailable from this deployment instead of showing a generic failure.

Retry or not

No. The decision depends on where the calling host is, so an identical retry from the same host gets the same answer. In thread 187143 the error persisted for days on the same server. FAILED_PRECONDITION means a prerequisite is missing, and retrying does not supply it. An agent should fail fast, record the host and region that made the call, and only send the request again from a different, supported deployment.

When it’s not this

  • User location is not supported for the API use. This is also a 400 FAILED_PRECONDITION, but it blocks the Gemini API as a whole, not just image generation. Diagnose it the same way, by checking where the calling server is.
  • Model capability. If the model you called cannot output images at all, you get a 400 INVALID_ARGUMENT about response modalities instead.
  • Billing. Google’s errors page gives disabled billing as an example of FAILED_PRECONDITION. Same status, different prerequisite, so read the message before acting.
  • A 429 with a limit of 0 is a quota response, not a location response.

Error text last verified against the sources below on .

Where these facts come from