Voice API
  1. Integrations
Voice API
  • Welcome to Async Voice API
  • Getting Started with the Async Voice API
  • API Reference
    • API Status
      • API Status Check
    • Text-to-Speech
      • Text to Speech (WebSocket)
      • Text to Speech
      • Text to Speech with Word Timestamps
      • Text to Speech (Stream)
    • Voice Management
      • Clone Voice
      • List Voices
      • Get Voice
      • Update Voice
      • Delete Voice
      • Get Voice Preview
  • Advanced Guides
    • Embed Player
    • Custom Pronunciations
      • Embedding Custom Phonemes in Async Voice API
      • Pronouncing digits one‑by‑one
      • Insert Silent Pauses with <break>
  • Integrations
    • Integrate with Twilio
    • Pipecat Integration
    • Livekit Integration
  1. Integrations

Livekit Integration

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#

Real-time streaming TTS
Low time-to-first-byte (TTFB)
Natural, human-like voices
Designed for LiveKit Agents lifecycle
Automatic connection cleanup and reconnection handling

Prerequisites#

Async Voice API account
Async API key
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:
livekit-agents
livekit-plugins-asyncai

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
Previous
Pipecat Integration
Built with