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

# Extraction

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



## OpenAPI

````yaml POST /v2/Extraction
openapi: 3.1.0
info:
  title: WAV API
  version: 1.0.0
  description: API for retrieving conversion details by ID.
servers:
  - url: https://api.wav.com/api/public
    description: Production server
security: []
paths:
  /v2/Extraction:
    post:
      summary: Extract stems from an audio file or URL
      description: >-
        Process an audio file to extract specified stems (vocals, instrumental,
        or other components) with optional preprocessing. Supports file upload
        or URL with webhook callback.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                audio_url:
                  type: string
                  description: 'Input audio URL (supported format: YouTube URL).'
                  example: https://www.youtube.com/watch?v=example123
                audio_file:
                  type: string
                  format: binary
                  description: Audio file to upload and process.
                stems:
                  type: string
                  default: '[]'
                  description: >-
                    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.
                  example: '["vocals", "drums"]'
                preprocessing_options:
                  type: string
                  default: '[]'
                  description: >-
                    JSON string list of preprocessing steps. Available options:
                    Denoise, Deecho, Dereverb.
                  example: '["Denoise", "Dereverb"]'
                eco_mode:
                  type: boolean
                  default: false
                  description: Enable eco mode for faster parallel extraction.
                webhook_url:
                  type: string
                  description: Callback URL for async processing.
                  example: https://example.com/webhook
              anyOf:
                - required:
                    - audio_url
                - required:
                    - audio_file
      responses:
        '200':
          description: Successfully initiated stem extraction
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  task_id:
                    type: string
                  conversion_id:
                    type: string
                  eta:
                    type: integer
                  credit_estimate:
                    type: number
                  message:
                    type: string
                  status:
                    type: string
                example:
                  success: true
                  task_id: 98bb0a78-854b-4ca7-a145-834c1ac73901
                  conversion_id: 7c38aa60-e0c8-4113-983a-f2c6d4e6d257
                  eta: 57
                  credit_estimate: 0.09
                  message: Message published to queue
                  status: IN_QUEUE
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Either audio_url or audio_file must be provided.
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal Server Error
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Python
          source: >-
            import requests

            import json


            url = "https://api.wav.com/api/public/v2/Extraction"


            headers = {
                "Authorization": "<API_KEY>"
            }


            data = {
                "stems": json.dumps(["vocals", "drums"]),
                "preprocessing_options": json.dumps(["Denoise"]),
                "webhook_url": "https://example.com/my-webhook"
            }


            # Option 1: audio_url

            data["audio_url"] = "<YOUR_AUDIO_URL>"

            response = requests.post(url, headers=headers, data=data)


            # Option 2: File Upload

            # with open("song.mp3", "rb") as f:

            #     files = {"audio_file": f}

            #     response = requests.post(url, headers=headers, data=data,
            files=files)


            print(response.json())
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````