Async Voice API integrates with LiveKit Agents via the official livekit-plugins-asyncai plugin, enabling low-latency, streaming text-to-speech for real-time voice agents.This integration is streaming-first and optimized for conversational and real-time playback scenarios.
Features#
Low time-to-first-byte (TTFB)
Natural, human-like voices
Designed for LiveKit Agents lifecycle
Automatic connection cleanup and reconnection handling
Prerequisites#
LiveKit Agents project (JS/TS or Python)
Node.js or Python runtime
Installation#
JavaScript / TypeScript#
Python#
Configuration#
Environment variable#
Usage#
JavaScript / TypeScript#
import { Agent } from "livekit-agents";
import { tts } from "livekit-plugins-asyncai";
const agent = new Agent({
tts: tts.TTS({
apiKey: process.env.ASYNCAI_API_KEY!,
}),
});
Python#
import os
from livekit.agents import Agent
from livekit.plugins.asyncai import tts
agent = Agent(
tts=tts.AsyncAITTS(
api_key=os.environ["ASYNC_API_KEY"],
)
)
Streaming-only behavior#
The Async LiveKit TTS provider supports streaming only.If a non-streaming synthesis method is used, the provider will raise:AsyncAI TTS supports streaming only; use tts.stream().
This behavior is intentional and ensures optimal latency and real-time playback.
Connection lifecycle & error handling#
WebSocket connections are managed by the LiveKit Agents lifecycle
Connections are closed automatically on agent shutdown
Safe reconnects are handled in case of transient errors
Improved exception handling is inherited from the base LiveKit TTS service
Troubleshooting#
Ensure ASYNCAI_API_KEY is set and valid
Verify outbound network access to Async endpoints
Check version compatibility between:
Summary#
Async Voice API provides a streaming-first, low-latency TTS integration for LiveKit Agents, purpose-built for real-time voice and conversational AI systems. Modified at 2026-01-22 07:40:52