LOLAI 开发者平台

内容审核(Moderations)

OpenAI 兼容的文本审核,原样透传上游结果(flagged / categories / category_scores)。

生产环境POSThttps://api.lolai.lol/v1/moderations
需要 OpenAI 式审核上游(如 omni-moderation-*)—— 中文厂商(火山 / 阿里)暂无等价审核接口。端点已就绪,接上有该渠道的上游即可用。

请求参数

Body 参数application/json
modelstring必填
审核模型。
示例:omni-moderation-latest
inputstring | string[]必填
待审核文本,单条或数组。
示例:需要审核的文本

响应

原样透传上游(OpenAI 形态):results[].flagged + categories + category_scores。审核多为免费或极低价。

请求与响应体

用下面的示例确认请求格式与返回结构。需要在线发起请求时,点击页面顶部「调试」拉起在线运行面板。

bash
curl https://api.lolai.lol/v1/moderations \
  -H "Authorization: Bearer sk-lolai-xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-moderation-latest",
    "input": "需要审核的文本"
  }'
响应 · 200
{
  "id": "modr-...",
  "model": "omni-moderation-latest",
  "results": [
    { "flagged": true,
      "categories": { "violence": true, "hate": false },
      "category_scores": { "violence": 0.91 } }
  ]
}