Unprofane
DocsBatch checks

Batch checks

Up to 100 texts in one request, each with its own id, answered in order. One bad item never fails the batch.

POST /v1/check/batch
{
  "items": [
    { "id": "a", "text": "Have a lovely day" },
    { "id": "b", "text": "f.u.c.k off", "policy": "kids" }
  ],
  "context": "comment",
  "policy": "standard"
}

Each item carries an id you choose and may override context and policy; mode, mask and engine are set once for the batch. Results come back in the same order:

{
  "results": [
    { "id": "a", "result": { "allowed": true, "action": "allow", "…": "…" } },
    { "id": "b", "result": { "allowed": false, "action": "block", "…": "…" } }
  ],
  "counted": 2
}

An item that fails validation on its own comes back as { "id", "error": { "type", "title", "detail" } } and the rest are answered. counted is what the batch cost against the allowance.

Up to four model calls run at a time inside a batch, so a batch of a hundred comments takes a few seconds in balanced mode, where the model reads every item the rules do not block outright; in fast mode the rules answer a batch of a hundred in one.