# Omni Moderation

> Omni Moderation is OpenAI’s multimodal model for reviewing multilingual text and images. PoYo provides free API access to this model, with category flags and confidence scores for content review workflows.

## Overview

- Submit: `https://api.poyo.ai/api/generate/submit`
- Status: `https://api.poyo.ai/api/generate/status/{task_id}`
- Page: https://poyo.ai/models/omni-moderation-latest
- Model page ID: `omni-moderation-latest`
- API model ID: `omni-moderation-latest`
- Category: Tools
- Auth: `Authorization: Bearer $POYO_API_KEY`
- Create a key at https://poyo.ai/dashboard/api-key

This model uses PoYo's unified async API. POST the JSON body below, then poll status with the returned `task_id` or receive a webhook on `callback_url`. Failed tasks are not charged.

## Pricing

- Calling this model through PoYo is free. Authenticate with a PoYo API key.

For more details, see https://poyo.ai/models/omni-moderation-latest.

## API Information

The request envelope is always `{ model, input, callback_url? }`. Input fields below are nested under `input`.

### Request envelope

- `model` (`ModelEnum`, required):
  Public model identifier.
  - Options: `"omni-moderation-latest"`
  - Examples: "omni-moderation-latest"
- `callback_url` (`string`, optional):
  Optional webhook callback URL. On task completion or failure, the POST body is the status response data object without the outer code/data wrapper.
  - Examples: "https://your-domain.com/callback"

### Input Schema

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.

The API accepts the following `input` parameters:

- `prompt` (`string`, optional):
  Text to review. Optional when image_urls contains one image; may be provided together with the image.
  - Examples: "A peaceful mountain landscape."
- `image_urls` (`list`, optional):
  At most one HTTPS image URL to review. Optional when prompt contains non-whitespace text; prompt may accompany the image.
  - Array of string
  - Length: 0 to 1
  - Examples: `["https://example.com/image.jpg"]`

Required Parameters Example:

```json
{
  "model": "omni-moderation-latest",
  "input": {
    "prompt": "周末想和朋友去公园徒步，沿途拍一些风景照片。请问大家有什么适合初学者的路线推荐？"
  }
}
```

Full Example:

```json
{
  "model": "omni-moderation-latest",
  "input": {
    "prompt": "周末想和朋友去公园徒步，沿途拍一些风景照片。请问大家有什么适合初学者的路线推荐？"
  }
}
```

### Output Schema

Submit returns a `task_id`. Poll `GET /api/generate/status/{task_id}` until `status` is `finished` or `failed`. Completed structured results are in `data.output`; `data.files` is empty.

Response fields:

- `code` (`integer`, required):
  - Examples: `200`
- `data` (`object`, required):

Example Response:

```json
{
  "code": 200,
  "data": {
    "task_id": "ZKPUY2WZFZZBQR99",
    "status": "finished",
    "files": [],
    "created_time": "2026-10-15T09:15:13",
    "progress": 100,
    "credits_amount": 0,
    "output": {
      "id": "modr-6047",
      "model": "omni-moderation-latest",
      "results": [
        {
          "categories": {
            "harassment": false,
            "harassment/threatening": false,
            "hate": false,
            "hate/threatening": false,
            "illicit": false,
            "illicit/violent": false,
            "self-harm": false,
            "self-harm/instructions": false,
            "self-harm/intent": false,
            "sexual": false,
            "sexual/minors": false,
            "violence": false,
            "violence/graphic": false
          },
          "category_applied_input_types": {
            "harassment": [
              "text"
            ],
            "harassment/threatening": [
              "text"
            ],
            "hate": [
              "text"
            ],
            "hate/threatening": [
              "text"
            ],
            "illicit": [
              "text"
            ],
            "illicit/violent": [
              "text"
            ],
            "self-harm": [
              "text"
            ],
            "self-harm/instructions": [
              "text"
            ],
            "self-harm/intent": [
              "text"
            ],
            "sexual": [
              "text"
            ],
            "sexual/minors": [
              "text"
            ],
            "violence": [
              "text"
            ],
            "violence/graphic": [
              "text"
            ]
          },
          "category_scores": {
            "harassment": 0.00001941131867789626,
            "harassment/threatening": 0.000005307507822667365,
            "hate": 0.000007843789122138342,
            "hate/threatening": 0.0000014285517650093407,
            "illicit": 0.007524802741322494,
            "illicit/violent": 0.00006667023092435894,
            "self-harm": 0.0005140312645402674,
            "self-harm/instructions": 0.0002411633099620722,
            "self-harm/intent": 0.0002785803623326577,
            "sexual": 0.0008000313556104121,
            "sexual/minors": 0.0001206589712246389,
            "violence": 0.0005012746277703161,
            "violence/graphic": 0.000011235328063870752
          },
          "flagged": false
        }
      ]
    }
  }
}
```

## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://api.poyo.ai/api/generate/submit \
  --header "Authorization: Bearer $POYO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"omni-moderation-latest","input":{"prompt":"周末想和朋友去公园徒步，沿途拍一些风景照片。请问大家有什么适合初学者的路线推荐？"}}'
```

### Python

```python
import json
import os
import time
import requests

API = "https://api.poyo.ai"
headers = {
    "Authorization": f"Bearer {os.environ['POYO_API_KEY']}",
    "Content-Type": "application/json",
}
payload = json.loads("{\n  \"model\": \"omni-moderation-latest\",\n  \"input\": {\n    \"prompt\": \"周末想和朋友去公园徒步，沿途拍一些风景照片。请问大家有什么适合初学者的路线推荐？\"\n  }\n}")

submit = requests.post(f"{API}/api/generate/submit", headers=headers, json=payload)
submit.raise_for_status()
task_id = submit.json()["data"]["task_id"]

while True:
    status = requests.get(f"{API}/api/generate/status/{task_id}", headers=headers)
    status.raise_for_status()
    data = status.json()["data"]
    if data["status"] in ("finished", "failed"):
        print(data)
        break
    time.sleep(2)
```

### JavaScript

```javascript
const headers = {
  Authorization: `Bearer ${process.env.POYO_API_KEY}`,
  "Content-Type": "application/json",
};

const submit = await fetch("https://api.poyo.ai/api/generate/submit", {
  method: "POST",
  headers,
  body: JSON.stringify({
  "model": "omni-moderation-latest",
  "input": {
    "prompt": "周末想和朋友去公园徒步，沿途拍一些风景照片。请问大家有什么适合初学者的路线推荐？"
  }
}),
});

const submitted = await submit.json();
const taskId = submitted.data.task_id;

while (true) {
  const statusResponse = await fetch(`https://api.poyo.ai/api/generate/status/${taskId}`, { headers });
  const status = await statusResponse.json();
  if (["finished", "failed"].includes(status.data.status)) {
    console.log(status.data);
    break;
  }
  await new Promise((resolve) => setTimeout(resolve, 2000));
}
```

## Additional Resources

### Documentation

- [Model Playground](https://poyo.ai/models/omni-moderation-latest)
- [API Documentation](https://docs.poyo.ai/api-manual/moderation-series/omni-moderation)
- [API Documentation (Markdown)](https://docs.poyo.ai/api-manual/moderation-series/omni-moderation.md)
- [Task status](https://docs.poyo.ai/api-manual/task-management/query-task-status)
- [Webhooks](https://docs.poyo.ai/api-manual/task-management/webhooks)

### Other agent-readable surfaces

- [Platform overview](https://poyo.ai/llms.txt)
- [Documentation index](https://docs.poyo.ai/llms.txt)
- [Full documentation text](https://docs.poyo.ai/llms-full.txt)
- Any other model: `https://poyo.ai/models/<model-id>/llms.txt`
