# Sieve (`sieve-1`): Toxicity detection

Insults, threats and slurs flagged in milliseconds.

Sieve scores a comment, chat message or review for toxicity, severe toxicity, insults, threats, obscenity, identity attacks and sexually explicit language. `flagged` is true when any of them crosses your threshold.

It also answers OpenAI-style requests at `/v1/moderations`, so moderation code you already have can point here.

- **Price:** $0.02 per 1,000 texts. One unit per text up to 2,000 characters; longer texts are split into 2,000-character chunks and each chunk is a unit.
- **Languages:** 15+ languages, strongest in English
- **Input:** A string, or an array of up to 64 strings to run as a batch.
- **Batch:** yes, up to 64 inputs per call
- **Status:** live
- **Built on:** [Horizon-Labs/multilingual-toxicity-small](https://huggingface.co/Horizon-Labs/multilingual-toxicity-small), Apache-2.0, 141M (mmBERT-small encoder)
- **Compatible endpoints:** POST /v1/moderations (OpenAI)

## Request

```bash
curl https://labs.greatwork.company/v1/run \
  -H "Authorization: Bearer $GWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"sieve-1","input":"You're a complete idiot and everyone here knows it."}'
```

## Options

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `input` | string or string[] | yes | | A string, or an array of up to 64 strings to run as a batch. |
| `threshold` | number | no | `0.5` | Score at or above which a label counts as flagged (non-English text scores lower; try 0.35 for multilingual communities). |

## Output

| Field | Type | Description |
|---|---|---|
| `flagged` | boolean | True when any label is at or above `threshold`. |
| `labels` | string[] | Labels at or above `threshold`. |
| `scores` | object | toxicity, severe_toxicity, obscene, threat, insult, identity_attack, sexual_explicit, each 0 to 1. |

The response envelope is always `{"id", "object": "run", "model", "created", "output", "usage": {"units", "unit", "cost_usd", "cost_micros"}, "latency_ms"}`. With an array input, `output` is an array in the same order.

## Examples (real outputs from our servers)

### Insult

```json
{
  "model": "sieve-1",
  "input": "You're a complete idiot and everyone here knows it."
}
```

```json
{
  "flagged": true,
  "labels": [
    "toxicity",
    "insult"
  ],
  "scores": {
    "toxicity": 0.9095,
    "severe_toxicity": 0.0412,
    "obscene": 0.1594,
    "threat": 0.0045,
    "insult": 0.9069,
    "identity_attack": 0.0133,
    "sexual_explicit": 0.0032
  }
}
```

38 ms, $0.00002.

### Heated but fine

```json
{
  "model": "sieve-1",
  "input": "This patch notes update is a disaster, who signed off on removing the old map?"
}
```

```json
{
  "flagged": false,
  "labels": [],
  "scores": {
    "toxicity": 0.0548,
    "severe_toxicity": 0.0019,
    "obscene": 0.0043,
    "threat": 0.0037,
    "insult": 0.0403,
    "identity_attack": 0.002,
    "sexual_explicit": 0.0009
  }
}
```

37 ms, $0.00002.

### Batch

```json
{
  "model": "sieve-1",
  "input": [
    "Great stream tonight!",
    "nobody wants you here, just leave",
    "the ref was blind today lol"
  ]
}
```

```json
[
  {
    "flagged": false,
    "labels": [],
    "scores": {
      "toxicity": 0.0098,
      "severe_toxicity": 0.001,
      "obscene": 0.0014,
      "threat": 0.003,
      "insult": 0.0042,
      "identity_attack": 0.0008,
      "sexual_explicit": 0.0037
    }
  },
  {
    "flagged": false,
    "labels": [],
    "scores": {
      "toxicity": 0.0867,
      "severe_toxicity": 0.0024,
      "obscene": 0.0027,
      "threat": 0.0068,
      "insult": 0.0562,
      "identity_attack": 0.0072,
      "sexual_explicit": 0.0013
    }
  },
  {
    "flagged": false,
    "labels": [],
    "scores": {
      "toxicity": 0.0558,
      "severe_toxicity": 0.0028,
      "obscene": 0.0036,
      "threat": 0.003,
      "insult": 0.0374,
      "identity_attack": 0.0027,
      "sexual_explicit": 0.0031
    }
  }
]
```

71 ms, $0.00006.

## Good for

- Hold toxic comments for review
- Score chat in a game or community
- Clean a dataset before training
- Warn users before they post

## Limits and caveats

- Can over-flag texts that mention identity groups without attacking them.
- Weaker on low-resource languages (Amharic, Arabic).
- For policy categories like self-harm, weapons or fraud, use Warden.
