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

# Create AI CM:nsfw task

> This algorithm allows to quickly detect inappropriate content, determining that the content is NSFW ("Not Safe For Work") or normal. Generic info about all capabilities and limits see in the generic ["Content Moderation"](/docs/api-reference/streaming/ai/create-ai-task) method.


**What is "Not Safe For Work"?**

The algorithm has recognized inappropriate content in a video and it might not be suitable to view in public places. The solution provides its confidence level (in percentage) of how sure it is that the content is NSFW, or it most likely does not contain any sexual or similar content.


Different to soft-nudity-detection and hard-nudity-detection, this model will only check for sensitive material that can be considered not-safe-for-work. 

![AI Content Moderation: NSFW detection visual example](https://demo-files.gvideo.io/apidocs/nsfw-detection.gif)

**How to use?**

Frames within the specified video are analyzed.

Response will contain only frames for which the class nsfw is detected with a confidence of more than 50%.


Example of detected NSFW:

```
{
  "nsfw_detected": true,
  "detection_results": [ "nsfw" ],
  "frames": [
      {
          "label": "nsfw",
          "confidence": 0.93,
          "frame_number": 1
      },..
  ]
}
```

Example of a response without detecting inappropriate content:

```
{
  "nsfw_detected": false,
  "detection_results": [],
  "frames": []
}
```

  


Please note that the API only provides a set of data (json) about the objects found, so no video is generated. The demo video video (above ^) was specially created based on json from the API for visual demonstration and better perception of the possibilities.



## OpenAPI

````yaml /api-reference/services_documented/streaming_api.yaml post /streaming/ai/tasks#cm_nsfw
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Streaming API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-07T20:33:46.548242+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: AI
    x-displayName: AI
  - name: Broadcasts
    x-displayName: Broadcasts
  - name: Directories
    x-displayName: Directories
  - name: Overlays
    x-displayName: Overlays
  - name: Players
    x-displayName: Players
  - name: Playlists
    x-displayName: Playlists
  - name: QualitySets
    x-displayName: QualitySets
  - name: Restreams
    x-displayName: Restreams
  - name: Streaming Statistics
    x-displayName: Statistics
  - name: Streams
    x-displayName: Streams
  - name: Subtitles
    x-displayName: Subtitles
  - name: Videos
    x-displayName: Videos
paths:
  /streaming/ai/tasks#cm_nsfw:
    post:
      tags:
        - AI
      summary: Create AI CM:nsfw task
      description: >-
        This algorithm allows to quickly detect inappropriate content,
        determining that the content is NSFW ("Not Safe For Work") or normal.
        Generic info about all capabilities and limits see in the generic
        ["Content Moderation"](/docs/api-reference/streaming/ai/create-ai-task)
        method.



        **What is "Not Safe For Work"?**


        The algorithm has recognized inappropriate content in a video and it
        might not be suitable to view in public places. The solution provides
        its confidence level (in percentage) of how sure it is that the content
        is NSFW, or it most likely does not contain any sexual or similar
        content.



        Different to soft-nudity-detection and hard-nudity-detection, this model
        will only check for sensitive material that can be considered
        not-safe-for-work. 


        ![AI Content Moderation: NSFW detection visual
        example](https://demo-files.gvideo.io/apidocs/nsfw-detection.gif)


        **How to use?**


        Frames within the specified video are analyzed.


        Response will contain only frames for which the class nsfw is detected
        with a confidence of more than 50%.



        Example of detected NSFW:


        ```

        {
          "nsfw_detected": true,
          "detection_results": [ "nsfw" ],
          "frames": [
              {
                  "label": "nsfw",
                  "confidence": 0.93,
                  "frame_number": 1
              },..
          ]
        }

        ```


        Example of a response without detecting inappropriate content:


        ```

        {
          "nsfw_detected": false,
          "detection_results": [],
          "frames": []
        }

        ```

          


        Please note that the API only provides a set of data (json) about the
        objects found, so no video is generated. The demo video video (above ^)
        was specially created based on json from the API for visual
        demonstration and better perception of the possibilities.
      operationId: post_ai_contentmoderation_nsfw
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ai_contentmoderation_nsfw'
      responses:
        '201':
          description: >-
            Response returns ID of the created AI task. Using this AI task ID,
            you can check the status and get the video processing result. Look
            at GET /ai/results method.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ai_post_response'
        '400':
          description: |-
            Bad request:
            - "url" is not specified,
            - Queue limit reached (100), try later,
            - etc
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/streaming_error'
        '422':
          description: >-
            This is advanced functionality; to enable it, contact your manager
            or the Support Team.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/upgraderequired'
components:
  schemas:
    ai_contentmoderation_nsfw:
      allOf:
        - $ref: '#/components/schemas/ai_contentmoderation_general'
      required:
        - category
      properties:
        category:
          type: string
          enum:
            - nsfw
          description: AI content moderation with NSFW detection algorithm
      example:
        url: https://demo-files.gvideo.io/ai_demo_subtitles_nudity_detection.mp4
        task_name: content-moderation
        category: nsfw
    ai_post_response:
      type: object
      required:
        - task_id
      properties:
        task_id:
          type: string
          format: uuid
          description: >-
            ID of the created AI task, from which you can get the execution
            result
      example:
        task_id: aafe70c6-0000-0000-0000-327b65f7670f
    streaming_error:
      type: object
      properties:
        error:
          type: string
          description: Text message with description of error.
      example:
        error: Queue limit reached (100), try later.
    upgraderequired:
      type: object
      properties:
        error:
          type: string
          description: >-
            This is advanced functionality; to enable it, contact your manager
            or support service.
      example:
        error: Feature is disabled. Contact support to enable.
    ai_contentmoderation_general:
      type: object
      required:
        - url
        - task_name
      properties:
        task_name:
          type: string
          description: Name of the task to be performed
          enum:
            - content-moderation
        url:
          type: string
          description: >-
            URL to the MP4 file to analyse. File must be publicly accessible via
            HTTP/HTTPS.
        category:
          type: string
          description: >-
            Model for analysis (content-moderation only). Determines what
            exactly needs to be found in the video.
          enum:
            - sport
            - nsfw
            - hard_nudity
            - soft_nudity
        client_user_id:
          type: string
          maxLength: 256
          default: null
          description: >-
            Meta parameter, designed to store your own identifier. Can be used
            by you to tag requests from different end-users. It is not used in
            any way in video processing.
        client_entity_data:
          type: string
          maxLength: 4096
          default: null
          description: >-
            Meta parameter, designed to store your own extra information about a
            video entity: video source, video id, etc. It is not used in any way
            in video processing.


            For example, if an AI-task was created automatically when you
            uploaded a video with the AI auto-processing option (nudity
            detection, etc), then the ID of the associated video for which the
            task was performed will be explicitly indicated here.
      example:
        url: https://demo-files.gvideo.io/ai_demo_subtitles_nudity_detection.mp4
        task_name: content-moderation
        category: nsfw
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````