需要 OpenAI 风格的审核上游(如 omni-moderation-*)。部分国内厂商暂无等价审核接口;端点已就绪,接入支持该能力的上游后即可使用。
请求参数
Body 参数application/json
modelstring必填审核模型。
示例:
<moderation-model>inputstring | string[]必填待审核文本,可传单条字符串或字符串数组。
示例:
需要审核的文本响应
响应保持 OpenAI 结构,包含 results[].flagged、categories 和 category_scores。审核通常免费或价格极低。
请求与响应体
用下面的示例确认请求格式与返回结构。需要在线发起请求时,点击页面顶部“调试”拉起在线运行面板。
bash
curl https://zerofa.ai/v1/moderations \
-H "Authorization: Bearer sk-zerofa-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "<moderation-model>",
"input": "需要审核的文本"
}'响应 · 200
{
"id": "modr-...",
"model": "<moderation-model>",
"results": [
{ "flagged": true,
"categories": { "violence": true, "hate": false },
"category_scores": { "violence": 0.91 } }
]
}