Prefer Swagger UI? Click hereThe same API in the classic OpenAPI explorer.
POST/v1/moderations

Moderations

Classify text against safety policies. This endpoint is free (it meters at $0), so you can run it inline before or after a chat call without worrying about cost. For automatic screening on chat itself, use the moderation parameter on /v1/chat/completions instead of calling this directly.

Request
HTTP
POST
URL
/v1/moderations
Auth
api_key, client_token
Try it
curl https://api.fightclub.pro/v1/moderations \
  -H "Authorization: Bearer $FC_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":"is this safe?"}'
# => { "id":"modr_...", "model":"omni-moderation-latest",
#      "results":[{"flagged":false,"categories":{...},"category_scores":{...}}] }

Example response

{
  "id": "modr_3aB",
  "model": "omni-moderation-latest",
  "results": [
    {
      "flagged": false,
      "categories": { "hate": false, "violence": false, "sexual": false, "self-harm": false },
      "category_scores": { "hate": 0.0001, "violence": 0.0003, "sexual": 0.0, "self-harm": 0.0001 }
    }
  ]
}

A representative 200 body. Ids and timestamps are illustrative.

Body parameters

NameTypeDefaultDescription
input*string | string[]One string, or an array of strings to classify. Each is scored independently.
modelstringomni-moderation-latestModeration model. Pass another to override the default.
userstringoptionalOpaque end-user id passed through to the provider.

* required.

Response fields

NameTypeDescription
idstringModeration request id.
modelstringThe moderation model that ran.
resultsarrayOne per input: { flagged, categories, category_scores }. categories are booleans (e.g. hate, violence, sexual); category_scores are 0-1 confidences.

Errors

  • 401missing_tokenNo Authorization header was sent.
  • 401invalid_auth_schemeThe scheme was neither Bearer nor Client.
  • 401invalid_token_formatA Bearer token not prefixed ko_.
  • 401invalid_tokenThe API key is unknown, revoked or expired.
  • 403insufficient_scopeThe key is valid but lacks the required scope.
  • 400invalid_jsonBody is not valid JSON.
  • 400missing_inputinput is absent.

See the full error reference.

Notes

  • ·Moderation calls cost $0 and do not draw down your wallet.
  • ·flagged is the overall verdict; branch on it. category_scores give you per-category confidences if you want a stricter or looser custom threshold.