All images were filtered out because they violated Vertex AI's usage guidelines. — Imagen API returned no image
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 thepredictionsarray. Google’s example asks for 4 and gets 2 back. - With
includeRaiReason: true, each filtered image is replaced by an object carrying araiFilteredReason. 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
generatedImagesentry, in js-genai) has araiFilteredReasonstring. - Your SDK may hide it. In vercel/ai issue #10796,
@ai-sdk/google-vertexexpectedbytesBase64EncodedandmimeTypeon every prediction and threwAI_TypeValidationError(“expected string, received undefined”) instead of a content-filter error. The real reason sat in the error’svalue, underpredictions[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 code | Category (output) |
|---|---|
| 17301594 | Child |
| 15236754 | Celebrity |
| 22137204 | Hate |
| 29578790, 74803281 | Other |
| 39322892 | People/Face |
| 49114662, 72817394 | Prohibited content |
| 63429089, 43188360 | Sexual |
| 56562880 | Violence |
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
- Check before you decode. Treat a response with no image bytes as a
failure. Test for
raiFilteredReasonfirst, then read image data. - Turn on
includeRaiReason. Without it, filtered images silently disappear and you cannot tell a filter from a short response. - 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.
- Keep partial results. If some images survived, the response still holds them. Only the filtered slots are missing.
- Report false positives. The message asks for feedback if you think it was an error, and Google’s page describes how to submit it.
- Plan the migration to a Gemini image model. On Nano Banana, check the
candidate’s
finishReasoninstead ofraiFilteredReason.
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
raiFilteredReasonanywhere 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_SAFETYorIMAGE_OTHER, not withraiFilteredReason.
Related errors
- The prompt could not be submitted (Imagen 400)
- IMAGE_SAFETY
- IMAGE_OTHER
- Veo: videos filtered out
- OpenAI content_policy_violation
Error text last verified against the sources below on .