Analyze prosody
Analyze emotional expression from speech audio.
This endpoint requires authentication. Include your API key in the Authorization header. This is
an async job-based endpoint. Submit audio, then poll for results.
How It Works
- Submit audio via
POST /v1/prosody— returns ajob_id - Poll status via
GET /v1/prosody/{job_id}— returnsqueued,in_progress,completed, orfailed - Retrieve results via
GET /v1/prosody/{job_id}/result— returns 5 emotion metrics
Request Body (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
file | binary | Yes | Audio file (WAV, MP3, OGG, FLAC, WebM) |
model | valsea-prosody | Yes | |
language | string | No | BCP-47 language hint (e.g. "en", "zh") |
granularity | word | sentence | utterance | No | Default: utterance |
response_format | json | verbose_json | No | Default: json |
Code Examples
curl -X POST https://api.valsea.ai/v1/prosody \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=valsea-prosody" \
-F "file=@audio.wav"
Response
Submit Response (202)
| Field | Type | Description |
|---|---|---|
job_id | string | Unique job identifier |
status | string | queued |
Minimal (json)
| Field | Type | Description |
|---|---|---|
job_id | string | |
status | string | completed |
emotions.frustration | number | Frustration score (0-1) |
emotions.stress | number | Stress score (0-1) |
emotions.politeness | number | Politeness score (0-1) |
emotions.hesitation | number | Hesitation score (0-1) |
emotions.urgency | number | Urgency score (0-1) |
Verbose (verbose_json)
Includes all fields from the minimal response, plus:
| Field | Type | Description |
|---|---|---|
raw_predictions | array | Raw expression scores per utterance |
raw_predictions[].text | string | Utterance text |
raw_predictions[].time.begin | number | Start time (seconds) |
raw_predictions[].time.end | number | End time (seconds) |
raw_predictions[].emotions | array | All 48 expression scores |
Errors
| Status | Description |
|---|---|
401 | Missing or invalid API key |
402 | Insufficient credits |
404 | Job not found or expired |
409 | Job not yet completed |
503 | Service not configured |