# Meta Demucs API

> Demucs by Meta separates a song into vocals, drums, bass, and other stems, plus guitar and piano with the 6-stem htdemucs_6s model, and returns each stem as its own audio file.

Source: https://www.sandbase.ai/models/meta/demucs
API reference: https://www.sandbase.ai/models/meta/demucs#api

## Facts

- Provider: Meta
- Type: Audio model
- Model ID: `meta/demucs`
- Price: From $0.04 per run
- Capabilities: audio to audio
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "meta/demucs",
  "audio": "https://static.sandbase.ai/examples/meta/demucs/input_audio_0.mp3",
  "output_format": "mp3",
  "separation_model": "htdemucs_6s"
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call Meta Demucs through SandBase?

Create a SandBase API key, then send requests with the model ID "meta/demucs" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate Meta account?

No. One SandBase API key and balance gives you access to Meta Demucs and the other models in the catalog; you do not need to sign up with Meta separately.

## README

### Demucs

Demucs by Meta splits a song into separate stems: vocals, drums, bass, and other, plus guitar and piano with `htdemucs_6s`.

#### Fields

| Field | Type | Default | Notes |
|---|---|---|---|
| `audio` | audio file or URL, required | — | Song to separate. |
| `separation_model` | `htdemucs` / `htdemucs_ft` / `htdemucs_6s` / `hdemucs_mmi` / `mdx` / `mdx_extra` / `mdx_q` / `mdx_extra_q` | `htdemucs_6s` | Demucs variant; `htdemucs_6s` adds guitar and piano. |
| `output_format` | `wav` / `mp3` | `mp3` | Format of each stem. |

#### Output

| Field | Notes |
|---|---|
| `url` | Vocals stem. |
| `drums_url` | Drums stem. |
| `bass_url` | Bass stem. |
| `other_url` | Everything else. |
| `guitar_url` | Guitar stem (`htdemucs_6s` only). |
| `piano_url` | Piano stem (`htdemucs_6s` only). |

#### Billing

$0.0007 per started second of input audio. The quote uses the measured audio length.

| Audio | Price |
|---|---|
| 1 min | $0.042 |
| 3 min | $0.126 |
| 10 min | $0.42 |

Failed runs are not charged.

#### Also on SandBase

Related: `meta/sam-audio/separate`.
