---
title: "FFT spectrum bins + band energies"
method: POST
path: "/v1/mixlab/spectrum"
tags: ["MixLab"]
---

# FFT spectrum bins + band energies

`POST /v1/mixlab/spectrum`

## Request

- Base URL: `https://audiolab.tools`
- URL: `https://audiolab.tools/v1/mixlab/spectrum`
- Auth: HTTP bearer

Returns paired frequency/magnitude arrays plus 7-band energies and spectral
descriptors (centroid, rolloff, flatness). For spectrum-analyzer UIs and
tonal-balance diagnosis beyond the harshness/muddiness labels.

## Request body

- object
  - `url` string, uri
  - `objectPath` string: Path returned by /api/upload-url, for audio that has no public URL. Readable only by the key that uploaded it, and kept for about an hour so a follow-up question about the same file does not need a re-upload.

## Response `200`

Spectrum data complete.

- SpectrumResult: FFT spectrum bins plus band energies and spectral descriptors.
  - `sampleRate` integer, required
  - `spectralCentroidHz` number
  - `spectralRolloffHz` number
  - `spectralFlatness` number
  - `bandEnergy` Band, required: Spectral band energies (relative).
    - `sub` number
    - `bass` number
    - `lowMid` number
    - `mid` number
    - `highMid` number
    - `presence` number
    - `air` number
  - `spectrum` object, required
    - `freqs` number[]
    - `mags` number[]
    - `count` integer

## Other responses

- `400`: Malformed request, a URL we could not use, or a parameter that is not valid. Codes: url_not_allowed, url_fetch_failed, invalid_json, missing_input, invalid_parameter, batch_too_large, upload_not_found.
- `401`: Invalid or revoked API key. /v1/batch and /v1/usage always need a key; the analysis routes also run without one, as a small keyless trial. Codes: invalid_api_key.
- `402`: A limit of your plan was reached: the calls or the data of the month, or a preset that needs a paid plan. The body carries usage where it applies. Codes: quota_exceeded, data_quota_exceeded, profile_requires_paid_plan, voice_minutes_exhausted.
- `413`: File too large for the route, or a recording too long to decode. Codes: file_too_large, track_too_long.
- `429`: Too many requests this minute. See Retry-After. Codes: rate_limited.
- `500`: Something went wrong on our side. The details are logged and never sent to you. Codes: storage_unavailable, analysis_error.

---

[API](https://skmtc.dev/audiolab/apis/audiolab-api.md) · [All operations](https://skmtc.dev/audiolab/apis/audiolab-api/llms.txt) · [OpenAPI document](https://skmtc.dev/audiolab/apis/audiolab-api/revisions/69ff81f4f4ba?raw)
