Emotion API • Preview
Serena’s emotional engine,
explained for builders.
The SerenaChat API turns raw text into a 7-dimensional affective vector and a hierarchical emotion label. This page sketches how developers will integrate Serena into their own products.
Quickstart
Mock exampleA minimal example of how Serena’s HTTP API will look. This mirrors what the Emotion Playground is already doing under the hood.
Request
POST https://serenachat.com/api/serena
Content-Type: application/json
Authorization: Bearer <api_key>
{
"text": "I am feeling strangely hopeful today."
}
Response
{
"vector": [-0.12, 0.65, -0.03, -0.14, 0.78, -0.09, 0.12],
"classification": {
"primary": "Positive",
"secondary": "Hopeful",
"tertiary": "Quiet optimism"
},
"meta": {
"model_version": "Serena v2.2",
"latency_ms": 42
}
}
Authentication
In the public beta, SerenaChat will use bearer tokens
passed via the Authorization header.
- • Free tier: for experimentation, tied to individual accounts.
- • Team & enterprise: organisation-scoped keys with usage dashboards.
Key management (rotation, revocation, environment-specific keys) will live in the future Serena Studio portal.
Endpoints
POST /api/serena
Core analysis endpoint
Accepts plain text and returns Serena’s 7D emotion vector plus hierarchical labels.
{
"text": "User message to analyse",
"session_id": "optional-conversation-id",
"metadata": {
"source": "web-playground",
"language": "en"
}
}
GET /api/status
Health & version
Lightweight status endpoint for uptime checks and model version tracking.
Planned rate limits
These numbers are indicative and help size infrastructure and pricing.
- Playground
- Up to 60 req / min
- Developer (beta)
- Up to 600 req / min
- Enterprise
- Custom
Error model
Serena returns structured errors so clients can react deterministically.
{
"error": {
"code": 429,
"type": "rate_limit_exceeded",
"message": "Too many requests. Try again later."
}
}
- • 400 – invalid request
- • 401 – missing / invalid API key
- • 429 – rate limit exceeded
- • 500 – transient engine failure