Emotion Detection

Detect categorical emotions in text — currently broken upstream

Designed to classify text into emotion categories (joy, sadness, anger, fear, surprise, disgust, etc.). The Pydantic schema accepts a texts array of strings; however the upstream handler currently iterates `texts.items()` (treating it as a dict) and therefore raises before producing a result. Both the legacy `text` (string) form and the documented `texts` (array) form fail. Until the upstream is patched, this endpoint returns `status:error` for every call. The gateway does not bill failed calls, so probing the endpoint costs nothing.

textanalysisnlp

Overview

Features

Status: broken

Upstream raises 'list object has no attribute items' on every valid request. No bill on failure.

Intended capability

Categorical emotion scoring (joy, sadness, anger, fear, surprise, disgust, …) with a top label.

Auth

Standard CN8 Gateway auth — apk_ key with text-emotion in allowed_services.

Pricing (when fixed)

$0.002 per request.

Use Cases

Support prioritization

Flag angry or frustrated customers for faster response.

Content analysis

Measure emotional tone across reviews, social posts, or survey responses.

Input / Output

Input

texts: array<string> (per Pydantic schema)

JSON body

Output

Currently always status:error from upstream

JSON

Specs

Latency
n/a — broken
Async
false
Rate Limit
Per API key
Max Input
n/a — broken

Quickstart

Prerequisites

  • -A CN8 Gateway API key with text-emotion in allowed_services

1. Submit (currently fails)

text-emotion

POST a texts array. The upstream is broken and will return an error envelope. Documented for completeness; do not depend on this endpoint until the changelog says it is fixed.

POST/v1/proxy/text-emotion
{
  "texts": ["I am so happy and excited!"]
}

Response

{
  "status": "error",
  "data": {
    "detail": "'list' object has no attribute 'items'"
  },
  "gateway": {
    "service": "text-emotion"
  },
  "cost": { "units": 0.0, "tokens": 0.0 },
  "message": "Upstream service error"
}

Failed calls are not billed (worker drop-on-error rule).

Emotion Detection

POSTsync

Categorical emotion classifier — currently non-functional at upstream.

/v1/proxy/text-emotion

Pricing

Billed per request when functional. No charge for failed calls today.

ServiceUnitPrice
Emotion Detectionitem$0.002/request
  • -Endpoint is currently non-functional — no charges incurred while broken.

Guides & Tips

What's broken and what to do

  • -The Pydantic schema declares `texts: list[str]`. The handler then calls `.items()` on it, which is invalid for a list.
  • -All probed shapes (texts as list-of-strings, list-of-dicts, dict, single string) fail at one of the two layers.
  • -As long as the gateway returns `status:error`, no credit is deducted (worker drop-on-error rule).
  • -Workaround: combine Sentiment Analysis (polarity / stars) with Zero-Shot Classification using emotion labels you control — see the related links below.

Combining with Sentiment (workaround)

  • -Send the same text to text-sentiment for polarity (positive/neutral/negative).
  • -Send it to text-classify with emotion labels (e.g. ["joy","sadness","anger","fear","surprise","disgust"]) for categorical fallback.

FAQ

Q: Should I use this endpoint?

A: Not today. Use the Sentiment + Zero-Shot Classification workaround above until the changelog confirms the upstream is fixed.

Q: Will I be billed for the broken calls?

A: No. The gateway's worker drops billing for upstream-error responses.

Related Products

Changelog

1.2 (2026-04-29)

  • -Documented the upstream breakage: handler calls .items() on a list. Every valid call returns status:error.
  • -Confirmed no charge on failure (gateway worker drop-on-error rule).
  • -Added Sentiment + Zero-Shot Classification workaround.

1.1 (2026-02-23)

  • -Aligned with emotion_detector prose (now superseded — endpoint did not match docs).

1.0 (2026-01-26)

  • -Initial catalog.