https://retellai.com/?utm_source=discord&utm_medium=seo logo
How do I set the more aggressive remove background...
# ❓・ai-evy-support
s
@AI Evy How do I set the more aggressive remove background speech mode to remove both background noise and background speech via the API?
a
Thanks for tagging me @snowskidude. I'll look through relevant sources and get back to you shortly.
### Answer To set the more aggressive denoising mode that removes both background noise and background speech via the API, you need to set the
denoising_mode
parameter to
"noise-and-background-speech-cancellation"
[(1) ]() . The available options for
denoising_mode
are [(1) ]() [(2) ]() : -
"noise-cancellation"
(default) : Removes background noise with nearly no distortion to the waveform - `"noise-and-background-speech-cancellation"`: More aggressive mode that removes both background noise and background speech This more aggressive mode might distort the waveform and can result in lower speech-to-text accuracy in certain cases [(3) ]() . It also incurs a $0.005/min surcharge as it requires more processing power . You can set this when creating or updating an agent through the API by including the
denoising_mode
field in your request [(1) ]() .
​ To learn more, see the sources I considered: [[1] Update Agent](https://docs.retellai.com/api-references/update-agent) [[2] Get Agent](https://docs.retellai.com/api-references/get-agent) [[3] Handle background speech & noise](https://docs.retellai.com/build/handle-background-noise) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy okay as I pass in the denoising_mode paramenter, how can I monitor in Retell the payload that I send it to be sure Retell is getting is okay?
a
Thanks for the follow-up, @snowskidude. I'll get back to you soon.
### Answer To monitor the payload and verify that Retell is receiving your
denoising_mode
parameter correctly, you can use the Get Agent API to check the agent's configuration after creating or updating it [(1) ]() . After sending your create or update request with the
denoising_mode
parameter, you can verify it was applied by calling:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponses = await client.agent.list() ;
console.log(agentResponses) ;
[(2) ]() The response will include the
denoising_mode
field showing the current setting [(1) ]() [(2) ]() . For example, you should see:
Copy code
json
{
 "denoising_mode": "noise-and-background-speech-cancellation"
}
This allows you to confirm that Retell received and applied your
denoising_mode
parameter correctly. The available options are
"noise-cancellation"
(default) and
"noise-and-background-speech-cancellation"
[(1) ]() .
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] List Agents](https://docs.retellai.com/api-references/list-agents) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.