Moderation

POST /api/v1/moderationsclassifies text against a provider's policy categories and hands back the scores. It decides nothing — what you do with a flag is yours.

Bash
curl https://mume.ai/api/v1/moderations \ -H "Authorization: Bearer $MUME_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "input": "…the text to classify…" }'

input is required and takes a string or an array of strings. modelis optional — omit it and the provider's default moderation model is used.

Response

JSON
{ "id": "modr_01H…", "model": "omni-moderation-latest", "results": [ { "flagged": false, "categories": { "violence": false, "self-harm": false, "…": false }, "category_scores": { "violence": 0.0004, "self-harm": 0.0001, "…": 0.0 } } ] }

One entry in results per item in input, in the same order.

Read the scores, not just the flag

flagged is the provider's threshold applied to category_scores, and that threshold was not chosen with your product in mind. A support inbox and a children's app want very different cut-offs, and both are better served by picking a number from the scores than by taking the boolean.

Where it belongs

Moderation is a check you run around a generation, not instead of one:

  • On input, before spending a completion on something you would refuse to answer anyway.
  • On output, before showing a model's reply to someone other than the person who asked for it.

It is not a jailbreak filter and will not tell you whether a prompt is trying to manipulate a model. It answers a narrower question — is this text in one of these categories — and answers it well.

Cost

Plain JSON in and out, with usage.cost in the response and the same 1:1 USD pass-through as everything else. Cheap enough to run on both ends of a conversation without thinking about it.

Related