Skip to content

OpenAI format

POST
/v1/moderations
curl --request POST \
--url https://api.mirapi.ai/v1/moderations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "input": [ "example" ], "model": "text-moderation-latest" }'

Checks whether the text violates the usage policy

Media typeapplication/json
object
input
required
One of:
string
model
string
Example
text-moderation-latest

Moderation result returned

Media typeapplication/json
object
id
string
model
string
results
Array<object>
object
flagged
boolean
categories
object
category_scores
object
Examplegenerated
{
"id": "example",
"model": "example",
"results": [
{
"flagged": true,
"categories": {},
"category_scores": {}
}
]
}