Hi Ashwath Bala S,
To deploy the Voice Live API Models (e.g. Customer Service feature in AI Foundry Playground) to production, follow the steps below:
Step-by-Step Production Deployment of Voice Live API Models:
Step1: Provision Voice Live Model in Azure Foundry
1. Go to: https://ai.azure.com/foundry
2. Choose the Customer Service preset or Voice Live (Realtime) model.
3. Click Deploy.
4. After deployment, note the:
o Endpoint URL (e.g., wss://.../realtime)
o API key or Entra ID for authentication.
Step2: Build a Client App (Web or Mobile)
Use WebSocket or WebRTC to stream voice to and from the deployed model.
· Azure provides sample SDKs in:
o Python (WebSocket-based)
o Node.js (WebRTC-based)
Example (Python WebSocket client):
import websockets
import asyncio
async def voice_chat():
uri = "wss://your-endpoint.realtime.azure.com"
async with websockets.connect(uri, extra_headers={"Authorization": "Bearer YOUR_KEY"}) as ws:
await ws.send(your_audio_bytes) # Send microphone input
response = await ws.recv() # Receive spoken response
print(response)
asyncio.run(voice_chat())
Step3: Integrate Frontend & Backend
· Frontend: Use JavaScript to capture mic input and play audio responses.
· Backend (Optional): Proxy requests, manage authentication, rate limiting, etc.
Step4: Deploy to Production
Choose one of the following Azure services to host your app:
· Azure App Service – For websites and APIs
· Azure Container Apps – For containerized apps
· Azure Static Web Apps + Azure Functions – For serverless deployment
Step5: Make It Publicly Usable
· Secure the API with Azure API Management or a backend token exchange.
· Add custom domain + HTTPS.
· Optional: Add usage tracking, authentication (Azure AD B2C), and failover.
Please refer below documents for more information:
How to use the GPT-4o Realtime API for speech and audio (Preview)
GPT-4o Realtime API for speech and audio (Preview)
And also sample code repo form git:
https://github.com/Azure-Samples/aoai-realtime-audio-sdk
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
**
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
Thank you!