curl --request POST \
--url https://api.zerogpu.ai/v1/moderations \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"input": "I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next."
}
'import requests
url = "https://api.zerogpu.ai/v1/moderations"
payload = { "input": "I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next." }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: 'I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next.'
})
};
fetch('https://api.zerogpu.ai/v1/moderations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/moderations"
payload := strings.NewReader("{\n \"input\": \"I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/moderations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "modr-0a1b2c3d4e5f60718293a4b5c6d7e8f90",
"model": "zlm-v1-moderation-edge",
"results": [
{
"flagged": true,
"categories": {
"harassment": true,
"harassment/threatening": true,
"hate": false,
"hate/threatening": false,
"illicit": true,
"illicit/violent": true,
"self-harm": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"sexual": false,
"sexual/minors": false,
"violence": true,
"violence/graphic": false
},
"category_scores": {
"harassment": 0.82545,
"harassment/threatening": 0.957703,
"hate": 0.21574,
"hate/threatening": 0.168273,
"illicit": 0.732167,
"illicit/violent": 0.780693,
"self-harm": 0.015232,
"self-harm/intent": 0.017179,
"self-harm/instructions": 0.01807,
"sexual": 0.035671,
"sexual/minors": 0.094207,
"violence": 0.665897,
"violence/graphic": 0.198346
},
"category_applied_input_types": {
"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"
],
"sexual": [
"text"
],
"sexual/minors": [
"text"
],
"violence": [
"text"
],
"violence/graphic": [
"text"
]
}
}
]
}{
"error": {
"code": "insufficient_quota",
"message": "You have insufficient quota to complete this request."
}
}Moderations
Classify text against OpenAI’s safety categories.
curl --request POST \
--url https://api.zerogpu.ai/v1/moderations \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"input": "I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next."
}
'import requests
url = "https://api.zerogpu.ai/v1/moderations"
payload = { "input": "I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next." }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: 'I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next.'
})
};
fetch('https://api.zerogpu.ai/v1/moderations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/moderations"
payload := strings.NewReader("{\n \"input\": \"I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/moderations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "modr-0a1b2c3d4e5f60718293a4b5c6d7e8f90",
"model": "zlm-v1-moderation-edge",
"results": [
{
"flagged": true,
"categories": {
"harassment": true,
"harassment/threatening": true,
"hate": false,
"hate/threatening": false,
"illicit": true,
"illicit/violent": true,
"self-harm": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"sexual": false,
"sexual/minors": false,
"violence": true,
"violence/graphic": false
},
"category_scores": {
"harassment": 0.82545,
"harassment/threatening": 0.957703,
"hate": 0.21574,
"hate/threatening": 0.168273,
"illicit": 0.732167,
"illicit/violent": 0.780693,
"self-harm": 0.015232,
"self-harm/intent": 0.017179,
"self-harm/instructions": 0.01807,
"sexual": 0.035671,
"sexual/minors": 0.094207,
"violence": 0.665897,
"violence/graphic": 0.198346
},
"category_applied_input_types": {
"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"
],
"sexual": [
"text"
],
"sexual/minors": [
"text"
],
"violence": [
"text"
],
"violence/graphic": [
"text"
]
}
}
]
}{
"error": {
"code": "insufficient_quota",
"message": "You have insufficient quota to complete this request."
}
}input and get back OpenAI’s moderations envelope: an id, the resolved model, and a results array with per-category booleans (categories) and confidence scores (category_scores) across all 13 safety categories. It is drop-in compatible with OpenAI’s Moderations API — OpenAI model ids (omni-moderation-latest, text-moderation-stable) are accepted and mapped. See the Moderation guide for a prefilled example, or the model page for an interactive playground.
Moderation models are routable only on this endpoint — a /responses or /chat/completions call with a moderation model returns 400. Pass input as a string, an array of strings (one result per element), or an array of { "type": "text", "text": "…" } content parts forming one multi-modal input.
Install the official SDK from npm or PyPI (pip install zerogpu-api). Source: zerogpu/SDK. Handle errors the same way as API error codes.Authorizations
Your ZeroGPU API key. Create one in the dashboard under API keys. Send it on every request.
Headers
Optional project identifier. Scopes the request to a specific project when provided.
Body
Text to classify. A single string, an array of strings (one result per element), or an array of content parts ({ "type": "text", "text": "..." }) forming one multi-modal input.
1Moderation model to use. Defaults to the configured moderation model; OpenAI ids (omni-moderation-latest, text-moderation-stable) are accepted and mapped to it.
"zlm-v1-moderation-edge"
Response
Success
OpenAI-compatible moderations envelope. One results entry per input.
Unique identifier for the moderation request.
"modr-0a1b2c3d4e5f60718293a4b5c6d7e8f90"
The model used for classification.
"zlm-v1-moderation-edge"
Moderation verdicts, one per input (a string input yields a single-element array).
Hide child attributes
Hide child attributes
True when the model flagged the input in one or more categories.
true
Per-category boolean verdicts. All 13 categories are always present, in OpenAI's order.
Hide child attributes
Hide child attributes
Content that expresses, incites, or promotes harassing language towards any target.
true
Harassment that also includes violence or serious harm towards any target.
true
Content that expresses, incites, or promotes hate based on a protected attribute.
false
Hateful content that also includes violence or serious harm towards a protected group.
false
Content that gives advice or instruction on how to commit a wrongdoing.
false
Illicit content that also references violence or procuring a weapon.
false
Content that promotes, encourages, or depicts acts of self-harm.
false
Content where the speaker expresses that they are engaging or intend to engage in self-harm.
false
Content that provides instructions or advice on how to commit acts of self-harm.
false
Content meant to arouse sexual excitement or that promotes sexual services.
false
Sexual content that includes an individual under 18 years old.
false
Content that depicts death, violence, or physical injury.
true
Content that depicts death, violence, or physical injury in graphic detail.
false
Per-category confidence scores in [0, 1]. All 13 categories are always present, in OpenAI's order.
Hide child attributes
Hide child attributes
Confidence score for harassment.
0.9412
Confidence score for harassment/threatening.
0.9016
Confidence score for hate.
0.0231
Confidence score for hate/threatening.
0.0104
Confidence score for illicit.
0.0057
Confidence score for illicit/violent.
0.0039
Confidence score for self-harm.
0.0021
Confidence score for self-harm/intent.
0.0012
Confidence score for self-harm/instructions.
0.0008
Confidence score for sexual.
0.0006
Confidence score for sexual/minors.
0.0002
Confidence score for violence.
0.8774
Confidence score for violence/graphic.
0.0311
Which input modality triggered each category. This is a text-only model, so every category maps to ["text"].
Hide child attributes
Hide child attributes
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]
["text"]

