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

# Create a moderation

> Classify text or image inputs against moderation categories and scores.



## OpenAPI

````yaml /openapi/naga-api.json post /v1/moderations
openapi: 3.1.0
info:
  title: NagaAI API
  summary: Unified AI API with OpenAI and Anthropic compatibility layers.
  version: '2026-03-31'
  contact:
    name: NagaAI
    url: https://naga.ac
  termsOfService: https://naga.ac/legal/terms
servers:
  - url: https://api.naga.ac
    description: Production
  - url: http://localhost:8500
    description: Local development
security: []
tags:
  - name: Chat Completions
    description: >-
      OpenAI-compatible chat completion requests, including streaming, tools,
      and multimodal input.
  - name: Messages
    description: >-
      Anthropic-compatible Messages API requests used by Claude-style clients
      and agents.
  - name: Responses
    description: >-
      OpenAI-compatible Responses API requests for structured input, tools, and
      streaming output items.
  - name: Embeddings
    description: >-
      Create vector embeddings for search, retrieval, clustering, and ranking
      use cases.
  - name: Images
    description: >-
      Generate or edit images with multimodal models and OpenAI-compatible
      payloads.
  - name: Audio
    description: >-
      Generate speech or convert uploaded audio into transcriptions and
      translations.
  - name: Moderations
    description: Classify text and image inputs for safety policy categories.
  - name: Models
    description: List available models, capabilities, and pricing metadata.
  - name: Startups
    description: >-
      Public metadata about AI startups and model providers surfaced by the
      gateway.
  - name: Account
    description: Provisioning-key protected account balance and usage endpoints.
  - name: API Keys
    description: Provisioning-key protected API key management endpoints.
paths:
  /v1/moderations:
    post:
      tags:
        - Moderations
      summary: Create a moderation
      description: Classify text or image inputs against moderation categories and scores.
      operationId: createModeration
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Moderation'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModerationsResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '410':
          description: Model deprecated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationErrorResponse'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '503':
          description: Upstream service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - bearerAuth: []
        - xApiKeyAuth: []
components:
  schemas:
    Moderation:
      properties:
        model:
          type: string
          title: Model
          description: Moderation model identifier.
          examples:
            - omni-moderation-latest
        input:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - items:
                anyOf:
                  - $ref: '#/components/schemas/TextInput'
                  - $ref: '#/components/schemas/ImageUrlInput'
              type: array
          title: Input
          description: Text, array of strings, or typed text/image moderation inputs.
      type: object
      required:
        - model
        - input
      title: Moderation
      examples:
        - input:
            - text: I want to hurt someone.
              type: text
            - image_url:
                url: https://example.com/image.png
              type: image_url
          model: omni-moderation-latest
    ModerationsResponse:
      properties:
        id:
          type: string
          title: Id
        model:
          type: string
          title: Model
        results:
          items:
            $ref: '#/components/schemas/ModerationResultResponse'
          type: array
          title: Results
      additionalProperties: true
      type: object
      required:
        - id
        - model
        - results
      title: ModerationsResponse
      examples:
        - id: mdr_123
          model: omni-moderation-latest
          results:
            - categories:
                self-harm: false
                violence: true
              category_applied_input_types:
                violence:
                  - text
              category_scores:
                self-harm: 0.04
                violence: 0.92
              flagged: true
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      additionalProperties: true
      type: object
      required:
        - error
      title: ErrorEnvelope
      examples:
        - error:
            message: The request body is invalid.
            type: invalid_request_error
    HTTPValidationErrorResponse:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
          type: array
          title: Detail
      additionalProperties: true
      type: object
      required:
        - detail
      title: HTTPValidationErrorResponse
    TextInput:
      properties:
        type:
          type: string
          const: text
          title: Type
        text:
          type: string
          title: Text
          description: Text to classify for moderation.
          examples:
            - I want to hurt someone.
      type: object
      required:
        - type
        - text
      title: TextInput
    ImageUrlInput:
      properties:
        type:
          type: string
          const: image_url
          title: Type
        image_url:
          $ref: '#/components/schemas/app__api__v1__moderations__ImageUrl'
      type: object
      required:
        - type
        - image_url
      title: ImageUrlInput
    ModerationResultResponse:
      properties:
        flagged:
          type: boolean
          title: Flagged
        categories:
          additionalProperties:
            type: boolean
          type: object
          title: Categories
        category_scores:
          additionalProperties:
            type: number
          type: object
          title: Category Scores
        category_applied_input_types:
          anyOf:
            - additionalProperties:
                items:
                  type: string
                type: array
              type: object
            - type: 'null'
          title: Category Applied Input Types
      additionalProperties: true
      type: object
      required:
        - flagged
        - categories
        - category_scores
      title: ModerationResultResponse
    ErrorBody:
      properties:
        type:
          type: string
          title: Type
          description: Stable machine-readable error type.
        message:
          type: string
          title: Message
          description: Human-readable error message.
        code:
          anyOf:
            - type: string
            - type: integer
            - type: 'null'
          title: Code
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
      additionalProperties: true
      type: object
      required:
        - type
        - message
      title: ErrorBody
    ValidationErrorItem:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Loc
        msg:
          type: string
          title: Msg
        type:
          type: string
          title: Type
      additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationErrorItem
    app__api__v1__moderations__ImageUrl:
      properties:
        url:
          type: string
          minLength: 1
          format: uri
          title: Url
      type: object
      required:
        - url
      title: ImageUrl
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Primary authentication for inference endpoints. Send your Naga API key
        as `Authorization: Bearer <api-key>`.
      scheme: bearer
    xApiKeyAuth:
      type: apiKey
      description: >-
        Alternate authentication for inference endpoints. Useful for clients
        that send `x-api-key: <api-key>`.
      in: header
      name: x-api-key

````