API reference
Moderations
POST /v1/moderations — classify input for policy categories.
POST
/v1/moderations
Classifies input text (and some multimodal payloads when supported) against moderation categories.
Request
| Field | Type | Required | Notes |
|---|---|---|---|
input | string or array | Yes | Text to classify. Pass an array for multiple strings. |
model | string | No | A safety/moderation model id from your catalog, e.g. Nemotron-3.5-Content-Safety. |
Response (shape)
The categories and scores returned are specific to the safety model. The example below shows the OpenAI-compatible shape.
{
"id": "modr-example",
"model": "Nemotron-3.5-Content-Safety",
"results": [
{
"flagged": false,
"categories": {
"hate": false,
"hate/threatening": false,
"harassment": false,
"harassment/threatening": false,
"self-harm": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"sexual": false,
"sexual/minors": false,
"violence": false,
"violence/graphic": false
},
"category_scores": {
"hate": 0.000012,
"harassment": 0.000034,
"violence": 0.000021
}
}
]
}Errors
400 invalid input; 401 auth; 429 throttling.
Example
curl -sS --request "POST" \
--url "$MYT_BASE_URL/moderations" \
--header "Authorization: Bearer $MYT_API_KEY" \
--header "Content-Type: application/json" \
--data '{"model":"Nemotron-3.5-Content-Safety","input":"Hello world"}'