how to use livekit open ai stt
# ask-ai
c
how to use livekit open ai stt
t
Thanks for reaching out, Hai. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you get started with LiveKit's OpenAI STT (Speech-to-Text) integration! Just follow these simple steps: 1. Install the Plugin: You can easily install the LiveKit Agents OpenAI plugin using pip:
pip install "livekit-agents[openai]~=1.2"
2. Set Up Authentication: Make sure to provide your OpenAI API key, either directly in your code or as an environment variable:
OPENAI_API_KEY=your_openai_api_key
3. Initialize STT: To get started with transcription, create an instance of OpenAI STT in Python like this:
Copy code
from livekit.plugins import openai

stt_instance = openai.STT(
    model="gpt-4o-transcribe",  # or "whisper-1"
    language="en"
)
4. Streaming Support: If you'd like real-time transcription, just set
use_realtime=True
when initializing. 5. Azure OpenAI: And if you're using Azure OpenAI, you can configure it easily with the
with_azure()
method to set the endpoint and API key. For more detailed info, feel free to check out the Voice AI Quickstart Guide. If you have any questions or need a hand with anything, just let me know—I'm here to help! Sources: OpenAI STT integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-baseten/livekit/plugins/baseten/stt.py | plugins/openai/src/stt.test.ts | Azure OpenAI STT integration guide | LiveKit Docs | OpenAI STT integration guide | LiveKit Docs
c
can u double check that somehow it does not work
t
I'd love to help you get this sorted out! Could you share a bit more about what’s going on? For example: • Are you seeing any error messages? If yes, what do they say? • Which part of the setup process seems tricky or isn’t working as you expected? • Are you working with Python or Node.js for the integration? • Have you had a chance to set up your OpenAI API key yet? Knowing these details will really help me understand the situation better and guide you through it.
c
he STT (livekit.plugins.openai.stt.STT) does not support streaming, add a VAD to the AgentTask/VoiceAgent to enable streamingOr manually wrap your STT in a stt.StreamAdapter", "room": "call-_+15715051131_3X2FBwrt3iEo", "timestamp": "2025-09-15T150633.215307+00:00"}
here is it
t
It looks like the error is happening because the STT model you're using doesn’t support streaming just yet. No worries though! You have a couple of friendly options to get this working smoothly: 1. Add a VAD (Voice Activity Detection): By including a VAD instance in your Agent configuration, you’ll enable streaming automatically as it wraps the STT with a
StreamAdapter
. Here’s how you can do it:
Copy code
from livekit.agents import Agent
from livekit.plugins import openai, silero

stt = openai.STT()  # Non-streaming STT
vad = silero.VAD.load()
agent = Agent(stt=stt, vad=vad)  # VAD enables streaming
2. Manually Wrap STT in a StreamAdapter: Another approach is to use a
StreamAdapter
yourself, which buffers the audio and simulates streaming. Here’s a quick example:
Copy code
from livekit.agents import stt as lk_stt
from livekit.plugins import openai, silero

whisper_stt = openai.STT()
vad = silero.VAD.load()
stt = lk_stt.StreamAdapter(stt=whisper_stt, vad=vad)
agent = Agent(stt=stt)
If you’d like, I’m here to help you step-by-step with these solutions or answer any other questions you might have. Just let me know! Sources: agents/src/stt/stt.ts | tests/test_stt.py | Speech-to-text (STT) integrations | LiveKit Docs | Working with plugins | LiveKit Docs
It looks like the error is happening because the STT model you're using doesn’t support streaming on its own. No worries though! To get streaming working, you have a couple of friendly options: 1. Add a VAD (Voice Activity Detection): You can include a VAD instance in your Agent configuration. This will automatically wrap the STT with a StreamAdapter for you.
Copy code
from livekit.agents import Agent
from livekit.plugins import openai, silero

stt = openai.STT()  # Non-streaming STT
vad = silero.VAD.load()
agent = Agent(stt=stt, vad=vad)  # Enables streaming
2. Manually Wrap STT in a StreamAdapter: Another way is to use a StreamAdapter to buffer audio and process it with VAD.
Copy code
from livekit.agents import stt as lk_stt
from livekit.plugins import openai, silero

whisper_stt = openai.STT()
vad = silero.VAD.load()
stt = lk_stt.StreamAdapter(stt=whisper_stt, vad=vad)
agent = Agent(stt=stt)
If you have any questions or need a hand with setting this up, please don’t hesitate to reach out—I’m here to help!
c
can u give me the github link to speechify livekit
t
I'm happy to help you find the GitHub repository for the Speechify LiveKit integration! You can check it out here: https://github.com/livekit/agents Inside this repository, you'll find the Speechify TTS plugin in the
livekit-plugins/livekit-plugins-speechify
directory. If you have any questions or need more help, just let me know—I'm here for you! Sources: livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/log.py