Moderations
Classifies whether a piece of text contains harmful/inappropriate content. Useful for filtering user input.
POST/v1/moderations
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | ✓ | Moderation model |
input | string | array | ✓ | Text 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 }
}
]
}| Field | Description |
|---|---|
results[].flagged | Whether the content was flagged (true/false) |
results[].categories | Violation per category |
results[].category_scores | Scores per category |
WARNING
Moderation response fields depend on the provider model used. Verify your model's exact output by testing.