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

# Content Moderation API

> Check a prompt and up to 4 images for sexual content and sexual content involving minors before you send them to AI image or video generation. Free during beta.

The moderation endpoint is free during beta and does not consume credits.

* Send `text`, `images`, or both. At least one is required.
* `text` can be up to 10,000 characters.
* `images` takes up to 4 publicly accessible `http(s)` URLs. Base64 data URLs and videos are not supported.
* Only sexual content and sexual content involving minors are checked. Other categories, such as violence or hate, are not covered.

## Reading the Result

* `decision`: `block` means the input should not be used for generation; otherwise `allow`.
* `score`: a confidence score. Above 0 means block, and the further it is from 0, the more confident the decision. It can be `null` when no score is available.

## Errors

* `400`: the input is invalid, or an image could not be downloaded or decoded.
* `429`: the moderation service is busy. Retry with backoff.

```json 200 theme={null}
{
  "code": "SUCCESS",
  "message": "success",
  "data": {
    "decision": "allow",
    "score": -15.25
  }
}
```


## OpenAPI

````yaml POST /v1/moderation
openapi: 3.0.3
info:
  title: Pollo | AI Video Collection
  description: >-
    ✨RESTful API Document. Model discovery: GET /api/v1/model-specs (public,
    keyless).
  version: 1.0.0
servers:
  - url: https://pollo.ai/api/platform
security: []
externalDocs:
  url: https://pollo.ai/api/platform/api/openapi.json
paths:
  /v1/moderation:
    post:
      tags:
        - Moderation
      summary: Moderate text and images (free beta)
      description: >-
        Pre-generation input moderation for AI image and video requests. Checks
        the text and up to 4 images for sexual content and sexual content
        involving minors only. `score` is logprob(block) - logprob(allow): above
        0 means block, and a larger absolute value means a more confident
        decision. It is null when unavailable. Free during beta. Requests are
        logged for abuse prevention and quality improvement.
      operationId: moderation-moderate
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  minLength: 1
                  maxLength: 10000
                  description: Prompt or other text to check, up to 10000 characters.
                images:
                  type: array
                  items:
                    type: string
                    format: uri
                    maxLength: 4096
                    pattern: ^https?:\/\/
                  maxItems: 4
                  description: >-
                    Publicly accessible http(s) image URLs, up to 4. Base64 data
                    URLs are not accepted.
              additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  decision:
                    type: string
                    enum:
                      - allow
                      - block
                    description: '`block` if the input should not be used for generation.'
                  score:
                    type: number
                    nullable: true
                    description: logprob(block) - logprob(allow); above 0 means block.
                required:
                  - decision
                  - score
                additionalProperties: false
        '400':
          $ref: '#/components/responses/ApiError400'
        '401':
          $ref: '#/components/responses/ApiError401'
        '403':
          $ref: '#/components/responses/ApiError403'
        '404':
          $ref: '#/components/responses/ApiError404'
        '429':
          $ref: '#/components/responses/ApiError429'
        '500':
          $ref: '#/components/responses/ApiError500'
        default:
          $ref: '#/components/responses/error'
      security:
        - ApiKeyAuth: []
