Skip to content

Moderations

Classifies whether a piece of text contains harmful/inappropriate content. Useful for filtering user input.

POST/v1/moderations

Request parameters

FieldTypeRequiredDescription
modelstringModeration model
inputstring | arrayText to classify

Example

bash
curl https://app.qevron.ai/v1/moderations \
  -H "Authorization: Bearer $QEVRON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-moderation-latest",
    "input": "Text to classify goes here."
  }'
python
resp = client.moderations.create(
    model="text-moderation-latest",
    input="Text to classify goes here.",
)
print(resp.results[0].flagged)

Response

The response may vary by provider; in the OpenAI-compatible shape it typically looks like:

json
{
  "id": "modr-...",
  "model": "text-moderation-latest",
  "results": [
    {
      "flagged": false,
      "categories": { "hate": false, "violence": false, "...": false },
      "category_scores": { "hate": 0.0001, "violence": 0.0002 }
    }
  ]
}
FieldDescription
results[].flaggedWhether the content was flagged (true/false)
results[].categoriesViolation per category
results[].category_scoresScores per category

WARNING

Moderation response fields depend on the provider model used. Verify your model's exact output by testing.

Qevron — AI gateway. Arpanet / OpenAI / Anthropic / Gemini compatible.