# Audio

Tell vocal tracks from instrumentals.

Paths start at `$ACTIVQC_BASE_URL`, and every call sends `Authorization: Bearer $ACTIVQC_KEY`. Errors use the [error envelope](https://activqc.wavbee.com/docs/errors.md). [All endpoints](https://activqc.wavbee.com/docs/api-reference.md).

## POST /v1/audio/classifications

Tell vocal tracks from instrumentals.

Classifies 1 to 20 tracks as `vocal` or `instrumental`. Each track's audio is a public HTTPS URL or a builder upload. The answer is measured, not guessed: an excerpt of the track is split into stems and the vocal stem's level is compared with the mix (`vocal_level_db`). Between the two thresholds the answer comes with `confidence: low`. Runs in the background: wait for the `audio.classification.completed` webhook, or ask `GET /v1/audio/classifications/{id}`. Each track answered counts in your usage.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

Send an `Idempotency-Key` header (a new UUID per operation; a retry reuses it).

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `Idempotency-Key` | header | string | **Required.** A unique string per operation, for example a UUID. A retry with the same key returns the first answer. Missing: 422. |

#### Request body

`application/json`.

| Field | Type | Description |
|---|---|---|
| `tracks` | array of object | **Required.** 1 to 20 tracks |
| `tracks[].track_id` | string | Your id for the track, echoed back |
| `tracks[].audio` | object | **Required.** |
| `tracks[].audio.url` | string (uri) |  |
| `tracks[].audio.upload_id` | string |  |

#### Example request

```bash
curl -s -X POST "$ACTIVQC_BASE_URL/v1/audio/classifications" \
  -H "Authorization: Bearer $ACTIVQC_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "tracks": [
    {
      "audio": {}
    }
  ]
}'
```

#### Responses

| Status | Meaning |
|---|---|
| `202` | Queued. |
| `422` | No tracks, more than 20, or a track with no audio. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |

#### Response `202`

| Field | Type | Description |
|---|---|---|
| `id` | string | **Required.** Example `ac_9fK2mX`. |
| `object` | string | **Required.** Always `audio.classification`. |
| `status` | string | **Required.** One of `queued`, `running`, `completed`, `partial`, `failed`. |
| `livemode` | boolean | **Required.** |
| `created_at` | string (date-time) | **Required.** |
| `completed_at` | string (date-time) or null |  |
| `tracks` | array of object | **Required.** |
| `tracks[].track_id` | string |  |
| `tracks[].status` | string | One of `queued`, `running`, `completed`, `failed`. |
| `tracks[].classification` | string or null | One of `vocal`, `instrumental`. |
| `tracks[].vocal_level_db` | number or null | The separated vocal stem's mean level against the mix, in dB |
| `tracks[].confidence` | string or null | One of `high`, `low`. |
| `tracks[].error` | string or null |  |

```json
{
  "id": "ac_9fK2mX",
  "object": "audio.classification",
  "status": "queued",
  "livemode": false,
  "created_at": "2026-11-24T10:00:00Z",
  "completed_at": "2026-11-24T10:00:00Z",
  "tracks": [
    {
      "track_id": "string",
      "status": "queued",
      "classification": "vocal",
      "vocal_level_db": 1.0,
      "confidence": "high",
      "error": "string"
    }
  ]
}
```

## GET /v1/audio/classifications/{id}

Where a classification has got to.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string | **Required.** |

#### Example request

```bash
curl -s "$ACTIVQC_BASE_URL/v1/audio/classifications/{id}" \
  -H "Authorization: Bearer $ACTIVQC_KEY"
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | The batch, with each track's answer so far. |
| `404` | Not this tenant's. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `id` | string | **Required.** Example `ac_9fK2mX`. |
| `object` | string | **Required.** Always `audio.classification`. |
| `status` | string | **Required.** One of `queued`, `running`, `completed`, `partial`, `failed`. |
| `livemode` | boolean | **Required.** |
| `created_at` | string (date-time) | **Required.** |
| `completed_at` | string (date-time) or null |  |
| `tracks` | array of object | **Required.** |
| `tracks[].track_id` | string |  |
| `tracks[].status` | string | One of `queued`, `running`, `completed`, `failed`. |
| `tracks[].classification` | string or null | One of `vocal`, `instrumental`. |
| `tracks[].vocal_level_db` | number or null | The separated vocal stem's mean level against the mix, in dB |
| `tracks[].confidence` | string or null | One of `high`, `low`. |
| `tracks[].error` | string or null |  |

```json
{
  "id": "ac_9fK2mX",
  "object": "audio.classification",
  "status": "queued",
  "livemode": false,
  "created_at": "2026-11-24T10:00:00Z",
  "completed_at": "2026-11-24T10:00:00Z",
  "tracks": [
    {
      "track_id": "string",
      "status": "queued",
      "classification": "vocal",
      "vocal_level_db": 1.0,
      "confidence": "high",
      "error": "string"
    }
  ]
}
```

