LiveKit docs › Models › TTS › Additional models › Kokoro

---

# Kokoro TTS plugin guide

> How to run Kokoro TTS locally with LiveKit Agents.

Available in:
- [ ] Node.js
- [x] Python

## Overview

Kokoro is an open-weight TTS model you can run locally. [Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI) wraps it in an OpenAI-compatible endpoint, which the OpenAI plugin connects to directly.

### Installation

Install the OpenAI plugin to add Kokoro support:

```shell
uv add "livekit-agents[openai]~=1.5"

```

### Usage

Run Kokoro-FastAPI, then point `openai.TTS` at its OpenAI-compatible endpoint. For example, you can use this TTS in the [Voice AI quickstart](https://docs.livekit.io/agents/start/voice-ai.md):

```python
from livekit.plugins import openai

session = AgentSession(
    tts=openai.TTS(
        model="kokoro",
        voice="af_alloy",
        api_key="not-needed",
        base_url="http://localhost:8880/v1",
        response_format="wav",
    ),
    # ... llm, stt, vad, turn_detection, etc.
)

```

### Parameters

This section describes the parameters used to connect to a Kokoro-FastAPI server. See the [plugin reference](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.TTS) for a complete list of all available parameters.

- **`model`** _(string)_ (optional): Model to use for speech generation. Set to `kokoro` to use the Kokoro model served by Kokoro-FastAPI.

- **`voice`** _(string)_ (optional): Kokoro voice name, such as `af_alloy`. For the full list of available voices, see the [Kokoro-FastAPI documentation](https://github.com/remsky/Kokoro-FastAPI).

- **`base_url`** _(string)_ (optional): URL of your Kokoro-FastAPI server's OpenAI-compatible endpoint. Kokoro-FastAPI listens on `http://localhost:8880/v1` by default.

- **`api_key`** _(string)_ (optional): Kokoro-FastAPI doesn't require authentication, but the OpenAI client rejects an empty value. Set any non-empty placeholder, such as `not-needed`.

- **`response_format`** _(string)_ (optional): Audio format returned by the server. Kokoro-FastAPI supports several formats, such as `wav`.

## Additional resources

The following resources provide more information about using Kokoro with LiveKit Agents.

- **[Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI)**: Run Kokoro locally behind an OpenAI-compatible endpoint.

- **[OpenAI TTS plugin](https://docs.livekit.io/agents/models/tts/openai.md)**: The OpenAI TTS plugin that powers this integration.

- **[Python plugin reference](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.TTS)**: Reference for the OpenAI TTS plugin.

- **[Voice AI quickstart](https://docs.livekit.io/agents/start/voice-ai.md)**: Get started with LiveKit Agents and Kokoro.

---

This document was rendered at 2026-06-15T23:15:48.089Z.
For the latest version of this document, see [https://docs.livekit.io/agents/models/tts/kokoro.md](https://docs.livekit.io/agents/models/tts/kokoro.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).