Body Required
model string
Any of: Two content moderations models are available:
text-moderation-stable
andtext-moderation-latest
.The default is
text-moderation-latest
which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you usetext-moderation-stable
, we will provide advanced notice before updating the model. Accuracy oftext-moderation-stable
may be slightly lower than fortext-moderation-latest
.Default value is
text-moderation-latest
.Two content moderations models are available:
text-moderation-stable
andtext-moderation-latest
.The default is
text-moderation-latest
which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you usetext-moderation-stable
, we will provide advanced notice before updating the model. Accuracy oftext-moderation-stable
may be slightly lower than fortext-moderation-latest
.Values are
text-moderation-latest
ortext-moderation-stable
. Default value istext-moderation-latest
.
curl \
-X POST https://api.openai.com/v1/moderations \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"input":"I want to kill them.","model":"text-moderation-stable"}'
{
"input": "I want to kill them.",
"model": "text-moderation-stable"
}
{
"id": "string",
"model": "string",
"results": [
{
"flagged": true,
"categories": {
"hate": true,
"hate/threatening": true,
"harassment": true,
"harassment/threatening": true,
"self-harm": true,
"self-harm/intent": true,
"self-harm/instructions": true,
"sexual": true,
"sexual/minors": true,
"violence": true,
"violence/graphic": true
},
"category_scores": {
"hate": 42.0,
"hate/threatening": 42.0,
"harassment": 42.0,
"harassment/threatening": 42.0,
"self-harm": 42.0,
"self-harm/intent": 42.0,
"self-harm/instructions": 42.0,
"sexual": 42.0,
"sexual/minors": 42.0,
"violence": 42.0,
"violence/graphic": 42.0
}
}
]
}