livekit-plugins-openai 1.8.0.
1. Install
2. Add it to your agent
ashu, neha, shruti and sameer (hear them).
Once your company has gone live, use https://prod.voice.miraiminds.co/v1.
The plugin assumes OpenAI’s PCM, which is 24 kHz. Ours is 48 kHz, so without
the SAMPLE_RATE line LiveKit plays the audio at half speed and an octave too
low. Set it before you create the TTS: the plugin reads it then, and again on
every request.
Each request the plugin makes is an ordinary request to POST /v1/audio/speech:
billed per character, counted against your
limits, and listed in your
request log.
If you also use OpenAI TTS in the same worker
Leave out theSAMPLE_RATE line and ask for WAV:
pcm.
3. Check your connection
Download the runnable example and run it. It speaks one line through LiveKit’s OpenAI plugin and saves it asspeech.wav. It needs only your Mirai key: no
LiveKit room, microphone, STT or LLM key. It uses a little API credit.
Output
uv run mirai_livekit.py works
too, without the pip install.
It reads the key from
MIRA_API_KEY (or MIRAI_API_KEY). If it fails, look
up the status code from the error in
When something fails; a 401 means
the key is wrong or missing.
TTS quickstart
Voices, formats, limits and the request log.
Pipecat
Our own Pipecat services, if you build on Pipecat instead.