OhMyGPT
Moderations

Create moderation

POST
/v1/moderations

Classify text and images against the model's content policy categories, in the OpenAI Moderations format.

授权

ApiKeyAuth
headerAuthorization<token>

请求主体

application/json
  1. body
input*|array<>|array<|>

Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models.

model?|

The content moderation model you would like to use. Learn more in the moderation guide, and learn about available models here.

默认"omni-moderation-latest"

响应主体

Successful response

application/json
  1. response

Represents if a given text input is potentially harmful.

id*string

The unique identifier for the moderation request.

model*string

The model used to generate the moderation results.

results*array<>

A list of moderation objects.

示例请求
curl -X POST 'https://api.ohmygpt.com/v1/moderations' \  -H 'Content-Type: application/json' \  -d '{  "input": ""}'
示例响应
{  "id": "string",  "model": "string",  "results": [    {      "categories": {        "harassment": true,        "harassment/threatening": true,        "hate": true,        "hate/threatening": true,        "illicit": true,        "illicit/violent": true,        "self-harm": true,        "self-harm/instructions": true,        "self-harm/intent": true,        "sexual": true,        "sexual/minors": true,        "violence": true,        "violence/graphic": true      },      "category_applied_input_types": {        "harassment": [          "text"        ],        "harassment/threatening": [          "text"        ],        "hate": [          "text"        ],        "hate/threatening": [          "text"        ],        "illicit": [          "text"        ],        "illicit/violent": [          "text"        ],        "self-harm": [          "text"        ],        "self-harm/instructions": [          "text"        ],        "self-harm/intent": [          "text"        ],        "sexual": [          "text"        ],        "sexual/minors": [          "text"        ],        "violence": [          "text"        ],        "violence/graphic": [          "text"        ]      },      "category_scores": {        "harassment": 0,        "harassment/threatening": 0,        "hate": 0,        "hate/threatening": 0,        "illicit": 0,        "illicit/violent": 0,        "self-harm": 0,        "self-harm/instructions": 0,        "self-harm/intent": 0,        "sexual": 0,        "sexual/minors": 0,        "violence": 0,        "violence/graphic": 0      },      "flagged": true    }  ]}