Tools – Moderation Testing
-
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 with role = 'su'. Other users receive 403 Forbidden.
POST /tools/moderation/evaluate
-
text (string, optional) — text to evaluate via omni-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 to image/png.
At least one of text or image must be supplied.
-
result.results matches the OpenAI moderation schema and includes combined text/image outcomes.
-
confidence carries provider scores (0.0–1.0) for each category.
-
checked indicates 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" } }