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

# Omni Moderation

> Review text and HTTPS images asynchronously with OpenAI. FREE (0 credits).

**Price: FREE (0 credits)**

Omni Moderation reviews text, at most one HTTPS image, or both using OpenAI `omni-moderation-latest`. Submit a review through the unified generation endpoint, then poll [Get Task Status](/api-manual/task-management/status) with the returned `task_id` or receive an optional callback.

Submission immediately returns `status: "not_started"`. The review runs asynchronously and moves through `running` to `finished` or `failed`.

<Info>
  Callbacks are supported through the optional outer `callback_url` field. Streaming is not supported; do not send `stream`.
</Info>

## Input

| Field | Type | Description |
| - | - | - |
| `model` | string | Must be `omni-moderation-latest` |
| `callback_url` | string (URI) | Optional webhook URL for task completion or failure |
| `input.prompt` | string | Optional text to review; may accompany one image |
| `input.image_urls` | string\[] | Optional array containing at most one HTTPS image URL |

**At least one of `prompt` or `image_urls` is required; both may be provided.** Use non-whitespace text, one HTTPS image URL, or both. `image_urls` remains an array and accepts at most one image. Submit multiple images as separate tasks. Empty input is rejected.

## Submit a Review

```bash theme={null}
curl -X POST https://api.poyo.ai/api/generate/submit \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-moderation-latest",
    "input": {
      "prompt": "A peaceful mountain landscape."
    }
  }'
```

To review an image together with text:

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": {
    "prompt": "A mountain view at sunset.",
    "image_urls": [
      "https://example.com/image.jpg"
    ]
  }
}
```

For image-only review, omit `prompt`. To receive the completed task through a webhook, provide `callback_url` outside `input`:

```json theme={null}
{
  "model": "omni-moderation-latest",
  "callback_url": "https://your-domain.com/callback",
  "input": {
    "prompt": "A peaceful mountain landscape."
  }
}
```

### Submit Response

```json theme={null}
{
  "code": 200,
  "data": {
    "task_id": "MODERATION_TASK_ID",
    "status": "not_started",
    "created_time": "2026-10-14T10:00:00"
  }
}
```

## Retrieve the Result

```bash theme={null}
curl https://api.poyo.ai/api/generate/status/MODERATION_TASK_ID \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Poll until `data.status` becomes `finished` or `failed`. A completed review returns the full OpenAI response in `data.output`; `data.files` is empty and `data.credits_amount` is `0`.

| Field | Type | Description |
| - | - | - |
| `data.output.id` | string | OpenAI moderation response identifier |
| `data.output.model` | string | Model identifier returned by OpenAI, which may be a dated model version |
| `data.output.results` | array | OpenAI review results |
| `data.output.results[].flagged` | boolean | Whether OpenAI flagged the reviewed content |
| `data.output.results[].categories` | object | Classification booleans by category |
| `data.output.results[].category_scores` | object | Confidence scores by category |
| `data.output.results[].category_applied_input_types` | object | Input modalities used for each category |

`status: "finished"` means that the review completed. A result with `flagged: true` is a successful review that detected content, and does not make the task `failed`. Check `data.error_message` only when the task itself fails.

## Callback Body

When `callback_url` is provided, PoYo sends a POST request when the task becomes `finished` or `failed`. The body is the status response's `data` object, without the outer `code` and `data` wrapper. It includes `task_id`, `status`, `credits_amount: 0`, `files: []`, and the completed OpenAI response in `output` when available. Failed tasks expose `error_message`.

See [Webhook Callbacks](/api-manual/task-management/webhooks) for signature verification.

## Completed Status Response Example

