Skip to main content
POST
Create moderation
Send text as 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

x-api-key
string
header
required

Your ZeroGPU API key. Create one in the dashboard under API keys. Send it on every request.

Headers

x-project-id
string

Optional project identifier. Scopes the request to a specific project when provided.

Body

application/json
input
required

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.

Minimum string length: 1
model
string
default:zlm-v1-moderation-edge

Moderation model to use. Defaults to the configured moderation model; OpenAI ids (omni-moderation-latest, text-moderation-stable) are accepted and mapped to it.

Example:

"zlm-v1-moderation-edge"

Response

Success

OpenAI-compatible moderations envelope. One results entry per input.

id
string

Unique identifier for the moderation request.

Example:

"modr-0a1b2c3d4e5f60718293a4b5c6d7e8f90"

model
string

The model used for classification.

Example:

"zlm-v1-moderation-edge"

results
object[]

Moderation verdicts, one per input (a string input yields a single-element array).