Moderations
The Moderations API provides OpenAI-compatible content safety checks for user-generated or model-generated text.
Moderations
Evaluate text input against common safety categories such as hate, harassment, self-harm, sexual content, and violence.
https://api.dgrid.ai
POST
/v1/moderationsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
input | string or array | Yes | Text content to moderate. |
model | string | No | Moderation model such as text-moderation-latest or text-moderation-stable. |
Response Body
| Field | Type | Description |
|---|---|---|
id | string | Moderation request ID. |
model | string | Model used for moderation. |
results | array | Moderation result entries. |
results[].flagged | boolean | Whether the input was flagged. |
results[].categories | object | Boolean category decisions. |
results[].categories.hate | boolean | Hate speech flag. |
results[].categories.hate/threatening | boolean | Threatening hate speech flag. |
results[].categories.harassment | boolean | Harassment flag. |
results[].categories.self-harm | boolean | Self-harm flag. |
results[].categories.sexual | boolean | Sexual content flag. |
results[].categories.violence | boolean | Violence flag. |
results[].category_scores | object | Continuous scores for each category. |
