# Mood (`mood-1`): Emotion detection

28 emotions, plus the six basic ones, in one call.

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.

- **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:** 35+ 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-emotions-small](https://huggingface.co/Horizon-Labs/multilingual-emotions-small), Apache-2.0, 141M (mmBERT-small encoder)

## Request

```bash
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!"}'
```

## 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. |
| `all` | boolean | no | `false` | Return scores for all 28 labels, not just the detected ones. |

## Output

| Field | Type | Description |
|---|---|---|
| `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`). |

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)

### Grateful

```json
{
  "model": "mood-1",
  "input": "Thank you so much for staying late to fix this, you saved our launch!"
}
```

```json
{
  "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
  }
}
```

52 ms, $0.00002.

### Confused

```json
{
  "model": "mood-1",
  "input": "Wait, so do I need to reinstall it or just log out? The docs say both."
}
```

```json
{
  "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
  }
}
```

40 ms, $0.00002.

### Annoyed

```json
{
  "model": "mood-1",
  "input": "Why does this app ask me to update every single time I open it?"
}
```

```json
{
  "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
  }
}
```

34 ms, $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.
