Mood finds the emotions in a text: gratitude, annoyance, confusion, curiosity, joy and 23 more. Each label has its own tuned threshold, so emotions lists only the ones that are really there.
It also rolls them up into the six basic emotions (anger, disgust, fear, joy, sadness, surprise) for dashboards that don't need 28 colors.
Use it
curl https://labs.greatwork.company/v1/run \
-H "Authorization: Bearer $GWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mood-1",
"input": "Thank you so much for staying late to fix this, you saved our launch!"
}'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": "mood-1",
"input": "Thank you so much for staying late to fix this, you saved our launch!"
}),
});
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": "mood-1",
"input": "Thank you so much for staying late to fix this, you saved our launch!"
},
)
output = res.json()["output"]Set GWL_API_KEY to a key from your dashboard. The bare name mood works too and follows new versions.
Options
input: A string, or an array of up to 64 strings to run as a batch.
| Name | Type | Default | What it does |
|---|---|---|---|
all | boolean | false | Return scores for all 28 labels, not just the detected ones. |
Output
| Field | Type | Meaning |
|---|---|---|
emotions | object[] | Detected emotions (score above the label's tuned threshold), strongest first: label, score. |
top | string | The strongest emotion, neutral when nothing stands out. |
basic | object | Scores for the six basic emotions: anger, disgust, fear, joy, sadness, surprise. |
scores | object | All 28 scores (only with all: true). |
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
Grateful
{
"model": "mood-1",
"input": "Thank you so much for staying late to fix this, you saved our launch!"
}{
"emotions": [
{
"label": "gratitude",
"score": 0.994
}
],
"top": "gratitude",
"basic": {
"anger": 0.0037,
"disgust": 0,
"fear": 0,
"joy": 0.994,
"sadness": 0.0007,
"surprise": 0.0064
}
}Captured on our production servers: 52 ms, 1 text, $0.00002.
Confused
{
"model": "mood-1",
"input": "Wait, so do I need to reinstall it or just log out? The docs say both."
}{
"emotions": [
{
"label": "confusion",
"score": 0.9003
}
],
"top": "confusion",
"basic": {
"anger": 0.0023,
"disgust": 0.0001,
"fear": 0,
"joy": 0.0052,
"sadness": 0.0001,
"surprise": 0.9003
}
}Captured on our production servers: 40 ms, 1 text, $0.00002.
Annoyed
{
"model": "mood-1",
"input": "Why does this app ask me to update every single time I open it?"
}{
"emotions": [
{
"label": "curiosity",
"score": 0.3158
},
{
"label": "annoyance",
"score": 0.1842
},
{
"label": "confusion",
"score": 0.1819
}
],
"top": "curiosity",
"basic": {
"anger": 0.1842,
"disgust": 0.0005,
"fear": 0.0001,
"joy": 0.0028,
"sadness": 0.0069,
"surprise": 0.3158
}
}Captured on our production servers: 34 ms, 1 text, $0.00002.
Good for
- Find confused users in onboarding feedback
- Spot grateful customers to ask for a review
- Add emotion filters to a social listening tool
- Pick a reply tone for a support macro
Limits and caveats
- Grief, relief and disappointment are the weakest labels.
- Scores are much lower in languages it wasn't trained on.
Pricing
$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. 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/multilingual-emotions-small, 141M (mmBERT-small encoder) parameters. License: Apache-2.0. We run it on our servers with our own long-text chunking and score aggregation.