Background Noise in Realtime API

We are using Realtime API. The background noise is handled by Threshold variable. I want to detect the background noise and based on that disable VAD. But the API does not seem to have a function to get the threshold value. Looking for suggestions on how to detect background noise level.