```json theme={null}
{
  "code": 200,
  "data": {
    "task_id": "MODERATION_TASK_ID",
    "status": "finished",
    "credits_amount": 0,
    "files": [],
    "output": {
      "id": "modr_example",
      "model": "omni-moderation-latest",
      "results": [
        {
          "flagged": false,
          "categories": {
            "harassment": false,
            "harassment/threatening": false,
            "hate": false,
            "hate/threatening": false,
            "illicit": false,
            "illicit/violent": false,
            "self-harm": false,
            "self-harm/intent": false,
            "self-harm/instructions": false,
            "sexual": false,
            "sexual/minors": false,
            "violence": false,
            "violence/graphic": false
          },
          "category_scores": {
            "harassment": 0.00001,
            "harassment/threatening": 0.00001,
            "hate": 0.00001,
            "hate/threatening": 0.00001,
            "illicit": 0.00001,
            "illicit/violent": 0.00001,
            "self-harm": 0.00001,
            "self-harm/intent": 0.00001,
            "self-harm/instructions": 0.00001,
            "sexual": 0.00001,
            "sexual/minors": 0.00001,
            "violence": 0.00001,
            "violence/graphic": 0.00001
          },
          "category_applied_input_types": {
            "harassment": [
              "text"
            ],
            "harassment/threatening": [
              "text"
            ],
            "hate": [
              "text"
            ],
            "hate/threatening": [
              "text"
            ],
            "illicit": [
              "text"
            ],
            "illicit/violent": [
              "text"
            ],
            "self-harm": [
              "text"
            ],
            "self-harm/intent": [
              "text"
            ],
            "self-harm/instructions": [
              "text"
            ],
            "sexual": [
              "text"
            ],
            "sexual/minors": [
              "text"
            ],
            "violence": [
              "text"
            ],
            "violence/graphic": [
              "text"
            ]
          }
        }
      ]
    },
    "created_time": "2026-10-14T10:00:00",
    "progress": 100,
    "error_message": null
  }
}
```


## OpenAPI

````yaml api-manual/moderation-series/omni-moderation.json POST /api/generate/submit
openapi: 3.1.0
info:
  title: PoYo AI - Omni Moderation API
  description: >-
    Omni Moderation reviews text and HTTPS images asynchronously through OpenAI.
    FREE (0 credits). Submit through the unified generation API and poll task
    status or receive a callback with the complete OpenAI response in output.
    Streaming is not supported.
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Moderation
      summary: Submit Omni Moderation Review
      description: >-
        Queue a review of text, at most one HTTPS image URL, or both. FREE (0
        credits). Returns a not_started task immediately; poll task status or
        provide callback_url for completion. A flagged review completes with
        status finished. Streaming is not supported.
      operationId: submitOmniModerationTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              text-only:
                summary: Review text — FREE (0 credits)
                value:
                  model: omni-moderation-latest
                  input:
                    prompt: A peaceful mountain landscape.
              image-only:
                summary: Review an HTTPS image — FREE (0 credits)
                value:
                  model: omni-moderation-latest
                  input:
                    image_urls:
                      - https://example.com/image.jpg
              text-and-image:
                summary: Review text and an image — FREE (0 credits)
                value:
                  model: omni-moderation-latest
                  input:
                    prompt: A mountain view at sunset.
                    image_urls:
                      - https://example.com/image.jpg
              with-callback:
                summary: Review with a completion callback — FREE (0 credits)
                value:
                  model: omni-moderation-latest
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: A peaceful mountain landscape.
      responses:
        '200':
          description: >-
            Task queued with status not_started. Poll GET
            /api/generate/status/{task_id} or receive the optional callback
            after completion.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              example:
                code: 200
                data:
                  task_id: MODERATION_TASK_ID
                  status: not_started
                  created_time: '2026-10-14T10:00:00'
        '400':
          description: Invalid model input or unsupported stream parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid API key.
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      description: >-
        Queue an asynchronous Omni Moderation review. Provide optional
        callback_url for completion notifications. Streaming is not supported.
      properties:
        model:
          type: string
          enum:
            - omni-moderation-latest
          description: Public model identifier.
          example: omni-moderation-latest
        callback_url:
          type: string
          format: uri
          description: >-
            Optional webhook callback URL. On task completion or failure, the
            POST body is the status response data object without the outer
            code/data wrapper.
          example: https://your-domain.com/callback
        input:
          type: object
          additionalProperties: false
          description: >-
            At least one of prompt or image_urls is required; both may be
            provided. Provide non-whitespace text or one HTTPS image URL.
            image_urls accepts at most one HTTPS image URL, and prompt may
            accompany the image.
          properties:
            prompt:
              type: string
              description: >-
                Text to review. Optional when image_urls contains one image; may
                be provided together with the image.
              example: A peaceful mountain landscape.
            image_urls:
              type: array
              maxItems: 1
              description: >-
                At most one HTTPS image URL to review. Optional when prompt
                contains non-whitespace text; prompt may accompany the image.
              items:
                type: string
                format: uri
                pattern: ^https://
                description: HTTPS URL of an image to review.
              example:
                - https://example.com/image.jpg
          not:
            properties:
              prompt:
                not:
                  pattern: \S
              image_urls:
                maxItems: 0
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              description: >-
                Use this task identifier with GET
                /api/generate/status/{task_id}.
              example: MODERATION_TASK_ID
            status:
              type: string
              enum:
                - not_started
              description: >-
                Initial queued status. Review execution proceeds asynchronously
                after submission.
            created_time:
              type: string
              format: date-time
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
          additionalProperties: true
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````

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