Genace

Model does not support the requested response modalities: image — Gemini API image output error

HTTP 400 INVALID_ARGUMENT Do not retry as-is

The exact error

Model does not support the requested response modalities: image

What it means

You called generateContent with image output requested (responseModalities or response_modalities includes IMAGE), and the model rejected that combination. It comes back as 400 INVALID_ARGUMENT. The end of the message lists what was refused, for example image or image,text. Public reports show three different causes.

  1. A model that cannot output images. In an issue logged by the gentlebot project in February 2026, an app’s image route called gemini-2.0-flash, a text model, through generate_content. It got this 400 with image,text at the end. Gemini image output comes from specific image models, such as the gemini-3.1-flash-image and gemini-3-pro-image IDs on Google’s deprecations page. A general text model will not do it.
  2. The model or access state at the time. In Google AI Developers Forum thread 72676, from March 2025, a developer got this error with gemini-2.0-flash-exp-image-generation and believed image output was not yet open to everyone. A forum member with a Google badge said the earlier restriction was related to early access, and later suggested checking whether the poster’s region was on the available-regions list. A community member posted working code that requested both text and image output. The thread never confirmed which change fixed it. Google’s changelog lists gemini-2.0-flash-exp-image-generation and gemini-2.0-flash-preview-image-generation for shutdown on November 14, 2025, so code still using those IDs needs a new model anyway.
  3. An SDK bug. In go-genai issue #158, calling GenerateContentStream with IMAGE returned this error. The issue was closed by a commit titled “fix response modality in streaming mode” in March 2025. Old SDK versions can therefore produce this error for a model that does support images.

Some older examples always send both TEXT and IMAGE. Google’s current Veo page, though, generates an image with response_modalities set to IMAGE alone on a Gemini image model. We found no source showing that image-only output causes this error on current image models.

How to confirm it’s this

  • The status is 400 INVALID_ARGUMENT and the message names image.
  • Look at the model ID in the failing request. If it is not an image model, that is the cause. Routers that share one client for text and image routes are a common place for the wrong ID to slip in, as in the gentlebot case.
  • Remove IMAGE from the requested modalities and send the request again. If it now succeeds, the model or path does not support image output.
  • If you are streaming, check your SDK version against the fix in go-genai issue #158.
  • Check whether the model ID is still listed on Google’s deprecations and models pages.

Fix

  1. Call an image model for image output. Google’s Veo page generates the starting image like this. The model ID below is the one the deprecations page lists as current. The page’s own example uses the -preview ID, which is listed there with a June 25, 2026 shutdown date.
image = client.models.generate_content(
    model="gemini-3.1-flash-image",
    contents=prompt,
    config={"response_modalities": ['IMAGE']},
)
  1. Replace experimental or preview IDs with the replacements on the deprecations page.
  2. Upgrade the SDK if the error appears only in streaming mode or only in one language’s SDK.
  3. Split text and image routing. Keep separate model settings for text and image calls so a text model is never asked for images.

Retry or not

No. Whether a model can return images does not change between attempts, so the same request fails the same way. The gentlebot log shows the call going through a backoff-and-retry wrapper and still failing, which only added latency. An agent should treat this as a configuration error. It can switch once to a known image-capable model ID, or drop IMAGE and return text only if the task allows it, and should not loop.

When it’s not this

  • Image generation is not available in your country. is a 400 FAILED_PRECONDITION about where the call comes from. The model can produce images, just not for your location.
  • is not found for API version v1beta is a 404 for a model ID that does not exist or has been shut down.
  • No image in a successful response. If the request returns 200 but contains no image part, the request was accepted and something else went wrong.
  • Safety blocks return a finish reason on an accepted request, not this 400.

Error text last verified against the sources below on .

Where these facts come from