OpenAI文档
  1. 审查(Moderations)
OpenAI文档
  • 介绍
  • 项目说明
  • 身份验证
  • 发出请求
  • 聊天(Chat)
    • 聊天响应示例
    • 聊天流式响应示例
    • 创建聊天
      POST
    • 图像识别
      POST
  • 自动补全(Completions)
    • 完成对象
    • 创建完成
      POST
  • 音频(Audio)
    • 创建语音
      POST
    • 创建转录
      POST
    • 创建翻译
      POST
  • 嵌入(Embeddings)
    • 嵌入对象
    • 创建嵌入
      POST
  • 图像(Images)
    • README
    • 图像对象
    • 创建图像
      POST
  • 模型(Models)
    • 模型对象
    • 列出模型
      GET
  • 审查(Moderations)
    • 调节对象
    • 创建内容审核
      POST
  1. 审查(Moderations)

创建内容审核

POST
/v1/moderations
对文本是否违反 OpenAI 的内容政策进行分类

请求参数

Header 参数

Body 参数application/json

示例
{
    "model": "omni-moderation-latest",
    "input": [
      { "type": "text", "text": "...text to classify goes here..." },
      {
        "type": "image_url",
        "image_url": {
          "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
        }
      }
    ]
  }

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.prolzy.cn/v1/moderations' \
--header 'Authorization: Bearer sk-eB62ArlcQrsCeEB7olrS5cIWIMkQJDZM4LHBFYzk4cUyCboB' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "omni-moderation-latest",
    "input": [
      { "type": "text", "text": "...text to classify goes here..." },
      {
        "type": "image_url",
        "image_url": {
          "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
        }
      }
    ]
  }'

返回响应

🟢200Create moderation
application/json
Body

示例
{
    "id": "modr-5MWoLO",
    "model": "text-moderation-001",
    "results": [
        {
            "categories": {
                "hate": false,
                "hate/threatening": true,
                "self-harm": false,
                "sexual": false,
                "sexual/minors": false,
                "violence": true,
                "violence/graphic": false
            },
            "category_scores": {
                "hate": 0.22714105248451233,
                "hate/threatening": 0.4132447838783264,
                "self-harm": 0.005232391878962517,
                "sexual": 0.01407341007143259,
                "sexual/minors": 0.0038522258400917053,
                "violence": 0.9223177433013916,
                "violence/graphic": 0.036865197122097015
            },
            "flagged": true
        }
    ]
}
修改于 2025-03-16 12:12:12
上一页
调节对象
Built with