# Bait (`bait-1`): Phishing, scam and spam detection

Is this message a scam, spam or the real thing?

Bait reads an email, SMS or chat message and scores it as legitimate, spam or fraud (phishing, smishing, fake invoices, prize and job scams). `unwanted` adds spam and fraud together for a single filter score.

Raise the threshold if you're filtering a busy inbox: automated notices like delivery updates and one-time codes are where false alarms happen.

- **Price:** $0.04 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:** Multilingual, tested on 21+ languages
- **Input:** The message text (string or array of up to 64). Subject and body together work best.
- **Batch:** yes, up to 64 inputs per call
- **Status:** live
- **Built on:** [Horizon-Labs/phishing-scam-detector-base](https://huggingface.co/Horizon-Labs/phishing-scam-detector-base), Apache-2.0, 307M (mmBERT-base encoder)

## Request

```bash
curl https://labs.greatwork.company/v1/run \
  -H "Authorization: Bearer $GWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"bait-1","input":"USPS: Your package is on hold due to an unpaid $1.99 shipping fee. Pay now to avoid return: usps-redeliver-help.co/pay"}'
```

## Options

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `input` | string or string[] | yes | | The message text (string or array of up to 64). Subject and body together work best. |
| `threshold` | number | no | `0.5` | Score at or above which a message counts as unwanted (raise to 0.8 or 0.9 for fewer false alarms). |

## Output

| Field | Type | Description |
|---|---|---|
| `label` | string | `legitimate`, `spam` or `fraud`. |
| `unwanted` | number | P(spam) + P(fraud), 0 to 1. |
| `flagged` | boolean | True when `unwanted` is at or above `threshold`. |
| `scores` | object | legitimate, spam, fraud. |

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)

### Smishing

```json
{
  "model": "bait-1",
  "input": "USPS: Your package is on hold due to an unpaid $1.99 shipping fee. Pay now to avoid return: usps-redeliver-help.co/pay"
}
```

```json
{
  "label": "fraud",
  "unwanted": 0.9998,
  "flagged": true,
  "scores": {
    "legitimate": 0.0002,
    "spam": 0.0002,
    "fraud": 0.9996
  }
}
```

175 ms, $0.00004.

### Real message

```json
{
  "model": "bait-1",
  "input": "Hey, are we still on for lunch Thursday? I can do 12:30 at the usual place."
}
```

```json
{
  "label": "legitimate",
  "unwanted": 0,
  "flagged": false,
  "scores": {
    "legitimate": 1,
    "spam": 0,
    "fraud": 0
  }
}
```

105 ms, $0.00004.

### Spam

```json
{
  "model": "bait-1",
  "input": "LIMITED TIME!!! Get 80% off designer watches, today only. Click here to claim your discount."
}
```

```json
{
  "label": "spam",
  "unwanted": 0.9933,
  "flagged": true,
  "scores": {
    "legitimate": 0.0067,
    "spam": 0.9633,
    "fraud": 0.0299
  }
}
```

98 ms, $0.00004.

## Good for

- Filter scam DMs on a marketplace
- Warn users about suspicious SMS
- Score inbound leads for spam
- Triage abuse reports

## Limits and caveats

- Reads the text only: no sender, links or headers.
- Genuine automated messages (bank alerts, codes, parcel tracking) are often flagged at 0.5.
- Telling spam from fraud is less reliable than telling wanted from unwanted.
