Hello Vandanaa S,
Greetings and Welcome to Microsoft Q&A!
I tried to reproduce the scenario in my environment, and it is working fine for me. Here is the screenshot,
To resolve the issue, try the following steps:
The Real-Time Audio API is region-specific and only works in East US 2 and Sweden Central. If you are using any other region, you will receive a 401 error. Ensure that you are deploying the service in one of these supported regions.
Use the endpoint and API keys directly from Azure OpenAI and not from Azure AI Foundry. When configuring your script, avoid using environment variables and instead provide the API key, endpoint, and deployment name explicitly.
Cross-check that the API key, endpoint, and deployment name are correct and match your Azure OpenAI resource settings.
I hope you understand. And, if you have any further query do let us know.
Thank you!