Skip to content
kenari.

Moderations

kenari provides a moderations endpoint compatible with OpenAI Moderations. This endpoint only serves models marked as moderation models in the catalog. Calling it with an ordinary chat model returns status 400.

Status: not yet available as of 29 July 2026

Section titled “Status: not yet available as of 29 July 2026”

No moderation model is currently sold in the public catalog. GET /v1/models?modality=moderation returns an empty list right now, and POST /v1/moderations rejects every request until at least one moderation model is active. Watch the catalog (the Models page), or call GET /v1/models?modality=moderation, to see when an id appears.

The endpoint contract below still applies: once the catalog ships a moderation model, the request and response shape match OpenAI Moderations exactly.

POST /v1/moderations

Send input and model, and the gateway returns a classification result for each input text: whether the content is flagged, plus per-category details and scores.

FieldTypeRequiredDescription
modelstringyesModeration model id from the catalog. None are sold yet. See the note above.
inputstring or array of stringsyesA single text, or several texts at once in one array.

Billing is calculated per input token, from the total character count across input (roughly four characters per token, rounded up), then deducted from the Rupiah balance. Moderation models are free by default, following OpenAI’s own moderations endpoint convention. An operator may set a paid rate for a specific model in the catalog. See Billing for balance and deduction details.

The response follows the OpenAI Moderations shape: model echoes the model id you requested (never the provider’s internal name), and the results array holds one entry per input with flagged, categories, and category_scores. The example below uses the sample id moderation-model-id. The real id ships with the first catalogued moderation model.

{
"id": "modr-...",
"model": "moderation-model-id",
"results": [
{
"flagged": false,
"categories": { "harassment": false, "hate": false },
"category_scores": { "harassment": 0.001, "hate": 0.0002 }
}
]
}

The examples below use the sample id moderation-model-id. Replace it with whatever id GET /v1/models?modality=moderation returns once the catalog has at least one moderation model. Until then the endpoint returns 400.

Terminal window
curl https://kenari.id/v1/moderations \
-H "Authorization: Bearer kn-..." \
-H "Content-Type: application/json" \
-d '{"model":"moderation-model-id","input":"text to check"}'
from openai import OpenAI
client = OpenAI(
base_url="https://kenari.id/v1",
api_key="kn-...",
)
result = client.moderations.create(
model="moderation-model-id",
input="text to check",
)
print(result.results[0].flagged)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://kenari.id/v1",
apiKey: "kn-...",
});
const result = await client.moderations.create({
model: "moderation-model-id",
input: "text to check",
});
console.log(result.results[0].flagged);