MODERATION
Base-Path:
https://api.hyprlab.io/v1
Moderation Path:
https://api.hyprlab.io/v1/moderations
Moderate Text Input:
curl https://api.hyprlab.io/v1/moderations \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HYPRLAB_API_KEY" \
-d '{
"model": "omni-moderation-latest",
"input": "...text to classify goes here..."
}'
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: "<HYPRLAB_API_KEY>",
baseURL: "https://api.hyprlab.io/v1",
});
const moderation = await openai.moderations.create({
model: "omni-moderation-latest",
input: "...text to classify goes here...",
});
console.log(moderation);
from openai import OpenAI
client = OpenAI(
api_key="<HYPRLAB_API_KEY>",
base_url="https://api.hyprlab.io/v1",
)
response = client.moderations.create(
model="omni-moderation-latest",
input="...text to classify goes here...",
)
print(response)
Moderate Image and Text:
curl https://api.hyprlab.io/v1/moderations \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HYPRLAB_API_KEY" \
-d '{
"model": "omni-moderation-latest",
"input": [
{ "type": "text", "text": "...text to classify goes here..." },
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.png"
}
}
]
}'
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: "<HYPRLAB_API_KEY>",
baseURL: "https://api.hyprlab.io/v1",
});
const moderation = await openai.moderations.create({
model: "omni-moderation-latest",
input: [
{ type: "text", text: "...text to classify goes here..." },
{
type: "image_url",
image_url: {
url: "https://example.com/image.png"
// can also use base64 encoded image URLs
// url: "data:image/jpeg;base64,abcdefg..."
}
}
],
});
console.log(moderation);
from openai import OpenAI
client = OpenAI(
api_key="<HYPRLAB_API_KEY>",
base_url="https://api.hyprlab.io/v1",
)
response = client.moderations.create(
model="omni-moderation-latest",
input=[
{"type": "text", "text": "...text to classify goes here..."},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.png",
# can also use base64 encoded image URLs
# "url": "data:image/jpeg;base64,abcdefg..."
}
},
],
)
print(response)
Moderation Models
Model Name:
Usage:
Max tokens:
omni-moderation-latest
Free-to-Use
32,768
omni-moderation-2024-09-26
Free-to-Use
32,768
text-moderation-latest
Free-to-Use
32,768
text-moderation-stable
Free-to-Use
32,768
text-moderation-007
Free-to-Use
32,768
Last updated