Genace

All images were filtered out because they violated Vertex AI's usage guidelines. — Imagen API returned no image

HTTP 200 raiFilteredReason Do not retry as-is

The exact error

Unable to show generated images. All images were filtered out because they violated Vertex AI's usage guidelines. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback. Support codes: 29310472

The prompt was accepted, Imagen generated images, and then a safety filter removed every one of them. The call does not fail. You get a normal response that has no image in it, only a reason string.

What it means

Google’s Imagen responsible AI page separates filtered input (which fails with a 400) from filtered output. For output, it describes two shapes:

  • Without includeRaiReason, filtered images are simply omitted from the predictions array. Google’s example asks for 4 and gets 2 back.
  • With includeRaiReason: true, each filtered image is replaced by an object carrying a raiFilteredReason. Google’s example shows the partial case wording: “Your current safety filter threshold filtered out 2 generated images.”

When all images are filtered, users report the wording above. js-genai issue #321 shows it inside generatedImages[0].raiFilteredReason, next to an empty image object. The reporter argued the SDK should throw in this case, since a generation that returns no image is an error. vercel/ai issue #10796 reports the same situation over HTTP 200 with a slightly different sentence that names “Google’s Responsible AI practices” instead of “Vertex AI’s usage guidelines”. Google’s docs now brand Vertex AI as Gemini Enterprise Agent Platform, so the product name inside this sentence may also appear as Agent Platform in newer responses. Match on “All images were filtered out”, not on the product name.

Where Imagen stands now. You are most likely to meet this error in older code or while migrating. Google’s Imagen page for the Gemini API says Imagen models are shut down and no longer available there. On Vertex AI (now branded Gemini Enterprise Agent Platform), Google’s Imagen docs describe the Imagen endpoints, including imagen-4.0-fast-generate-001, as deprecated, list them under “Discontinued endpoints” with gemini-2.5-flash-image as the replacement, and recommend updating before June 30, 2026 to avoid service disruption. The docs do not say whether those Vertex endpoints still answer today, so check in your own project rather than assuming.

How to confirm it’s this

  • The HTTP call succeeded, but no prediction has image bytes.
  • A prediction (or generatedImages entry, in js-genai) has a raiFilteredReason string.
  • Your SDK may hide it. In vercel/ai issue #10796, @ai-sdk/google-vertex expected bytesBase64Encoded and mimeType on every prediction and threw AI_TypeValidationError (“expected string, received undefined”) instead of a content-filter error. The real reason sat in the error’s value, under predictions[0].raiFilteredReason. The issue was closed as not planned. If you see a schema or type error on an Imagen image call, look for this field before debugging your parsing.
  • Read the support code at the end of the reason. Google’s page maps codes to categories. Codes it lists for output images include:
Support codeCategory (output)
17301594Child
15236754Celebrity
22137204Hate
29578790, 74803281Other
39322892People/Face
49114662, 72817394Prohibited content
63429089, 43188360Sexual
56562880Violence

The code in issue #321, 29310472, is listed by Google as the celebrity code for the input prompt, so input-side codes can also show up here.

Fix

  1. Check before you decode. Treat a response with no image bytes as a failure. Test for raiFilteredReason first, then read image data.
  2. Turn on includeRaiReason. Without it, filtered images silently disappear and you cannot tell a filter from a short response.
  3. Map it to a clear error in your agent. Report “the provider filtered the generated images” with the support code, rather than a type error.
  4. Keep partial results. If some images survived, the response still holds them. Only the filtered slots are missing.
  5. Report false positives. The message asks for feedback if you think it was an error, and Google’s page describes how to submit it.
  6. Plan the migration to a Gemini image model. On Nano Banana, check the candidate’s finishReason instead of raiFilteredReason.

Retry or not

No automatic retry of the same request. The message itself tells you to try rephrasing the prompt, and Google’s API errors page says generation-blocked results call for modifying the input before retrying. That is a decision for whoever owns the prompt. The message also says you will not be charged for blocked images, so the cost of this failure is latency, not money. Do not burn that latency in a loop.

When it’s not this

  • A 400 saying “The prompt could not be submitted”. The input was filtered before generation. See the page below.
  • A real schema bug. If there is no raiFilteredReason anywhere in the payload, the type error may be a genuine parsing problem.
  • Nano Banana. Gemini image models report blocks as a finish reason such as IMAGE_SAFETY or IMAGE_OTHER, not with raiFilteredReason.

Error text last verified against the sources below on .

Where these facts come from