LiveKit

Add Speechify TTS to a LiveKit AgentSession via the official Python plugin.

Overview

LiveKit Agents supports Speechify TTS through the official livekit-plugins-speechify package. You install it, import speechify from livekit.plugins, and pass speechify.TTS(...) as the tts= argument on AgentSession alongside your STT and LLM providers.

LiveKit’s Speechify plugin is Python-only. There is no Node.js LiveKit Speechify plugin at time of writing — see LiveKit’s Speechify TTS plugin guide for the current language support matrix.

SpeechifyAI Agents — our own voice-agent platform

SpeechifyAI ships its own voice-agents platform powered by Simba 3.2, which ranks #1 on the Artificial Analysis TTS leaderboard as of July 2026. See SpeechifyAI Agents if you want an end-to-end voice-agent stack instead of routing TTS through LiveKit.

Prerequisites

  • Speechify API key (platform.speechify.ai/api-keys)
  • LiveKit project (URL, API key, and secret)
  • Deepgram key for STT, OpenAI key for LLM (this guide’s stack — swap freely)

Install

$python3 -m venv .venv
$source .venv/bin/activate
$pip install "livekit-agents[codecs]>=1.6.5" \
> "livekit-plugins-speechify>=1.6.5" \
> "livekit-plugins-deepgram>=1.6.5" \
> "livekit-plugins-openai>=1.6.5" \
> python-dotenv

Configure

Put credentials in .env:

$SPEECHIFY_API_KEY=your_speechify_api_key
$LIVEKIT_URL=wss://your-project.livekit.cloud
$LIVEKIT_API_KEY=your_livekit_api_key
$LIVEKIT_API_SECRET=your_livekit_api_secret
$DEEPGRAM_API_KEY=your_deepgram_api_key
$OPENAI_API_KEY=your_openai_api_key

The plugin reads SPEECHIFY_API_KEY automatically when you don’t pass api_key= to speechify.TTS(...) directly.

Wire Speechify into AgentSession

1from dotenv import load_dotenv
2
3from livekit import agents
4from livekit.agents import Agent, AgentServer, AgentSession
5from livekit.plugins import deepgram, openai, speechify
6
7load_dotenv()
8
9
10class Assistant(Agent):
11 def __init__(self) -> None:
12 super().__init__(
13 instructions=(
14 "You are a helpful voice assistant speaking with a Speechify voice. "
15 "Keep replies short, clear, and conversational."
16 )
17 )
18
19
20server = AgentServer()
21
22
23@server.rtc_session(agent_name="speechify-tts-demo")
24async def entrypoint(ctx: agents.JobContext) -> None:
25 session = AgentSession(
26 stt=deepgram.STT(model="nova-3"),
27 llm=openai.LLM(model="gpt-4o-mini"),
28 tts=speechify.TTS(voice_id="dominic_32", model="simba-3.2"),
29 )
30
31 await session.start(room=ctx.room, agent=Assistant())
32 await session.generate_reply(
33 instructions="Greet the user and mention that your voice is powered by Speechify TTS."
34 )
35
36
37if __name__ == "__main__":
38 agents.cli.run_app(server)

The tts=speechify.TTS(...) line is the whole integration. Pair voice_id and model deliberately — a Simba 3.2 voice needs model="simba-3.2", and a Simba English voice needs model="simba-english". See Models for the compatibility matrix.

Verify without a LiveKit room

The plugin’s synthesize(...) method calls Speechify directly, so you can prove the TTS path works before provisioning a room:

1import asyncio
2import wave
3
4from livekit.plugins import speechify
5
6
7async def main() -> None:
8 tts = speechify.TTS(voice_id="dominic_32", model="simba-3.2")
9 frames = []
10 async for event in tts.synthesize("Hello from Speechify TTS on LiveKit."):
11 frames.append(event.frame)
12
13 with wave.open("speechify-tts-smoke.wav", "wb") as wf:
14 wf.setnchannels(1)
15 wf.setsampwidth(2)
16 wf.setframerate(24000)
17 for frame in frames:
18 wf.writeframes(frame.data)
19
20
21asyncio.run(main())

Set SPEECHIFY_API_KEY in the environment first. A successful run writes speechify-tts-smoke.wav at 24 kHz mono.

Run the full agent

Once the smoke test passes, run against a LiveKit room:

$# Local terminal (microphone + speakers, no room)
$python agent.py console
$
$# Development LiveKit project
$python agent.py dev
$
$# Production
$python agent.py start

Troubleshooting

If Python cannot verify TLS certificates when calling Speechify, point SSL_CERT_FILE at your system bundle or the certifi bundle before running:

$export SSL_CERT_FILE=/etc/ssl/cert.pem

The plugin only reads the env var when you construct speechify.TTS() without an explicit api_key=. If you pass an argument, it takes precedence — pass None or omit it to use the env var.

Resources