Choose Auto, TokenLab Verified, or Official for each request, with prices shown up front. See what's new

GPT Image Moderation Errors: Handle Blocked Requests on TokenLab

·October 4, 2026·7 min read·Updated November 11, 2026·2185 views
#gpt-image#image-generation#content-moderation#error-handling#tutorial
GPT Image Moderation Errors: Handle Blocked Requests on TokenLab

What you’ll learn

  • What does moderation="low" do on GPT Image?
  • Which error code means a GPT Image request was blocked?
  • Should I retry a blocked request?
  • Is a blocked request charged?
  • What should I do about a false positive?

GPT Image models can refuse a request for safety reasons. The refusal can come from your prompt, from an input image, or from the generated image. On TokenLab it arrives as an HTTP 400 with the code content_policy_violation. This guide explains what the moderation setting does, how to read a block, how to review a suspected false positive, what to log, what to tell your user, and how to appeal.

It does not describe ways to get around the filter. If a request is not allowed, change the product, not the wording.

Key Takeaways

  • moderation takes auto (default) or low. low means less restrictive filtering. It does not turn filtering off.
  • A block is an HTTP 400 with error.code set to content_policy_violation and retryable set to false. An async task shows the same code on a failed task.
  • Do not retry a blocked request unchanged. Have a person read it first.
  • Log the request_id, show the user a short neutral message, and give the user a way to report a mistake.
  • To appeal, send the Request ID through the support action in Runs.

What the moderation setting does

moderation is a request field for GPT Image models such as gpt-image-2. It works on POST /v1/images/generations and POST /v1/images/edits. The Create Image reference lists two values.

Value What the provider says it does
auto (default) Standard filtering, which limits certain categories of potentially age-inappropriate content
low Less restrictive filtering

Both values still filter. The descriptions come from the provider's image generation guide, read on 2026-11-11.

Choose one value for your product. Base the choice on who uses it and on your own content rules. Do not switch it per request to push a blocked request through.

This request sets the value and sends a hashed end-user ID in user. The Edit Image reference describes user as an identifier for abuse monitoring. Do not send names or email addresses in it.

curl https://api.tokenlab.sh/v1/images/generations \
  -H "Authorization: Bearer $TOKENLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Studio photo of a ceramic coffee mug on a white background, soft light",
    "size": "1024x1024",
    "moderation": "auto",
    "user": "u_7f3a9c"
  }'

What a block looks like on TokenLab

The provider's own API reports a block as moderation_blocked, with the error type image_generation_user_error. TokenLab returns its own public code. Branch on that code, not on the message text.

A synchronous request returns HTTP 400. The body looks like this:

{
  "error": {
    "code": "content_policy_violation",
    "hint": "Review the prompt and media for disallowed content, then submit a revised request.",
    "message": "The request was rejected by the safety system.",
    "request_id": "req_example",
    "retryable": false,
    "type": "invalid_request_error"
  }
}

With async: true, the create call returns a task. The block shows up when you poll. A status read returns HTTP 200 even for a failed task, so read status and error_details, as the Get Image Status reference shows:

{
  "id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "status": "failed",
  "error": "The request was rejected by the model's content policy.",
  "error_details": {
    "status": 400,
    "type": "invalid_request_error",
    "code": "content_policy_violation",
    "retryable": false
  },
  "data": []
}

On an Official route, the error can also carry an upstream object with the provider's own message and code. The error handling guide says to keep branching on code and type, because upstream.code values belong to the provider and can change.

The provider's API can also say whether a block came from the input or from the output. TokenLab's reference does not list that field, so do not build logic on it.

Is it a block or another error?

Many 400 errors have nothing to do with safety. Check the code before you treat a failure as moderation.

What you see What it means What to do
400 with content_policy_violation The safety system rejected the request Do not retry unchanged. Review the request.
400 with unsupported_parameter, invalid_image_url, or another request code The request is wrong, not unsafe Fix the field named in param.
429 rate_limit_exceeded Too many requests Wait for Retry-After, then retry.
500 to 504, all_channels_failed Service or supply problem Retry only when retryable is true.

