> ## Documentation Index
> Fetch the complete documentation index at: https://help.soundverse.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stem Separation API - v1

This endpoint allows users to **separate audio stems** from a provided track using AI.

***

#### Stem Separation API Overview

> The Stem Separation API by Soundverse allows you to extract specific parts (or "stems") of a song such as:

* Vocals

* Instruments

* All individual stems (vocals, drums, bass, etc.)

> This is useful for remixing, karaoke creation, music analysis, or background score extraction.

***

#### **Core Parameters**

> 🛈 The parameters below define the request body for this API.

| Parameter      | Type     | Required?  | Description                  |
| -------------- | -------- | ---------- | ---------------------------- |
| **`audioUrl`** | `string` | ✅ Required | URL to the input audio file. |

***

#### **Request Body**

<div className="bg-gray-100 dark:bg-gray-800 p-3 rounded-md">
  ```
  Request body: 
  {
    "audioUrl": "string"
  }
  ```
</div>

***

#### Code Samples

* **Python code sample**

<Tabs>
  <Tab title="Vocals">
    ```python theme={null}
      import requests

      url = "https://api.soundverse.ai/v1/generate/stem-separation/vocals"
      headers = {
          "Authorization": "Bearer your_api_key_here",
          "Content-Type": "application/json"
      }
      payload = {
        "audioUrl": "string"
      }

      response = requests.post(url, json=payload, headers=headers)
      print(response.json())
    ```
  </Tab>

  <Tab title="Instruments">
    ```python theme={null}
      import requests

      url = "https://api.soundverse.ai/v1/generate/stem-separation/instruments"
      headers = {
          "Authorization": "Bearer your_api_key_here",
          "Content-Type": "application/json"
      }
      payload = {
        "audioUrl": "string"
      }

      response = requests.post(url, json=payload, headers=headers)
      print(response.json())
    ```
  </Tab>

  <Tab title="All Stems">
    ```python theme={null}
      import requests

      url = "https://api.soundverse.ai/v1/generate/stem-separation/all-stems"
      headers = {
          "Authorization": "Bearer your_api_key_here",
          "Content-Type": "application/json"
      }
      payload = {
        "audioUrl": "string"
      }

      response = requests.post(url, json=payload, headers=headers)
      print(response.json())
    ```
  </Tab>
</Tabs>

* **cURL**

<Tabs>
  <Tab title="Vocals">
    ```sh theme={null}
        curl -X POST "https://api.soundverse.ai/v1/generate/stem-separation/vocals" \
        -H "Authorization: Bearer your_api_key_here" \
        -H "Content-Type: application/json" \
        -d '{
        "audioUrl": "string"
        }'
    ```
  </Tab>

  <Tab title="Instruments">
    ```sh theme={null}
        curl -X POST "https://api.soundverse.ai/v1/generate/stem-separation/instruments" \
        -H "Authorization: Bearer your_api_key_here" \
        -H "Content-Type: application/json" \
        -d '{
        "audioUrl": "string"
        }'
    ```
  </Tab>

  <Tab title="All Stems">
    ```sh theme={null}
        curl -X POST "https://api.soundverse.ai/v1/generate/stem-separation/all-stems" \
        -H "Authorization: Bearer your_api_key_here" \
        -H "Content-Type: application/json" \
        -d '{
        "audioUrl": "string"
        }'
    ```
  </Tab>
</Tabs>

#### Response

<Tabs>
  <Tab title="Vocals">
    ```sh theme={null}
    [
      {
      "audioName": "vocals",
      "audioUrl": "str"
      }
    ]
    ```
  </Tab>

  <Tab title="Instruments">
    ```sh theme={null}
      [
        {
          "audioName": "Guitar",
          "audioUrl": "str"
        },
        {
          "audioName": "Other",
          "audioUrl": "str"
        },
        {
          "audioName": "Drums",
          "audioUrl": "str"
        },
        {
          "audioName": "Bass",
          "audioUrl": "str"
        },
        {
          "audioName": "Piano",
          "audioUrl": "str",
        }
      ]
    ```
  </Tab>

  <Tab title="All Stems">
    ```sh theme={null}
        [
          {
            "audioName": "vocals",
            "audioUrl": "str"
          },
          {
            "audioName": "Guitar",
            "audioUrl": "str"
          },
          {
            "audioName": "Other",
            "audioUrl": "str"
          },
          {
            "audioName": "Drums",
            "audioUrl": "str"
          },
          {
            "audioName": "Bass",
            "audioUrl": "str"
          },
          {
            "audioName": "Piano",
            "audioUrl": "str",
          }
        ]
    ```
  </Tab>
</Tabs>

***

#### Possible Errors

* If NSFW words are detected

```

{
"success": False,
"message": "NSFW words detected. Please try again with a different prompt.",
}

```

* If Artist name is detected

```

{
"success": False,
"message": "Artist name detected. Please try again with a different prompt.",
}

```

* Generation Fail Error

```

{
"Detail": "str"
}

```

***
