> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lokutor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

> The lokutor Python package 1.5.0: what it covers, installing it on Python 3.8+ (pip install lokutor, plus lokutor[audio] and PortAudio for local playback and recording), and where the examples are.

The official Python SDK for Lokutor: text-to-speech, transcription and full-duplex voice agents over the same API as the [JavaScript SDK](/sdks/javascript/reference), with the same class names.

## What it covers

* **`TTSClient`**: stream speech from text, play it locally or collect the PCM.
* **`STTClient`** and **`SpeechToTextClient`**: transcribe a recorded clip, or a live microphone.
* **`VoiceAgentClient`**: a conversation with an agent through your microphone and speakers, with [tool calling](/sdk/tool-calling).
* **Languages**: speech in English, Spanish, Catalan, Galician, Basque, Portuguese, French, Italian and German; recognition in English, Spanish, Portuguese, French, Italian and German.
* **`lokutor.audio_utils`**: PCM/float conversion, resampling (with anti-aliasing), streaming resampling and RMS helpers.

## Installation

Python 3.8 or later.

```bash theme={null}
pip install lokutor
```

That is enough to call the API: synthesize to bytes, transcribe files. To play or record audio on the local machine (`play=True`, `start_conversation()`, `SpeechToTextClient.start()`), add the audio extra. It needs the PortAudio library first:

```bash theme={null}
brew install portaudio            # macOS
sudo apt install portaudio19-dev  # Debian / Ubuntu
pip install "lokutor[audio]"
```

## Next

* [Python Quickstart](/sdks/python/quickstart)
* [Python API Reference](/sdks/python/reference)
* Examples: [`python/examples`](https://github.com/lokutor-ai/lokutor-sdk/tree/main/python/examples) in the SDK repository (`simple_tts.py`, `simple_chat.py`, `advanced_chat.py`)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.