Review a suspected false positive

A false positive is a request that you have read and that is clearly allowed, but that was still blocked. A program cannot judge that. A person can.

  1. Confirm the code. It must be content_policy_violation.
  2. Read the exact request. Read the full prompt and look at every input image. If anything in it is not allowed under the provider's usage policy or your own rules, stop. Do not reword it to get it through.
  3. Write a clearly benign request precisely. State the subject, the setting, the style, and what the image is for. A precise prompt is easier for a person to review and for the model to follow. It does not change what the policy allows.
  4. Send it once. If it is blocked again, stop and appeal. Do not loop.

These prompts show the level of detail to aim for. Each one is a plain request for a common legitimate use:

  • Product shot: "Studio photo of a matte black wireless earbud case on a white acrylic surface, soft top light, no people, clean background, for an online store listing."
  • Medical diagram: "Textbook-style anatomical diagram of the human knee joint, side view, flat vector style, neutral gray and blue colors, each part labelled in English, for a patient education leaflet."
  • Historical image: "Museum-style illustration of a 19th-century steam locomotive at a railway station, workers in period clothing, muted colors, for a history education site."

For an edit, send only the image the edit needs and describe the change in one clear sentence. The GPT Image edit API guide covers the request shape.

What to log

The logs and troubleshooting guide says to keep IDs, not content. For each blocked request, store:

  • request_id, from the error body or the response headers.
  • task_id and poll_url for async work.
  • The endpoint, model, time, HTTP status, and error.code.
  • The names of the fields you sent.
  • Your own job ID and the hashed end-user ID.

Never log API keys. Keep prompts and images only if your own privacy rules allow it.

What to tell the end user

Keep the message short and neutral. Do not show classifier detail, do not accuse the user, and do not suggest ways to reword a request past the filter. For example:

This image could not be created because the request did not meet our content safety rules. You can change the request and try again. If you think this is a mistake, choose Report a problem and quote reference req_example.

Replace req_example with the real Request ID. The report button should save that ID with the request so a person can review it.

Appeal a block

An appeal goes through TokenLab support, using the Request ID.

  1. Open Runs in the workspace that owns the request. Find the Request ID and select the row.
  2. Choose the human-support action. It opens a preview with the linked request.
  3. Read the summary and remove private content. Then select Submit. A preview alone does not send anything.
  4. Continue the same conversation in Support. Do not submit duplicates.

Say what you expected and what the user saw. Include the request_id, endpoint, model, time, status code, field names, and the safe error body. Do not send API keys, private media, or full prompts.

FAQ

What does moderation="low" do on GPT Image?

It asks for less restrictive filtering than the default auto. It does not turn filtering off. Pick one value for your product and keep it.

Which error code means a GPT Image request was blocked?

On TokenLab, check for HTTP 400 with error.code set to content_policy_violation. For an async task, look for the same code in error_details on a failed task. The provider's own API calls it moderation_blocked.

Should I retry a blocked request?

No. The error says retryable: false, and the provider's guidance is not to retry these errors without changing the request. Have a person review the request first. Stop after one more attempt.

Is a blocked request charged?

A failed async task is not charged, and any reserved amount is released. A request that ends in a 400 did not complete, and each completed request is charged once. Confirm any request in Usage by its Request ID.

What should I do about a false positive?

Have a person read the request. If it is clearly allowed, state the subject, setting, style, and purpose plainly and send it once. If it is blocked again, appeal through Runs with the Request ID.

To try GPT Image, open the gpt-image-2 model page. The async jobs and polling guide covers the task lifecycle.

Sources

Prepared by TokenLab's AI agents. Facts are checked against the linked primary sources on the date shown.

Recent model releases

Try the models from this article

Chat, create images, or make video with the same TokenLab balance.

Your first API call

Get your API key
curl https://api.tokenlab.sh/v1/chat/completions \
  -H "Authorization: Bearer $TOKENLAB_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"gemini-3.8-flash","messages":[{"role":"user","content":"Hello!"}]}'