components:
  responses:
    ApiError400:
      description: >-
        Invalid request — schema validation failed (`INPUT_VALIDATION_FAILED`,
        detail in `issues`), a cross-field constraint was violated
        (`INPUT_CONSTRAINT_VIOLATED`), or the input did not pass moderation
        (`MODERATION_*`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiError401:
      description: >-
        Missing or invalid credential (`CREDENTIAL_*`, `CLI_TOKEN_EXPIRED`,
        `EMAIL_LOGIN_REQUIRED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiError403:
      description: >-
        Rejected — not enough credits (`CREDITS_INSUFFICIENT`), quota exhausted
        (`QUOTA_*`), plan required (`PLAN_FEATURE_REQUIRED`), account state
        (`ACCOUNT_*`), or no permission (`PERMISSION_DENIED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiError404:
      description: >-
        Nothing matched — unknown route, model (`MODEL_NOT_FOUND`), task
        (`TASK_NOT_FOUND`) or asset (`ASSET_NOT_FOUND`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiError429:
      description: >-
        Rate limited (`RATE_LIMIT_*`). `RATE_LIMIT_MODERATION` means recent
        content was blocked — adjust the input rather than simply retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiError500:
      description: Unexpected server-side failure (`INTERNAL`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    error:
      description: >-
        Error response. Every failure on this API uses this shape; branch on
        `errorCode`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  schemas:
    ApiError:
      type: object
      required:
        - errorCode
        - message
        - code
      additionalProperties: true
      properties:
        errorCode:
          type: string
          enum:
            - REJECTED
            - INTERNAL
            - CREDENTIAL_MISSING
            - CREDENTIAL_INVALID
            - CLI_TOKEN_EXPIRED
            - CLI_REFRESH_TOKEN_INVALID
            - PERMISSION_DENIED
            - ACCOUNT_SUSPENDED
            - ACCOUNT_DELETED
            - IP_NOT_ALLOWED
            - CREDITS_INSUFFICIENT
            - PLAN_FEATURE_REQUIRED
            - PARALLEL_TASK_LIMIT_REACHED
            - ACTIVITY_DAILY_LIMIT_REACHED
            - QUOTA_ELEMENT_FREE
            - QUOTA_ELEMENT_PAID
            - QUOTA_BRAND_KIT_FREE
            - QUOTA_BRAND_KIT_PAID
            - RATE_LIMIT_EXCEEDED
            - RATE_LIMIT_PRODUCT_EXTRACT
            - INPUT_VALIDATION_FAILED
            - INPUT_NOT_SUPPORTED_BY_MODEL
            - VIDEO_CLIP_SOURCE_TOO_LARGE
            - MODERATION_REJECTED
            - ASSET_DISABLED_BY_REVIEW
            - GENERATION_IN_PROGRESS
            - SPACE_NOT_FOUND
            - SPACE_ALREADY_MERGED
            - SPACE_MERGE_SOURCE_INVALID
            - SPACE_MERGE_TARGET_INVALID
            - SPACE_DEFAULT_IMMUTABLE
            - ELEMENT_NOT_FOUND
            - ELEMENT_NAME_TAKEN
            - ELEMENT_COVER_TAKEN
            - ELEMENT_MEDIA_INVALID
            - ELEMENT_VARIANT_NOT_FOUND
            - ELEMENT_VARIANT_VERSION_NOT_READY
            - ELEMENT_VARIANT_UNSUPPORTED
            - ELEMENT_VARIANT_NAME_TAKEN
            - CONFLICT
            - COMMIT_UNCERTAIN
            - IDEMPOTENCY_CONFLICT
            - COMMAND_REJECTED
            - DIRECTOR_EXPORT_BLOCKED
            - DIRECTOR_EXPORT_DUPLICATE
            - CHAPTER_NOT_FOUND
            - PROJECT_NOT_FOUND
            - STALE_CURSOR
            - PAYLOAD_TOO_LARGE
            - CHAPTER_DOC_TOO_LARGE
            - CHAPTER_DOC_INVALID
            - VALIDATION_ERROR
            - MISSING_DEPENDENCIES
            - NEED_SYNC
            - INVALID_CONTENT
            - SNAPSHOT_CORRUPT
            - QUOTA_EXCEEDED
            - TEXT_ASSET_NOT_FOUND
            - TEXT_MATCH_NOT_FOUND
            - TEXT_MATCH_AMBIGUOUS
            - PATCH_INVALID
            - TEXT_TOO_LARGE
            - TEXT_DOC_INVALID
            - CODE_ASSET_NOT_FOUND
            - CODE_ASSET_BUNDLE_INVALID
            - CODE_ASSET_FILE_NOT_FOUND
            - CODE_ASSET_FILE_EXISTS
            - CODE_ASSET_TOO_LARGE
            - CODE_ASSET_DOC_INVALID
            - EARN_CAMPAIGN_NOT_ACTIVE
            - EARN_CAMPAIGN_PLATFORM_NOT_SUPPORTED
            - EARN_SOCIAL_ACCOUNT_NOT_LINKED
            - EARN_POST_ALREADY_SUBMITTED
            - EARN_POST_TOO_OLD
            - EARN_POST_LINK_UNRESOLVED
            - EARN_BIO_KEY_LIMIT_REACHED
            - EARN_BIO_VERIFY_LIMIT_REACHED
            - EARN_WITHDRAWAL_MAX_EXCEEDED
            - EARN_WITHDRAWAL_COOLDOWN
            - EARN_WITHDRAWAL_BALANCE_EXCEEDED
            - EARN_REFERRAL_CODE_INVALID
            - EARN_POST_REQUIREMENTS_NOT_MET
            - INVALID_PARAMS
          description: >-
            Stable business error identifier — **the only field to branch on**.
            Codes are append-only: existing codes are never renamed or
            repurposed, but new ones are added over time, so treat this as an
            open set. Match the exact code you handle, else the family prefix
            (`MODERATION_`, `RATE_LIMIT_`, `QUOTA_`, `ACCOUNT_`, …), else fall
            back to the HTTP status.
        message:
          type: string
          description: >-
            Developer-facing text. Varies with locale and product copy — **never
            match on it**.
        code:
          type: string
          description: >-
            Transport-level code (tRPC / JSON-RPC naming). Deprecated for
            business logic; may be removed.
        requestId:
          type: string
          description: Correlation id — quote it when contacting support.
        issues:
          type: array
          description: >-
            Per-field validation detail. Present when `errorCode` is
            `INPUT_VALIDATION_FAILED`.
          items:
            type: object
            required:
              - message
            additionalProperties: true
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  type: string
                description: Path to the offending field.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key to authorize requests

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.