---
title: "Extract stems from an audio file or URL"
method: POST
path: "/v2/Extraction"
---

# Extract stems from an audio file or URL

`POST /v2/Extraction`

## Request

- Base URL: `https://api.musicgpt.com/api/public`
- URL: `https://api.musicgpt.com/api/public/v2/Extraction`
- Auth: API key in header `Authorization`

Process an audio file to extract specified stems (vocals, instrumental, or other components) with optional preprocessing. Supports file upload or URL with webhook callback.

## Request body `multipart/form-data`

- union
  - object
    - `audio_url` string, required: Input audio URL (supported format: YouTube URL).
    - `audio_file` string, binary: Audio file to upload and process.
    - `stems` string: JSON string list of required output stems. Available options: vocals, instrumental, male_vocal, female_vocal, lead_vocal, back_vocal, bass, drums, guitar, piano, keys, strings, winds, rhythm_guitar, solo_guitar, acoustic_guitar, electric_guitar, kick_drum, snare_drum, toms, hi_hat, ride, crash.
    - `preprocessing_options` string: JSON string list of preprocessing steps. Available options: Denoise, Deecho, Dereverb.
    - `eco_mode` boolean: Enable eco mode for faster parallel extraction.
    - `webhook_url` string: Callback URL for async processing.
  - object
    - `audio_url` string: Input audio URL (supported format: YouTube URL).
    - `audio_file` string, binary, required: Audio file to upload and process.
    - `stems` string: JSON string list of required output stems. Available options: vocals, instrumental, male_vocal, female_vocal, lead_vocal, back_vocal, bass, drums, guitar, piano, keys, strings, winds, rhythm_guitar, solo_guitar, acoustic_guitar, electric_guitar, kick_drum, snare_drum, toms, hi_hat, ride, crash.
    - `preprocessing_options` string: JSON string list of preprocessing steps. Available options: Denoise, Deecho, Dereverb.
    - `eco_mode` boolean: Enable eco mode for faster parallel extraction.
    - `webhook_url` string: Callback URL for async processing.

## Response `200`

Successfully initiated audio extraction

- object
  - `success` boolean
  - `task_id` string
  - `conversion_id` string
  - `eta` integer: Time in seconds to completion. -1 if unknown
  - `credit_estimate` number, float: Estimated credit cost

## Other responses

- `422`: Validation Error
- `500`: Server Error

---

[API](https://skmtc.dev/musicgpt/apis/musicgpt-api.md) - [All operations](https://skmtc.dev/musicgpt/apis/musicgpt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/musicgpt/apis/musicgpt-api/revisions/6753dccf4c5d?raw)
