> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nunchux.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Authenticate every request with your API key in the `X-API-Key` header or `Authorization: Bearer`. Keys start with `sk-nunchux-`.
> Image generation is synchronous: the image is in the response.
> Video generation is asynchronous: submit the job, poll its task until it reaches a terminal status, then download the output promptly, because output URLs expire.

# Content Moderation

> How Nunchux checks prompts, which accounts can turn the check off for a request, and how to apply.

# Content Moderation

### How Nunchux checks requests, and how an approved account turns the check off

## What Nunchux checks

Nunchux checks the prompt of every request to a Nunchux Optimized model. It sends the prompt to OpenAI's moderation API while the model runs. If the check flags the prompt, Nunchux withholds the result and returns a 422 `content_policy_violation`. You are not charged for a withheld result.

Moderation is on by default for every account and every request.

## Turning moderation off

An account that Nunchux has approved can turn the check off for one request. Send `content_moderation: false` in the request body:

```json theme={"system"}
{
  "model": "nunchux-flux.2-klein-9b",
  "prompt": "A portrait in the style of a classical oil painting",
  "width": 1024,
  "height": 1024,
  "content_moderation": false
}
```

Turning moderation off skips Nunchux's content filter except for one check. Nunchux still sends the prompt to OpenAI's moderation API, and blocks content that OpenAI flags as sexual content involving minors. That request returns a 422 `content_policy_violation`. This check reads the prompt text, not uploaded images.

Some models come from third-party providers, which apply their own moderation that Nunchux does not control.

Requests without the field, or with `content_moderation: true`, are moderated as usual. An approved account can keep moderation on for some requests and turn it off for others.

## Who can turn it off

Nunchux approves an account to turn moderation off. Approval covers the whole account. A personal account can apply as well as a team.

An account that is not approved gets a 403 `content_moderation_not_approved` when it sends `content_moderation: false`. Nunchux does not run the request:

```json theme={"system"}
{
  "error": {
    "code": "content_moderation_not_approved",
    "message": "This account is not approved to turn content moderation off. Remove content_moderation, or apply for approval."
  }
}
```

The field must be the JSON value `true` or `false`. Any other value, including a string or `null`, returns a 400 `invalid_request`.

## Where the field works

| Route | Where to send the field |
| - | - |
| `POST /v1/images/generations` | The request body |
| `POST /v1/images/edits` | The request body. In a multipart form, send the form field `content_moderation` with the value `false`. |
| `POST /v1/video/generations`, `POST /v1/video/animations`, `POST /v1/videos/generations` | The request body |
| `POST /v1/batches` | Each request's `params`. A `content_moderation` beside `params` or at the top level returns a 400. |

Partner model routes, such as `/v1/google/`, `/v1/klingai/` and `/v1/bytedance/`, do not read the field. Nunchux runs no content filter on them. The partner applies its own moderation.

With the OpenAI SDK, send the field in `extra_body`, as with other Nunchux fields. See [OpenAI compatibility](https://docs.nunchux.ai/nunchux-optimized/openai-compatibility.md).

## How to apply

Contact Nunchux to apply. Tell us the account or team, and what you will use it for. Nunchux reviews each request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.