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.
Use it
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"
}'const res = await fetch("https://labs.greatwork.company/v1/run", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GWL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"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"
}),
});
const { output, usage } = await res.json();import os, requests
res = requests.post(
"https://labs.greatwork.company/v1/run",
headers={"Authorization": f"Bearer {os.environ['GWL_API_KEY']}"},
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"
},
)
output = res.json()["output"]Set GWL_API_KEY to a key from your dashboard. The bare name bait works too and follows new versions.
Options
input: The message text (string or array of up to 64). Subject and body together work best.
| Name | Type | Default | What it does |
|---|---|---|---|
threshold | number | 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 | Meaning |
|---|---|---|
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. |
Every response wraps this in {"id", "model", "output", "usage": {"units", "unit", "cost_usd"}, "latency_ms"}. Send an array as input and output is an array in the same order.
Examples
Smishing
{
"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"
}{
"label": "fraud",
"unwanted": 0.9998,
"flagged": true,
"scores": {
"legitimate": 0.0002,
"spam": 0.0002,
"fraud": 0.9996
}
}Captured on our production servers: 175 ms, 1 text, $0.00004.
Real message
{
"model": "bait-1",
"input": "Hey, are we still on for lunch Thursday? I can do 12:30 at the usual place."
}{
"label": "legitimate",
"unwanted": 0,
"flagged": false,
"scores": {
"legitimate": 1,
"spam": 0,
"fraud": 0
}
}Captured on our production servers: 105 ms, 1 text, $0.00004.
Spam
{
"model": "bait-1",
"input": "LIMITED TIME!!! Get 80% off designer watches, today only. Click here to claim your discount."
}{
"label": "spam",
"unwanted": 0.9933,
"flagged": true,
"scores": {
"legitimate": 0.0067,
"spam": 0.9633,
"fraud": 0.0299
}
}Captured on our production servers: 98 ms, 1 text, $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.
Pricing
$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. Failed calls aren't charged, and a call never costs more than its estimate (POST /v1/estimate tells you before you run it).
Built on
Horizon-Labs/phishing-scam-detector-base, 307M (mmBERT-base encoder) parameters. License: Apache-2.0. We run it on our servers with our own long-text chunking and score aggregation.