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

# Noise cancellation

## Overview

A voice agent is only as good as the audio it hears. If the transcription gets a word wrong, everything after it is wrong too.

Noise cancellation cleans the audio before any of that happens, which means you're not fixing errors later, you're not creating them in the first place.

## This is where things actually go wrong

Voice agents run over phone calls. Compressed audio, people in cars, call center background noise, street noise, speakerphones. On those calls the model isn't the problem. The audio reaching it is. Swapping to a better transcription model won't help much if what arrives is already unclear.

### It works with any model you're already using

Noise cancellation runs before transcription, so it improves whichever model you're on, including your own key. Nothing else in your setup has to change.

## How to use it

To activate noise cancellation for any model on the gateway, include this header in your request:

```shellscript theme={null}
"X-Slng-Noise-Cancellation": "ai-coustics"
```

Here's an example of the headers for a request using Deepgram Nova 3 in Australia:

<CodeGroup>
  ```javascript WSS theme={null}
  const url =
    "wss://au.api.slng.ai/v1/stt/slng/deepgram/nova:3-en?language=en";

  const socket = new WebSocket(url, {
    headers: {
      Authorization: `Bearer ${process.env.SLNG_TOKEN}`,
      "X-Slng-Noise-Cancellation": "ai-coustics",
    },
  });
  ```

  ```shellscript HTTP theme={null}
  curl --request POST \
    --url https://au.api.slng.ai/v1/stt/slng/deepgram/nova:3-en \
    --header 'Authorization: Bearer <token>' \
    --header 'X-Slng-Noise-Cancellation: ai-coustics'\
    --header 'Content-Type: multipart/form-data' \
    --form audio='@example-file' \
    --form language=en
  ```
</CodeGroup>

## SLNG models

Noise cancellation works with every STT model in the [SLNG catalog](/models/catalog/all-models). Use your SLNG API key or project credentials and set the header, nothing else needed.

## BYOK

Noise cancellation also works when you bring your own provider key, as long as the model is one we support. Same header, same behavior. See [Bring your own key](/guides/models/bring-your-own-key).

## Regions

Noise cancellation runs in the region where you invoke it. Your speech is never processed or hosted in another region.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.