Voice Live API - Javascript/TS code for mobile client to directly connect using websockets

GenixPRO 141 Reputation points
2025-08-10T10:47:04.3466667+00:00

Hi.

  1. Is there any JS/TS quickstart for Voice Live API implementation? To connect mobile client directly to API using websockets
  2. If no such QS available, is the implementation similar to Assistants API? In that case we specify agent_id, set property & connect using ws:// or wss:// Thanks
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 22,806 Reputation points Volunteer Moderator
    2025-08-11T09:49:34.24+00:00

    Hello GenixPRO,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are in need of Voice Live API Javascript/TS code for mobile client to directly connect using websockets and I believed you would be using this on Microsoft Azure.

    Regarding your questions:

    Is there any JS/TS quickstart for Voice Live API implementation? To connect mobile client directly to API using websockets

    No official JS/TS quickstart exists for mobile clients directly connecting to Azure Voice Live API via WebSocket. However, there are:

    The best workaround is that you can implement a JS/TS client using standard WebSocket libraries and follow the Azure WebSocket protocol. Following this architecture:

    User's image

    If no such QS available, is the implementation similar to Assistants API? In that case we specify agent_id, set property & connect using ws:// or wss://

    Yes, conceptually similar, but with distinct differences technically.

    Feature Azure Assistants API Azure Voice Live API
    Protocol HTTP/WebSocket WebSocket only
    Protocol HTTP/WebSocket WebSocket only
    Authentication API Key / Entra ID Entra ID (recommended)
    Session Start thread.create session.update
    Audio Format Optional Required (PCM 24kHz)
    Turn Detection Basic Advanced (semantic VAD)
    Agent Configuration Manual Encapsulated via agent_id

    You can use session.update to configure agent, voice, audio settings, and turn detection.

    Since you're using Azure Service, the best option is to use Azure AI Foundry Agent Service as follow:

    • Create an Azure AI Foundry resource in supported regions.
    • Create an agent in the Foundry portal.
    • Use the agent_id in your WebSocket session payload.
    • Use Microsoft Entra ID for secure authentication.

    In this link - https://learn.microsoft.com/en-us/azure/ai-services/speech-service/voice-live-agents-quickstart the article explain a robust Azure Voice Live Agent Quickstart for your experiment.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.