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

# Moderation

> OpenAI-compatible content moderation, benchmarked against omni-moderation-latest.

Moderation models screen text for unsafe, harmful, or policy-sensitive content before it reaches your application or model workflow. Call either the [Responses API](/api-reference/responses) (`POST /v1/responses`) or the OpenAI-compatible [Chat Completions API](/api-reference/chat-completions) (`POST /v1/chat/completions`).

| Model                                                                                                                                                                                                                                                                                                                                                                                                       | Input /1M | Output /1M | Params | Max tokens |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------: | ---------: | ------ | ---------: |
| <a href="/api-reference/models/zlm-v1-moderation-edge" style={{display:"inline-flex",alignItems:"center",gap:"0.5rem",textDecoration:"none",color:"inherit",wordBreak:"break-word",borderBottom:"none"}}><img src="https://models-favicon.zerogpu.ai/zlm-v1-iab-classify-edge-enriched/logo_dark.png" alt="zlm-v1-moderation-edge" width="22" height="22" noZoom /> <code>zlm-v1-moderation-edge</code></a> |    \$0.02 |     \$0.05 | 86M    |      4,000 |

## zlm-v1-moderation-edge

> ZeroGPU's moderation model screens text for unsafe, harmful, or policy-sensitive content and returns the complete OpenAI 13-category taxonomy — a `flagged` verdict, per-category booleans, and calibrated `category_scores` — so it drops into any pipeline written against `omni-moderation-latest`. Under the hood it's an 86M-parameter DeBERTa encoder with a shared trunk feeding one binary safe/unsafe head and 13 category heads, with per-category thresholds calibrated on held-out validation data. In [head-to-head benchmarks](https://zerogpu.ai/benchmarks/moderation-edge) against OpenAI omni-moderation it wins the binary safe/unsafe decision (0.899 vs 0.853 F1) and 9 of 13 harm categories — with the largest gains on graphic violence, illicit content, and self-harm — while returning verdicts 1.2–1.8× faster at the median on production-range inputs, because inference is co-located at the edge instead of a round trip to a central API. Moderation sits inline in front of every response your app serves; this is the model that's fast and accurate enough to live there.

**References:** [Moderation benchmark](https://zerogpu.ai/benchmarks/moderation-edge) • [Terms](https://zerogpu.ai/terms) • [Privacy](https://zerogpu.ai/privacy-policy)

<CodeGroup>
  ```bash Responses API theme={null}
  curl https://api.zerogpu.ai/v1/responses \
    -H "content-type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "x-project-id: YOUR_PROJECT_ID" \
    -d '{
    "input": "I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next.",
    "model": "zlm-v1-moderation-edge"
  }'
  ```

  ```bash Chat Completions theme={null}
  curl https://api.zerogpu.ai/v1/chat/completions \
    -H "content-type: application/json" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "x-project-id: YOUR_PROJECT_ID" \
    -d '{
    "model": "zlm-v1-moderation-edge",
    "messages": [
      {
        "role": "user",
        "content": "I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next."
      }
    ]
  }'
  ```
</CodeGroup>

The API returns a standard completion envelope. The moderation verdict is inside it as an escaped JSON **string** — not a nested object — in `choices[].message.content` (Chat Completions) or `output[].content[].text` (Responses API). This is the actual, unmodified output:

<CodeGroup>
  ```json Chat Completions theme={null}
  {
    "id": "20cb788a-ba05-4543-a2b3-e80f8e814e49",
    "object": "chat.completion",
    "created": 1786030403,
    "model": "zlm-v1-moderation-edge",
    "choices": [
      {
        "index": 0,
        "message": {
          "role": "assistant",
          "content": "{\"model\":\"zlm-v1-moderation-edge\",\"results\":[{\"flagged\":true,\"unsafe_score\":1,\"categories\":{\"hate\":false,\"hate/threatening\":false,\"harassment\":true,\"harassment/threatening\":true,\"self-harm\":false,\"self-harm/intent\":false,\"self-harm/instructions\":false,\"sexual\":false,\"sexual/minors\":false,\"violence\":true,\"violence/graphic\":false,\"illicit\":true,\"illicit/violent\":true},\"category_scores\":{\"hate\":0.21574,\"hate/threatening\":0.168273,\"harassment\":0.82545,\"harassment/threatening\":0.957703,\"self-harm\":0.015232,\"self-harm/intent\":0.017179,\"self-harm/instructions\":0.01807,\"sexual\":0.035671,\"sexual/minors\":0.094207,\"violence\":0.665897,\"violence/graphic\":0.198346,\"illicit\":0.732167,\"illicit/violent\":0.780693}}]}",
          "refusal": null,
          "annotations": []
        },
        "logprobs": null,
        "finish_reason": "stop"
      }
    ],
    "usage": {
      "prompt_tokens": 30,
      "completion_tokens": 177,
      "total_tokens": 207,
      "prompt_tokens_details": {
        "cached_tokens": 0,
        "audio_tokens": 0
      },
      "completion_tokens_details": {
        "reasoning_tokens": 0,
        "audio_tokens": 0,
        "accepted_prediction_tokens": 0,
        "rejected_prediction_tokens": 0
      }
    },
    "service_tier": "default"
  }
  ```

  ```json Responses API theme={null}
  {
    "id": "6b644bea-ed4a-43e6-b2ed-6a462c79c4e0",
    "object": "response",
    "created_at": 1786030511,
    "status": "completed",
    "completed_at": 1786030511,
    "error": null,
    "incomplete_details": null,
    "instructions": null,
    "max_output_tokens": null,
    "model": "zlm-v1-moderation-edge",
    "output": [
      {
        "type": "message",
        "id": "6b644bea-ed4a-43e6-b2ed-6a462c79c4e0",
        "status": "completed",
        "role": "assistant",
        "content": [
          {
            "type": "output_text",
            "text": "{\"model\":\"zlm-v1-moderation-edge\",\"results\":[{\"flagged\":true,\"unsafe_score\":1,\"categories\":{\"hate\":false,\"hate/threatening\":false,\"harassment\":true,\"harassment/threatening\":true,\"self-harm\":false,\"self-harm/intent\":false,\"self-harm/instructions\":false,\"sexual\":false,\"sexual/minors\":false,\"violence\":true,\"violence/graphic\":false,\"illicit\":true,\"illicit/violent\":true},\"category_scores\":{\"hate\":0.21574,\"hate/threatening\":0.168273,\"harassment\":0.82545,\"harassment/threatening\":0.957703,\"self-harm\":0.015232,\"self-harm/intent\":0.017179,\"self-harm/instructions\":0.01807,\"sexual\":0.035671,\"sexual/minors\":0.094207,\"violence\":0.665897,\"violence/graphic\":0.198346,\"illicit\":0.732167,\"illicit/violent\":0.780693}}]}",
            "annotations": []
          }
        ]
      }
    ],
    "parallel_tool_calls": true,
    "previous_response_id": null,
    "reasoning": {
      "effort": null,
      "summary": null
    },
    "store": true,
    "temperature": 1,
    "text": {
      "format": {
        "type": "text"
      }
    },
    "tool_choice": "auto",
    "tools": [],
    "top_p": 1,
    "truncation": "auto",
    "usage": {
      "input_tokens": 30,
      "input_tokens_details": {
        "cached_tokens": 0
      },
      "output_tokens": 177,
      "output_tokens_details": {
        "reasoning_tokens": 0
      },
      "total_tokens": 207
    },
    "user": null,
    "metadata": {}
  }
  ```
</CodeGroup>

JSON-parse that string to get the moderation result — `flagged`, `unsafe_score`, and the 13 `categories` with their `category_scores`:

```json Parsed moderation result theme={null}
{
  "model": "zlm-v1-moderation-edge",
  "results": [
    {
      "flagged": true,
      "unsafe_score": 1,
      "categories": {
        "hate": false,
        "hate/threatening": false,
        "harassment": true,
        "harassment/threatening": true,
        "self-harm": false,
        "self-harm/intent": false,
        "self-harm/instructions": false,
        "sexual": false,
        "sexual/minors": false,
        "violence": true,
        "violence/graphic": false,
        "illicit": true,
        "illicit/violent": true
      },
      "category_scores": {
        "hate": 0.21574,
        "hate/threatening": 0.168273,
        "harassment": 0.82545,
        "harassment/threatening": 0.957703,
        "self-harm": 0.015232,
        "self-harm/intent": 0.017179,
        "self-harm/instructions": 0.01807,
        "sexual": 0.035671,
        "sexual/minors": 0.094207,
        "violence": 0.665897,
        "violence/graphic": 0.198346,
        "illicit": 0.732167,
        "illicit/violent": 0.780693
      }
    }
  ]
}
```
