--- id: livekit-api version: "1.2.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # livekit-api — Python Server API for LiveKit License: permissive · Maintenance: active · Downloads: 5.0M/mo ## 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 above — 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 pip install livekit-api uv add livekit-api poetry add livekit-api ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 5.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags livekit server api python, access token generation webrtc, room management api, livekit backend sdk, async video api client, sip integration python, livekit room service, webrtc, async-api, video-conferencing [View on SkillFed](https://skillfed.io/packages/livekit-api) · [View on PyPI](https://pypi.org/project/livekit-api/)