AI & LLM

Content Moderation Response JSON Example

A JSON example of a content moderation API response — flagged status, per-category booleans, and confidence scores. Copy-ready for OpenAI moderation and trust & safety pipelines.

{
  "id": "modr-9Kd2Lm4Qp",
  "model": "omni-moderation-latest",
  "results": [
    {
      "flagged": false,
      "categories": {
        "harassment": false,
        "hate": false,
        "self-harm": false,
        "sexual": false,
        "violence": false
      },
      "category_scores": {
        "harassment": 0.0004,
        "hate": 0.0001,
        "self-harm": 0.00002,
        "sexual": 0.0003,
        "violence": 0.0007
      }
    }
  ]
}

Field Reference

results[].flaggedrequiredbooleanTrue if any category exceeded its threshold — the headline decision
results[].categoriesrequiredobjectPer-category boolean flags indicating which policies were violated
results[].category_scoresrequiredobjectPer-category confidence scores (0–1); higher means more likely a violation
modelrequiredstringModeration model used to score the content

Variants

Flagged contentA response where the input violated a policy.
{
  "results": [
    {
      "flagged": true,
      "categories": {
        "harassment": true,
        "hate": false,
        "violence": false
      },
      "category_scores": {
        "harassment": 0.97,
        "hate": 0.12,
        "violence": 0.05
      }
    }
  ]
}

Common Use Cases

  • Screening user-generated content before it's published or sent to an LLM
  • Building trust & safety pipelines with auditable decisions
  • Setting custom thresholds per category for your risk tolerance
moderationcontent moderationtrust and safetyopenaisafetyai

Validate or format this JSON

One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.

Frequently Asked Questions

flagged uses provider default thresholds, which may be stricter or looser than your policy. For production, inspect category_scores and apply your own thresholds per category so you can tune precision vs. recall for your specific audience and risk tolerance.

Moderate both inputs (before sending user text to an LLM, to block prompt abuse) and outputs (before showing model responses to users). Log decisions and scores for auditing and appeals, and avoid storing flagged content longer than necessary.

Related JSON Examples