livekit-api
Python Server API for LiveKit
What it is and what it does
livekit-api is the server-side Python SDK for LiveKit, a real-time communication platform. It provides two main capabilities: generating JWT access tokens for participants to join LiveKit rooms, and calling LiveKit's backend APIs to manage rooms, configure egress/ingress, handle SIP calls, and dispatch agents. The package wraps LiveKit's gRPC protocol layer (via livekit-protocol and protobuf) and exposes it through async Python methods, making it straightforward to integrate LiveKit into Python backends without blocking I/O.
The SDK is designed for backend use where your API secret can be safely stored. It uses aiohttp and asyncio for non-blocking HTTP calls, so all room and service operations must be called within an async context. Authentication can be done with API key and secret (recommended for backends) or with a pre-signed token (for client-side scenarios where the secret cannot be exposed). Error handling is explicit: failed calls raise ServerError or its subclass SipCallError, exposing the error code, message, and metadata.
Use it for:
- Generate access tokens in your backend to issue to web or mobile clients before they connect to a LiveKit room.
- Programmatically create, list, and delete rooms from a backend service or admin panel.
- Set up SIP trunks and initiate outbound calls to phone numbers, integrating LiveKit with telephony systems.
- Configure egress to record or stream room sessions to external storage or CDNs.
- Dispatch LiveKit agents to handle specific tasks within rooms as part of a multi-modal AI workflow.
- Manage ingress streams to ingest external video/audio sources into LiveKit rooms.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generate access tokens and call LiveKit server APIs (room management, egress, ingress, SIP, agent dispatch, connectors) from Python backends using async/await.
Yes. livekit-api is actively maintained, has no known vulnerabilities, low install friction, and is the official way to call LiveKit's server APIs from Python. Install it if you are building a backend that needs to generate tokens, manage rooms, or integrate with LiveKit's services. The async-only design is a minor constraint but standard for modern Python backends.
Install
livekit-api on PyPI
pip
pip install livekit-apiuv
uv add livekit-apipoetry
poetry add livekit-apiInstalling livekit-api
Before you install
Low install friction; pure Python wheel with five runtime dependencies (aiohttp, livekit-protocol, protobuf, pyjwt, types-protobuf). Active maintenance with recent release (34 days ago) and no known vulnerabilities.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for proprietary backends.
Quickstart
pip install livekit-api
from livekit import api
import asyncio
async def main():
lkapi = api.LiveKitAPI("https://my-project.livekit.cloud", api_key="...", api_secret="...")
token = api.AccessToken().with_identity("bot").with_grants(api.VideoGrants(room_join=True, room="my-room")).to_jwt()
room_info = await lkapi.room.create_room(api.CreateRoomRequest(name="my-room"))
await lkapi.aclose()
asyncio.run(main())
Requires Python 3.9 or later; API calls must run inside an asyncio event loop.
Verify before relying
- Whether livekit-protocol and types-protobuf are optional or required for all use cases.
- Performance characteristics and rate limits of the server API under load.
- Whether pre-signed token authentication works for all service endpoints or only a subset.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — aiohttp, livekit-protocol, protobuf, pyjwt, types-protobuf |
| Maintenance | actively maintained — 34 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,999,740/month — #2,183 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: livekit_api-1.2.0-py3-none-any.whl
Keywords: audio, livekit, realtime, video, webrtc
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
livekitPython SDK for building real-time video, audio,…
permissive · top 5,000 on PyPI
livekit-protocolProvides Python protocol stubs and type…
permissive · top 5,000 on PyPI
livekit-agentsA framework for building realtime multimodal…
permissive · top 5,000 on PyPI
livekit-plugins-telnyxIntegrates Telnyx telephony services with…
permissive · top 15,000 on PyPI
daily-pythonA Python SDK for building video and audio…
permissive · top 15,000 on PyPI
streamlit-webrtcAdds real-time video and audio streaming over…
permissive · top 15,000 on PyPI
livekit-plugins-azureIntegrates Azure AI services, particularly…
permissive · top 15,000 on PyPI
livekit-plugins-noise-cancellationApplies real-time noise cancellation to inbound…
unclear · top 5,000 on PyPI
livekit-plugins-assemblyaiIntegrates AssemblyAI speech-to-text into the…
permissive · top 15,000 on PyPI
livekit-plugins-rimeIntegrates Rime speech recognition into…
permissive · top 15,000 on PyPI