# KIE NSFW Moderation

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/jobs/createTask:
    post:
      summary: KIE NSFW Moderation
      deprecated: false
      description: >-
        Check text, one image, or both in a single request with KIE NSFW
        Moderation and get a `pass` or `block` verdict for sexual content at the
        `adult`, `social` or `strict` level. Every result also includes the NSFW
        level and separate details for the text and the image. The model uses
        the parameter `model=kie/nsfw-moderation`. Try it online and see pricing
        on the [KIE NSFW Moderation API page](https://kie.ai/nsfw-moderation).


        ## Input


        - Provide `text`, `image_url`, or both. When both are sent, they are
        reviewed together in a single check.

        - `text` accepts up to 12,000 characters in any language.

        - `image_url`: one image per request, as a publicly downloadable URL, up
        to 20 MB and 50 megapixels, in JPG, PNG, WEBP or GIF. The URL must be
        downloadable without login.

        - For animated images such as GIF, the first frame is reviewed. To
        review other frames, extract them and submit each one as an image.

        - Image size and pixel count are checked after the image is downloaded,
        so an image over these limits is not rejected at submission; the task
        fails instead and is not charged.

        - When submitting many requests, limit how many are in progress at the
        same time, and retry tasks that fail because the service is busy.


        ## Choosing a scene


        - `adult`: allows adult content and blocks detected sexual content
        involving minors.

        - `social` (default, used when `scene` is omitted): blocks nudity and
        explicit content, and usually allows content that is only suggestive.

        - `strict`: blocks anything above `none`, including suggestive content.


        Detected sexual content involving minors is blocked in every scene.


        ## Checking a video


        Extract frames (we suggest 1 frame per second), submit each frame as an
        image, and use the most severe result: if any frame returns `block`,
        treat the whole video as `block`. Each frame is billed as one request.


        ## Result format


        When the task succeeds, [Get Task
        Details](/market/common/get-task-detail) returns `resultJson` as a JSON
        string with a single `resultObject` that holds the verdict and details.
        There is no `resultUrls` field and no result file.


        Example of a successful text and image check:


        ```json

        {
          "code": 200,
          "msg": "success",
          "data": {
            "taskId": "47648663d55ecc9cdbe8862e636f0856",
            "model": "kie/nsfw-moderation",
            "state": "success",
            "param": "{\"input\":\"{\\\"image_url\\\":\\\"https://static.aiquickdraw.com/tools/example/1795425260037_VHMjTFwE.jpg\\\",\\\"text\\\":\\\"A golden retriever leaping to catch a red frisbee in a sunny city park, a picnic blanket and a small wooden sign reading KIE in the background, warm afternoon light, photorealistic\\\",\\\"scene\\\":\\\"social\\\"}\",\"model\":\"kie/nsfw-moderation\"}",
            "resultJson": "{\"resultObject\":{\"model_version\":\"nsfw-2026-11-20j\",\"code\":200,\"reasons\":[],\"other_categories\":[],\"suggestion\":\"pass\",\"created_at\":\"2026-11-23T09:45:39Z\",\"task_id\":\"5e900869a9e1797ca6702dd4\",\"details\":{\"image\":{\"unsafe_score\":0.0005,\"categories\":[],\"faces\":[],\"nsfw_level\":\"none\",\"drawn_score\":0.0001,\"nsfw_scores\":{\"high\":0.0001,\"low\":0.0003,\"medium\":0.0003},\"image_type\":\"realistic\"},\"text\":{\"age_signals\":[],\"unsafe_score\":0.0005,\"categories\":[],\"nsfw_level\":\"none\"}},\"nsfw_level\":\"none\",\"minor_risk\":0.0,\"status\":\"succeeded\",\"image_type\":\"realistic\"}}",
            "failCode": null,
            "failMsg": null,
            "costTime": 0,
            "completeTime": 1795427140649,
            "createTime": 1795427139728
          }
        }

        ```


        `resultObject` fields:


        - `suggestion`: the verdict, `pass` or `block`. Build your logic on this
        field.

        - `nsfw_level`: the higher of the text and image levels: `none`, `low`
        (suggestive), `medium` (nudity) or `high` (explicit).

        - `minor_risk`: risk score for sexual content involving minors, from 0
        to 1.

        - `image_type`: `realistic` or `drawn`. Present when an image is sent.

        - `reasons`: short English phrases that explain a minors-related
        decision, for troubleshooting.

        - `other_categories`: harmful categories other than sexual content, such
        as violence or weapons, listed for reference. They do not affect
        `suggestion`; if you need to block them, handle them yourself based on
        this field.

        - `details.text` (when `text` is sent): `nsfw_level` (`none` or `high`),
        `unsafe_score` (0 to 1), `categories`, and `age_signals` (minor-related
        terms found in the text).

        - `details.image` (when `image_url` is sent): `nsfw_level` (`none`,
        `low`, `medium` or `high`), `nsfw_scores` (probability that the image
        reaches at least `low`, `medium` and `high`), `image_type`,
        `drawn_score` (probability that the image is drawn), `unsafe_score` (0
        to 1), `categories`, `faces` (each detected face with its estimated
        `age` and a `box` normalized to 0 to 1), and `min_face_age` (the lowest
        estimated age among detected faces; present when at least one face is
        detected).

        - `model_version`: version of the detection rules that produced the
        result.


        `resultObject` also contains `task_id`, `code`, `status` and
        `created_at`, which are internal processing fields. Use the KIE `taskId`
        and `state` returned by Get Task Details as the task status.


        Act on `suggestion` only: `pass` to allow, `block` to reject. Scores,
        levels and reason texts are for troubleshooting and display; they may
        change as the detection rules are updated, so do not use them as
        fine-grained thresholds.


        Example of a failed task (the image URL could not be downloaded):


        ```json

        {
          "code": 200,
          "msg": "success",
          "data": {
            "taskId": "61811fb160cbcbcf56d92cd50e2f116b",
            "model": "kie/nsfw-moderation",
            "state": "fail",
            "param": "{\"input\":\"{\\\"image_url\\\":\\\"https://static.aiquickdraw.com/tools/example/kie-nsfw-moderation-smoke-missing-404.jpg\\\",\\\"text\\\":\\\"A golden retriever leaping to catch a red frisbee in a sunny city park, a picnic blanket and a small wooden sign reading KIE in the background, warm afternoon light, photorealistic\\\",\\\"scene\\\":\\\"social\\\"}\",\"model\":\"kie/nsfw-moderation\"}",
            "resultJson": "",
            "failCode": "400",
            "failMsg": "Image fetch failed. Check access settings or use our File Upload API instead.",
            "costTime": 0,
            "completeTime": 1795427225386,
            "createTime": 1795427224798
          }
        }

        ```


        ## Billing


        - Billed per request: text only, image only, or text and image together
        each count as one request; sending both is charged once.

        - Text is not charged by length, and all three scenes cost the same.

        - Only successful tasks are charged. Failed tasks, including tasks that
        fail because the service is busy, are not charged.

        - When you check a video by sampling frames, each frame is billed as one
        request.


        See current rates on the [pricing page](https://kie.ai/pricing).


        ## Errors


        Rejected at submission: Create Task returns `code` 422 with one of these
        messages. No task is created and nothing is charged.


        | msg | When |

        |---|---|

        | Provide text, image_url, or both. | Neither `text` nor `image_url` is
        provided, or both are empty |

        | scene must be one of adult, social, strict | `scene` is not `adult`,
        `social` or `strict` (lowercase) |

        | text must be a string of at most 12000 characters | `text` is not a
        string, or is longer than 12,000 characters |

        | image_url must be a publicly accessible http(s) URL | `image_url` is
        not an http(s) URL |

        | image_urls is not supported. Send one image per request in image_url.
        | An image list such as `image_urls` is sent inside `input` |

        | callBackUrl is not supported in input. | `callBackUrl` is placed
        inside `input`; put it at the top level of the request |


        Task failed: `state` is `fail`, and `failCode` / `failMsg` are returned
        by Get Task Details and in the callback. Failed tasks are not charged.


        | failCode | failMsg | When |

        |---|---|---|

        | 400 | Image fetch failed. Check access settings or use our File Upload
        API instead. | The image URL cannot be downloaded. When text and an
        image are sent together, the whole task fails |

        | 500 | The service is busy. Please try again later. | Too many requests
        are in progress at the same time, or the service is busy. The task fails
        and is not charged; retry later. When submitting in bulk, limit
        concurrency or retry failed tasks |

        | 500 | Internal Error, Please try again later. | An internal error
        occurred; retry later |


        ## Query Task Status


        After submitting a task, use the unified query endpoint to check
        progress and retrieve results:


        <Card title="Get Task Details" icon="lucide-search"
        href="/market/common/get-task-detail">
          Learn how to query task status and retrieve generation results
        </Card>


        ::: tip[]

        For production use, we recommend using the `callBackUrl` parameter to
        receive automatic notifications when the task completes, rather than
        polling the status endpoint. If you poll instead, query Get Task Details
        about once per second.

        :::


        ## Related Resources


        <CardGroup cols={3}>
          <Card title="Market Overview" icon="lucide-store" href="/market/quickstart">
            Explore all available models
          </Card>
          <Card title="File Upload API" icon="lucide-cog" href="/file-upload-api/quickstart">
            Learn how to upload and manage files
          </Card>
          <Card title="Common API" icon="lucide-webhook" href="/common-api/get-account-credits">
            Check credits and account usage
          </Card>
        </CardGroup>
      operationId: kie-nsfw-moderation
      tags:
        - docs/en/Market/Image    Models/Kie
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - kie/nsfw-moderation
                  default: kie/nsfw-moderation
                  description: >-
                    The model name. This endpoint must use
                    `kie/nsfw-moderation`.
                  x-apidog-enum:
                    - value: kie/nsfw-moderation
                      name: ''
                      description: ''
                callBackUrl:
                  type: string
                  format: uri
                  description: >-
                    Callback URL for task completion notifications. Optional
                    parameter. If provided, the system will send a POST request
                    to this URL when the task completes, whether it succeeds or
                    fails. If omitted, no callback notification will be sent.
                  example: https://your-domain.com/api/callback
                input:
                  type: object
                  description: Input parameters. Provide `text`, `image_url`, or both.
                  properties:
                    text:
                      type: string
                      maxLength: 12000
                      description: >-
                        Text to review, such as a generation prompt. Any
                        language, up to 12,000 characters. Provide `text`,
                        `image_url`, or both.
                      examples:
                        - >-
                          A golden retriever leaping to catch a red frisbee in a
                          sunny city park, a picnic blanket and a small wooden
                          sign reading KIE in the background, warm afternoon
                          light, photorealistic
                    image_url:
                      type: string
                      format: uri
                      description: >-
                        Publicly downloadable URL of one image to review. JPG,
                        PNG, WEBP or GIF (for animated images, the first frame
                        is reviewed), up to 20 MB and 50 megapixels. Provide
                        `text`, `image_url`, or both.
                      examples:
                        - >-
                          https://static.aiquickdraw.com/tools/example/1795425260037_VHMjTFwE.jpg
                    scene:
                      type: string
                      enum:
                        - adult
                        - social
                        - strict
                      default: social
                      description: >-
                        Moderation level: `adult`, `social` or `strict`.
                        Defaults to `social`. `adult` allows adult content and
                        blocks detected sexual content involving minors;
                        `social` blocks nudity and explicit content and usually
                        allows content that is only suggestive; `strict` blocks
                        anything above `none`, including suggestive content.
                        Detected sexual content involving minors is blocked in
                        every scene.
                      examples:
                        - social
                      x-apidog-enum:
                        - value: adult
                          name: ''
                          description: ''
                        - value: social
                          name: ''
                          description: ''
                        - value: strict
                          name: ''
                          description: ''
                  x-apidog-orders:
                    - text
                    - image_url
                    - scene
              examples:
                - model: kie/nsfw-moderation
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    text: >-
                      A golden retriever leaping to catch a red frisbee in a
                      sunny city park, a picnic blanket and a small wooden sign
                      reading KIE in the background, warm afternoon light,
                      photorealistic
                    image_url: >-
                      https://static.aiquickdraw.com/tools/example/1795425260037_VHMjTFwE.jpg
                    scene: social
            example:
              model: kie/nsfw-moderation
              callBackUrl: https://your-domain.com/api/callback
              input:
                text: >-
                  A golden retriever leaping to catch a red frisbee in a sunny
                  city park, a picnic blanket and a small wooden sign reading
                  KIE in the background, warm afternoon light, photorealistic
                image_url: >-
                  https://static.aiquickdraw.com/tools/example/1795425260037_VHMjTFwE.jpg
                scene: social
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  code:
                    type: integer
                    description: >-
                      Response status code


                      - **200**: Success - Request has been processed
                      successfully

                      - **401**: Unauthorized - Authentication credentials are
                      missing or invalid

                      - **402**: Insufficient Credits - Account does not have
                      enough credits to perform the operation

                      - **404**: Not Found - The requested resource or endpoint
                      does not exist

                      - **422**: Validation Error - The request parameters
                      failed validation checks

                      - **429**: Rate Limited - Request limit has been exceeded
                      for this resource

                      - **433**: Request Limit - Sub-key Usage Exceeds Limit

                      - **455**: Service Unavailable - System is currently
                      undergoing maintenance

                      - **500**: Server Error - An unexpected error occurred
                      while processing the request

                      - **501**: Generation Failed - Content generation task
                      failed

                      - **505**: Feature Disabled - The requested feature is
                      currently disabled
                    enum:
                      - 200
                      - 401
                      - 402
                      - 404
                      - 422
                      - 429
                      - 433
                      - 455
                      - 500
                      - 501
                      - 505
                  msg:
                    type: string
                    description: Response message, error description when failed
                    example: success
                  data:
                    type: object
                    required:
                      - taskId
                    properties:
                      taskId:
                        type: string
                        description: >-
                          Task ID, can be used with Get Task Details endpoint to
                          query task status
                title: response not with recordId
              example:
                code: 200
                msg: success
                data:
                  taskId: 47648663d55ecc9cdbe8862e636f0856
          headers: {}
          x-apidog-name: Success
      security:
        - BearerAuth: []
          x-apidog:
            schemeGroups:
              - id: kn8M4YUlc5i0A0179ezwx
                schemeIds:
                  - BearerAuth
            required: true
            use:
              id: kn8M4YUlc5i0A0179ezwx
            scopes:
              kn8M4YUlc5i0A0179ezwx:
                BearerAuth: []
      x-apidog-folder: docs/en/Market/Image    Models/Kie
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1184766/apis/api-47383224-run
components:
  schemas: {}
  securitySchemes:
    BearerAuth:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        All API requests require a Bearer Token. Add the header `Authorization:
        Bearer YOUR_API_KEY` to authenticate requests.
    BearerAuth1:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 请求都需要 Bearer Token。请在请求头中添加 `Authorization: Bearer YOUR_API_KEY`
        进行身份验证。
servers:
  - url: https://api.kie.ai
    description: 正式环境
security:
  - BearerAuth: []
    x-apidog:
      schemeGroups:
        - id: kn8M4YUlc5i0A0179ezwx
          schemeIds:
            - BearerAuth
      required: true
      use:
        id: kn8M4YUlc5i0A0179ezwx
      scopes:
        kn8M4YUlc5i0A0179ezwx:
          BearerAuth: []

```
