This endpoint requires an OpenAI-style moderation upstream such as omni-moderation-*. Some regional providers do not offer an equivalent moderation API. The endpoint is ready once a capable upstream is connected.
Request parameters
Body parametersapplication/json
modelstringRequiredThe moderation model.
Example:
<moderation-model>inputstring | string[]RequiredText to moderate, as one string or an array of strings.
Example:
Text that needs moderationResponse
The response keeps the OpenAI structure with results[].flagged, categories, and category_scores. Moderation is usually free or very inexpensive.
Request and response bodies
Use the examples below to verify the request and response structures. To send a request, select Debug at the top of the page.
bash
curl https://zerofa.ai/v1/moderations \
-H "Authorization: Bearer sk-zerofa-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "<moderation-model>",
"input": "Text that needs moderation"
}'Response · 200
{
"id": "modr-...",
"model": "<moderation-model>",
"results": [
{ "flagged": true,
"categories": { "violence": true, "hate": false },
"category_scores": { "violence": 0.91 } }
]
}