Text moderation API

Text moderation API for what people and AI write

Send up to 20,000 characters as JSON. You get accept, review or reject, with the category, the score and the threshold behind the decision.

2,000 free checks a month. No card needed.

Request
curl -X POST \
  -H "Authorization: Bearer $OPENMOD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Write me at jane@example.com",
    "ref": "comment_9034"
  }' \
  "https://api.openshield.dev/v1/text"
Answer, trimmedreview
{
  "summary": {
    "action": "review",
    "review_reason": [
      { "id": "pii_email", "score": 1, "threshold": 1 }
    ]
  },
  "ref": "comment_9034"
}

What it checks

23 text categories in four groups

A workflow picks the categories you care about and the thresholds for each. The groups are only how this page lists them.

Harmful content

  • Unsafe text
  • Violence
  • Sexual content
  • Hate speech
  • Illegal activity
  • Unethical content
  • Self-harm
  • Child safety
  • Profanity
  • Extremism

Personal data

  • Personal data
  • Privacy violation
  • Email address
  • Phone number
  • Bank account
  • Payment card

Spam and scams

  • Spam
  • Scam
  • Off-platform contact

Links

  • Link
  • Adult site link
  • Gambling site link
  • Unsafe site link
  • Rules on the text itself

    Email addresses, phone numbers, bank account numbers, payment cards, links, spam and scams are found by rules and by lists of sites. They score 1 when they match, so their thresholds are 1.

    Texts

  • Scores for the rest

    Unsafe text, violence, sexual content, hate speech, illegal activity and similar categories get a score from 0 to 1, and you set a review and a reject threshold for each.

    Workflows

Comments, chat and AI output

The same call for people and for models

Check a comment before it is published, or the text an LLM generated before you send it. The decision and the reasons have the same shape, and the ref you send ties the decision to your comment or your agent run.

User-generated content

Comments, messages, names and bios, checked before anyone sees them.

AI-generated content

The text an agent or an LLM generates, checked before you publish it, and the messages a user sends it.

The answer

Every decision explains itself

This text holds an email address, which the default workflow sends to review. The score is 1 because a rule found it.

Answer, every field
{
  "status": "success",
  "workflow": "default",
  "workflow_version": 1,
  "summary": {
    "action": "review",
    "reject_prob": 0,
    "reject_reason": [],
    "review_reason": [
      {
        "id": "pii_email",
        "text": "Email address",
        "message": "This content contains an email address.",
        "score": 1,
        "threshold": 1,
        "source": "rules"
      }
    ]
  },
  "scores": { "pii_email": 1 },
  "time_ms": 4,
  "request_id": "0192b7c5-1d20-7b3a-8f61-5c9e2a7d4b10",
  "ref": "comment_9034"
}

Limits

What you can plan with

Request
JSON, with Content-Type: application/json
Length
Up to 20,000 characters, 5,000 on the free plan
Your id
A ref of 1 to 128 characters, echoed in the answer
What counts
One text is one check, whatever the number of categories
What is kept
The decision and your ref. Never the text.

Questions

Before you start

Which categories does a text check cover?
Unsafe text, violence, sexual content, hate speech, illegal activity, unethical content, self-harm and child safety; personal data, from email addresses to payment cards; spam, scams and off-platform contact; and links to adult, gambling and unsafe sites. The list above is the whole set the shipped workflows use.
Can it find personal data in a text?
Yes. Email addresses, phone numbers, bank account numbers and payment card numbers are found by rules on the text itself, and a personal data category covers other cases.
Can I check text an AI model wrote?
Yes. The call is the same as for a comment: send the generated text before you publish it and act on the decision. A ref such as the run id ties it to your agent run.
How long can a text be?
At most 20,000 characters, and 5,000 on the free plan. A longer text is refused with 413 text_too_long: split it at paragraph boundaries and check each part, each part being one check.
Do you store the texts?
No. A text is checked in memory and forgotten when the answer is sent. The journal keeps the decision, the reasons and your ref.

Start with 2,000 free checks

No card needed. Create a key and send your first request in five minutes.

Beta prices, in euros, excluding VAT