curl -X POST 'https://api.inworld.ai/v1/moderations' \
-H 'Authorization: Bearer $INWORLD_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"input": "Hello world!"
}'{
"id": "modr-5cf388daeb3a41b9803fe73f4345a5c3",
"model": "inworld/moderation-latest",
"results": [
{
"flagged": false,
"categories": {
"sexual": false,
"sexual/minors": false,
"harassment": false,
"harassment/threatening": false,
"hate": false,
"hate/threatening": false,
"illicit": false,
"illicit/violent": false,
"self-harm": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"violence": false,
"violence/graphic": false
},
"category_scores": {
"sexual": 0,
"sexual/minors": 0,
"harassment": 0,
"harassment/threatening": 0,
"hate": 0,
"hate/threatening": 0,
"illicit": 0,
"illicit/violent": 0,
"self-harm": 0,
"self-harm/intent": 0,
"self-harm/instructions": 0,
"violence": 0,
"violence/graphic": 0
},
"category_applied_input_types": {
"sexual": [
"text"
],
"sexual/minors": [
"text"
],
"harassment": [
"text"
],
"harassment/threatening": [
"text"
],
"hate": [
"text"
],
"hate/threatening": [
"text"
],
"illicit": [
"text"
],
"illicit/violent": [
"text"
],
"self-harm": [
"text"
],
"self-harm/intent": [
"text"
],
"self-harm/instructions": [
"text"
],
"violence": [
"text"
],
"violence/graphic": [
"text"
]
},
"ailuminate": {
"safety": "safe",
"categories": {
"violent_crimes": false,
"sex_related_crimes": false,
"child_sexual_exploitation": false,
"suicide_self_harm": false,
"indiscriminate_weapons": false,
"intellectual_property": false,
"defamation": false,
"non_violent_crimes": false,
"hate": false,
"specialized_advice": false,
"privacy": false,
"sexual_content": false
},
"extensions": {
"politically_sensitive": false,
"unethical_acts": false,
"jailbreak": false
},
"refusal": false
}
}
]
}Moderation
Create moderation
Classify text inputs for harmful content
POST
/
v1
/
moderations
curl -X POST 'https://api.inworld.ai/v1/moderations' \
-H 'Authorization: Bearer $INWORLD_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"input": "Hello world!"
}'{
"id": "modr-5cf388daeb3a41b9803fe73f4345a5c3",
"model": "inworld/moderation-latest",
"results": [
{
"flagged": false,
"categories": {
"sexual": false,
"sexual/minors": false,
"harassment": false,
"harassment/threatening": false,
"hate": false,
"hate/threatening": false,
"illicit": false,
"illicit/violent": false,
"self-harm": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"violence": false,
"violence/graphic": false
},
"category_scores": {
"sexual": 0,
"sexual/minors": 0,
"harassment": 0,
"harassment/threatening": 0,
"hate": 0,
"hate/threatening": 0,
"illicit": 0,
"illicit/violent": 0,
"self-harm": 0,
"self-harm/intent": 0,
"self-harm/instructions": 0,
"violence": 0,
"violence/graphic": 0
},
"category_applied_input_types": {
"sexual": [
"text"
],
"sexual/minors": [
"text"
],
"harassment": [
"text"
],
"harassment/threatening": [
"text"
],
"hate": [
"text"
],
"hate/threatening": [
"text"
],
"illicit": [
"text"
],
"illicit/violent": [
"text"
],
"self-harm": [
"text"
],
"self-harm/intent": [
"text"
],
"self-harm/instructions": [
"text"
],
"violence": [
"text"
],
"violence/graphic": [
"text"
]
},
"ailuminate": {
"safety": "safe",
"categories": {
"violent_crimes": false,
"sex_related_crimes": false,
"child_sexual_exploitation": false,
"suicide_self_harm": false,
"indiscriminate_weapons": false,
"intellectual_property": false,
"defamation": false,
"non_violent_crimes": false,
"hate": false,
"specialized_advice": false,
"privacy": false,
"sexual_content": false
},
"extensions": {
"politically_sensitive": false,
"unethical_acts": false,
"jailbreak": false
},
"refusal": false
}
}
]
}Classifies one or more text inputs for harmful content. Schema-compatible with the OpenAI Moderations API — works with the OpenAI SDK.
The response includes standard OpenAI moderation categories as well as AILuminate safety classifications for more granular signals.
Authorizations
Your authentication credentials. Pass your API key as a Bearer token: Bearer $INWORLD_API_KEY. You can create a key in one command with the Inworld CLI: inworld workspace add-key.
Body
application/json
Was this page helpful?
⌘I