> ## Documentation Index
> Fetch the complete documentation index at: https://nusaai-edit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Content moderation check

> Check content for policy violations and harmful content.



## OpenAPI

````yaml post /moderations
openapi: 3.0.3
info:
  title: Neosantara AI API
  description: API for Neosantara AI services.
  version: 1.0.0
servers:
  - url: https://api.neosantara.xyz/v1
    description: API Base URL
security:
  - apiKey: []
tags:
  - name: response
  - name: chat
  - name: completions
  - name: embeddings
  - name: models
  - name: moderations
  - name: reasoning
  - name: authentication
  - name: images
paths:
  /moderations:
    post:
      tags:
        - moderations
      summary: Content moderation check
      description: Check content for policy violations and harmful content.
      operationId: moderations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModerationsRequest'
            examples:
              simple_check:
                summary: Simple moderation check
                value:
                  input: This is a test message for moderation.
                  model: text-moderation-latest
              flagged_content:
                summary: Example of flagged content
                value:
                  input: I want to kill myself.
                  model: text-moderation-latest
      responses:
        '200':
          description: Moderation results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModerationsResponse'
              examples:
                clean_content:
                  summary: Successful moderation response (clean content)
                  value:
                    id: modr-abc123xyz456
                    model: text-moderation-latest
                    results:
                      - flagged: false
                        categories:
                          hate: false
                          self-harm: false
                          sexual: false
                          violence: false
                        category_scores:
                          hate: 0.001
                          self-harm: 0.0005
                          sexual: 0.0003
                          violence: 0.0002
                flagged_content_response:
                  summary: Successful moderation response (flagged content)
                  value:
                    id: modr-abc123xyz456
                    model: text-moderation-latest
                    results:
                      - flagged: true
                        categories:
                          hate: true
                          self-harm: true
                          sexual: false
                          violence: false
                        category_scores:
                          hate: 0.95
                          self-harm: 0.88
                          sexual: 0.005
                          violence: 0.003
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AuthError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ModerationsRequest:
      type: object
      required:
        - input
      properties:
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        model:
          type: string
          example: text-moderation-latest
    ModerationsResponse:
      type: object
      properties:
        id:
          type: string
        model:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/ModerationResult'
        _metadata:
          $ref: '#/components/schemas/Metadata'
    ModerationResult:
      type: object
      properties:
        flagged:
          type: boolean
        categories:
          type: object
          properties:
            hate:
              type: boolean
            hate/threatening:
              type: boolean
            harassment:
              type: boolean
            harassment/threatening:
              type: boolean
            self-harm:
              type: boolean
            self-harm/intent:
              type: boolean
            self-harm/instructions:
              type: boolean
            sexual:
              type: boolean
            sexual/minors:
              type: boolean
            violence:
              type: boolean
            violence/graphic:
              type: boolean
            profanity:
              type: boolean
        category_scores:
          type: object
          properties:
            hate:
              type: number
            hate/threatening:
              type: number
            harassment:
              type: number
            harassment/threatening:
              type: number
            self-harm:
              type: number
            self-harm/intent:
              type: number
            self-harm/instructions:
              type: number
            sexual:
              type: number
            sexual/minors:
              type: number
            violence:
              type: number
            violence/graphic:
              type: number
            profanity:
              type: number
    Metadata:
      type: object
      properties:
        creator:
          type: string
          example: noesantara.xyz
        status:
          type: boolean
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          nullable: true
        processing_time:
          type: number
          nullable: true
        tier:
          type: string
          nullable: true
        user_total_usage:
          $ref: '#/components/schemas/UsageInfo'
          nullable: true
    BadRequestError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              enum:
                - invalid_parameter
                - missing_parameter
                - invalid_format
                - invalid_messages
              example: invalid_parameter
            param:
              type: string
              nullable: true
            details:
              type: object
              nullable: true
              additionalProperties: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    AuthError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: auth_error
            code:
              type: string
              enum:
                - missing_api_key
                - invalid_api_key
                - token_expired
                - session_expired
                - invalid_token
              example: invalid_api_key
            details:
              type: object
              nullable: true
              additionalProperties: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    RateLimitError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: rate_limit_exceeded
            code:
              type: string
              enum:
                - rpm_exceeded
                - tpm_exceeded
                - user_total_daily_limit_exceeded
                - user_total_monthly_limit_exceeded
              example: rpm_exceeded
            details:
              $ref: '#/components/schemas/RateLimitDetails'
              nullable: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    ServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              example: server_error
            code:
              type: string
              enum:
                - internal_error
                - service_unavailable
                - timeout
              example: internal_error
            details:
              type: object
              nullable: true
              additionalProperties: true
          required:
            - message
            - type
            - code
        info_metadata:
          $ref: '#/components/schemas/Metadata'
    UsageInfo:
      type: object
      properties:
        used:
          type: integer
        limit:
          type: integer
        remaining:
          type: integer
        reset_at:
          type: string
          format: date-time
      required:
        - used
        - limit
        - remaining
        - reset_at
    RateLimitDetails:
      type: object
      properties:
        limit:
          type: integer
        remaining:
          type: integer
        reset:
          type: string
          format: date-time
        retry_after:
          type: integer
          nullable: true
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequestError'
    AuthError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
    RateLimitError:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: Your NeosantaraAI API Key.

````