Moderations
curl --request POST \
--url https://openp.ai/v1/moderationsimport requests
url = "https://openp.ai/v1/moderations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://openp.ai/v1/moderations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openp.ai/v1/moderations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/v1/moderations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openp.ai/v1/moderations")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/moderations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOpenAI-compatible
Moderations
POST /v1/moderations — OpenAI content-safety classification
POST
/
v1
/
moderations
Moderations
curl --request POST \
--url https://openp.ai/v1/moderationsimport requests
url = "https://openp.ai/v1/moderations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://openp.ai/v1/moderations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openp.ai/v1/moderations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/v1/moderations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openp.ai/v1/moderations")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/moderations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyScore text (or images) across several content categories, returning a flag and score for each category.
Request
curl https://openp.ai/v1/moderations \
-H "Authorization: Bearer $OPENPAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "omni-moderation-latest",
"input": "I want to hurt myself."
}'
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | omni-moderation-latest (recommended) or text-moderation-latest | |
input | string | array | ✅ | The text to check, or a multimodal array (the omni model supports images) |
Response
{
"id": "modr-...",
"model": "omni-moderation-latest",
"results": [
{
"flagged": true,
"categories": {
"self-harm": true,
"self-harm/intent": true,
"violence": false,
"sexual": false
},
"category_scores": {
"self-harm": 0.94,
"self-harm/intent": 0.91,
"violence": 0.01
}
}
]
}
flagged: true means any category was triggered.
Multimodal (image) input
{
"model": "omni-moderation-latest",
"input": [
{"type": "text", "text": "Look at this image"},
{"type": "image_url", "image_url": {"url": "https://..."}}
]
}
Categories
| Category | Meaning |
|---|---|
sexual | Sexual content |
sexual/minors | Involving minors |
harassment | Harassment |
harassment/threatening | Threatening harassment |
hate | Hate |
hate/threatening | Threatening hate |
illicit | Illicit behavior |
illicit/violent | Violent illicit |
self-harm | Self-harm |
self-harm/intent | Self-harm intent |
self-harm/instructions | Self-harm instructions |
violence | Violence |
violence/graphic | Graphic violence |