How moderation works

What happens between your request and the outcome: screening, hybrid inference, and failover.

Each moderation request passes through the same pipeline. Knowing the stages helps you interpret evaluatedBy, latencyMs, and failures.

The request pipeline

  1. Protect. Per-IP rate and concurrency limits are applied.
  2. Authenticate. The X-Api-Key header identifies your workspace, and your workspace rate limit is applied.
  3. Validate. content and language are checked. Invalid requests are rejected without charge.
  4. Screen. Messages with nothing to moderate are answered immediately, and recent identical messages reuse their earlier result.
  5. Reserve credits. The message's cost — one credit per started 2,000 characters on paid plans, or 1,000 on Free — is reserved atomically from your allowance.
  6. Evaluate. The message is classified by the inference route that best fits it, with automatic failover.
  7. Apply your policy. Your review and rejection thresholds turn scores into an outcome.
  8. Respond. You receive the structured result.

Screening

Screening happens before any model call and is reported in evaluatedBy:

evaluatedBy What happened
Prefilter A server rule recognized a message with nothing to moderate, such as a short courtesy phrase.
Cache You sent an identical message recently, and that model result was reused. Cached results are never shared between workspaces.
Model A moderation model evaluated the message.

Screening only ever allows content outright; anything doubtful goes to a model. Your thresholds still apply to every result, including cached ones. Clients should ignore unknown evaluatedBy values, as more may be added.

Hybrid inference

Clusterbot combines dedicated moderation models, self-hosted models, and cloud models, and chooses a route for each message:

  • Language-aware routing. The route depends on the message, including its language. When you know the language, send it in language: a non-English code always ensures multilingual evaluation.
  • Automatic failover. If a provider times out, returns an error, or produces an invalid answer, another eligible provider is tried.
  • Consistent categories. Every route reports the same category keys, so your integration doesn't change when the route does.

Routing is entirely server-managed. You can't select a provider or model in the request, and you're charged the same credits no matter how many providers were tried.

Latency

latencyMs measures the screening and inference pipeline, including any failover attempts. It excludes network time between you and Clusterbot, and the credit reservation. Prefiltered and cached results are typically fastest.

Set a client timeout of at least 30 seconds. Requests that need failover take longer than usual.

When evaluation fails

If no provider produces a valid result, the API returns 503 with code provider_unavailable, and the reserved credits are restored. Clusterbot never converts a failure into an unflagged result — treat a 503 as "unknown", not "safe". See Errors for retry guidance.

Questions about this guide? Contact us or try requests in the playground.