---
title: "Detect emotion in an audio file"
method: POST
path: "/api/velma-2-emotion-batch"
---

# Detect emotion in an audio file

`POST /api/velma-2-emotion-batch`

Analyze an audio file and return a whole-file emotion label plus a
per-window emotion time series.

## Response `200`

Emotion detection completed successfully

- EmotionResponse
  - `emotion` string, required — The emotion label for the whole file. Always present and non-null.
  - `time_series` EmotionWindow[], required — Consecutive fixed-length windows over the file, each with its own emotion label. Empty when the file is shorter than one window.
    - `start_ms` integer, required — Start of this window in milliseconds from the beginning of the file.
    - `duration_ms` integer, required — Length of this window in milliseconds.
    - `emotion` string, required — The emotion label for this window.

## Other responses

- `400` — Bad request - The submitted audio was rejected: an unsupported file extension, an empty file, or audio that could not be processed (for example, corrupted data or content that does not match a supported format).
- `403` — Forbidden - the request is not permitted
- `422` — Unprocessable Entity - a required request field is missing or malformed (for example, the `X-API-Key` header or the `upload_file` part).
- `429` — Too many requests - the request could not be completed due to insufficient credits
- `500` — Internal server error
- `502` — Bad gateway - the request could not be validated or completed

---

[API](https://skmtc.dev/modulate/apis/velma-2-accent-batch-api.md) · [All operations](https://skmtc.dev/modulate/apis/velma-2-accent-batch-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/modulate/velma-2-accent-batch-api/revisions/b4c9ce648efa/schema)
