This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Yousri. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I looked at the error you pasted (404 on a wss:// URL) and the cause is clear: Azure OpenAI does not expose a WebSocket realtime transcription endpoint for the gpt-4o-transcribe deployment. In other words,
openai.STT.with_azure(model="gpt-4o_transcribe", use_realtime)
is not supported — the SDK attempted to connect to a
/realtime
WebSocket path that doesn’t exist for that model, producing the WSServerHandshakeError 404. What you can do next • If you only need transcription (non–full-duplex): use REST-based STT:
Copy code
stt = openai.STT.with_azure(model="gpt-4o-transcribe")
This sends audio over HTTP and returns transcriptions (supported in Python). • If you need true low-latency, bidirectional realtime voice (live streaming, turn-taking, TTS, etc.): migrate to Azure’s Realtime API with a realtime-capable deployment (e.g.,
gpt-4o-realtime
) via
RealtimeModel.with_azure(...)
and read transcription events (e.g.,
input_audio_transcription_completed
). Configure
modalities=["text"]
if you want text-only output. Quick checks to help me help you further • Which option do you want: REST transcription or full realtime voice interaction? • Which SDK/package and version are you using (exact pip package/version or requirements)? • What's the exact deployment name you created in your Azure portal (so we can confirm mismatch)? Tell me those and I’ll give exact code snippets and next steps for your chosen approach. Sources: Azure OpenAI STT plugin guide | LiveKit docs | Azure OpenAI Realtime API and LiveKit | LiveKit docs
c
For which model is this exposed? can I call gpt-realtime from openai.STT.with_azure()? I don't understand for which model was this parameter was introduced on openai.STT.with_azure
t
You're right to ask — let me clarify. •
openai.STT.with_azure()
does not support a
use_realtime
WebSocket mode for any Azure model. The STT helper is for REST-based transcription (e.g.,
gpt-4o-transcribe
) only. • Realtime (WebSocket) streaming is supported via the Realtime API and the
RealtimeModel.with_azure()
path, not
openai.STT.with_azure()
. Models intended for that API are realtime-capable models such as
gpt-4o-realtime
(or other realtime deployments you create). • You cannot call
gpt-realtime
(or
gpt-4o-realtime
) through
openai.STT.with_azure()
. To use a realtime-capable model, create a realtime deployment in Azure and use
RealtimeModel.with_azure(...)
, then handle transcription events (for example,
input_audio_transcription_completed
) from the realtime stream. If you want, tell me whether you prefer: • REST transcription with
gpt-4o-transcribe
(I’ll give the exact code), or • Realtime streaming with
gpt-4o-realtime
(I’ll show how to set up
RealtimeModel.with_azure()
and read transcription events).
c
I don't understand then why openai.STT.with_azure() exposed use_realtime argument
t
Thanks — good question. You're right to be puzzled; here’s a concise clarification. • The
use_realtime
argument on
openai.STT.with_azure()
is not functional for Azure STT.
openai.STT.with_azure()
is designed for REST-based transcription (e.g.,
gpt-4o-transcribe
) and does not have a supported WebSocket realtime mode on Azure. • Realtime streaming is provided by the Azure OpenAI Realtime API and the LiveKit API surface for it is
RealtimeModel.with_azure(...)
. Realtime-capable deployments (for example
gpt-4o-realtime
or other realtime-deployed models) must be used through
RealtimeModel.with_azure
, not through
openai.STT.with_azure()
. Why the parameter may appear exposed • The parameter exists in the STT helper API surface but it’s not applicable to Azure’s
gpt-4o-transcribe
REST-only deployments. This can make it look like a realtime toggle, but Azure’s transcription model does not expose the
/realtime
WebSocket endpoint, so setting
use_realtime
will fail with the 404 handshake error you saw. What to do next • If you want transcription only: use
openai.STT.with_azure(model="gpt-4o-transcribe")
(REST). • If you want true realtime streaming and transcription events: create a realtime-capable deployment in Azure and use `RealtimeModel.with_azure(...)`; handle transcription events from the realtime stream. If you’d like, tell me which path you prefer and I’ll give the exact code snippets and the minimal Azure deployment settings for that flow.