-
Notifications
You must be signed in to change notification settings - Fork 0
ToolsModeration
Ondrej Rafaj edited this page Oct 31, 2025
·
1 revision
- Endpoint Group: Tools / Diagnostics
- Purpose: Run ad-hoc moderation checks against OpenAI text and Gemini image classifiers.
- Availability: Requires membership of the internal super user team.
| Method | Path | Description |
|---|---|---|
POST |
/tools/moderation/evaluate |
Submit text and/or image content for moderation. |
-
Authorization: Bearer <token>— caller must belong to a team withrole = 'su'. Other users receive403 Forbidden.
-
text(string, optional) — text to evaluate viaomni-moderation-latest. -
image(object, optional) — data URI payload for Gemini Flash-Lite image moderation.-
base64(string, required) — Base64-encoded image bytes. -
mime(string, optional) — MIME type, defaults toimage/png.
-
At least one of text or image must be supplied.
{
"result": {
"results": [
{
"flagged": false,
"categories": {
"sexual": false,
"violence": true,
"hate": false,
"self-harm": false,
"harassment/threatening": false
},
"confidence": {
"sexual": 0.11,
"violence": 0.86,
"hate": 0.04,
"self-harm": 0.02,
"harassment/threatening": 0.05
}
}
]
},
"checked": {
"text": true,
"image": true
}
}-
result.resultsmatches the OpenAI moderation schema and includes combined text/image outcomes. -
confidencecarries provider scores (0.0–1.0) for each category. -
checkedindicates which content types were evaluated for this request.
| Status | Body Example | When It Happens |
|---|---|---|
400 Bad Request |
{ "message": "Invalid request", "issues": { … } } |
Payload failed validation (neither text nor image provided, malformed image, etc.). |
401 Unauthorized |
{ "message": "Unauthorized" } |
Missing or invalid bearer token. |
403 Forbidden |
{ "message": "Forbidden" } |
Caller is not a super user. |
502 Bad Gateway |
{ "message": "Moderation providers are unavailable", "detail": "…" } |
Upstream moderation provider returned an error or timed out. |
{ "text": "New label copy for review…", "image": { "base64": "<base64-encoded image payload>", "mime": "image/png" } }