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

# Create moderation

> OpenAI-compatible content safety checks for user-generated or model-generated text. Evaluates input against categories such as hate, harassment, self-harm, sexual content, and violence.



## OpenAPI

````yaml api-reference/openapi.json POST /v1/moderations
openapi: 3.1.0
info:
  title: DGrid AI Gateway API
  description: >-
    A single, unified API to access 200+ leading AI models. OpenAI-, Claude-,
    and Gemini-compatible endpoints for chat, completions, embeddings, images,
    audio, and moderations.
  version: 1.0.0
  contact:
    name: DGrid AI
    url: https://dgrid.ai
servers:
  - url: https://api.dgrid.ai
    description: DGrid AI Gateway
security:
  - bearerAuth: []
paths:
  /v1/moderations:
    post:
      tags:
        - Moderations
      summary: Create moderation
      description: >-
        OpenAI-compatible content safety checks for user-generated or
        model-generated text. Evaluates input against categories such as hate,
        harassment, self-harm, sexual content, and violence.
      operationId: createModeration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - input
              properties:
                input:
                  description: Text content to moderate.
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                model:
                  type: string
                  description: >-
                    Moderation model such as `text-moderation-latest` or
                    `text-moderation-stable`.
            example:
              input: I want to hug a puppy.
      responses:
        '200':
          description: Moderation results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Moderation request ID.
                  model:
                    type: string
                    description: Model used for moderation.
                  results:
                    type: array
                    description: Moderation result entries.
                    items:
                      type: object
                      properties:
                        flagged:
                          type: boolean
                          description: Whether the input was flagged.
                        categories:
                          type: object
                          description: >-
                            Boolean category decisions (hate, harassment,
                            self-harm, sexual, violence, and threatening
                            variants).
                        category_scores:
                          type: object
                          description: Continuous scores for each category.
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your DGrid API key. All endpoints use `Authorization: Bearer
        <DGRID_API_KEY>`.

````