LiveKit docs › Models › TTS › Additional models › Baseten

---

# Baseten TTS plugin guide

> How to use the Baseten TTS plugin for LiveKit Agents.

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

## Overview

This plugin allows you to use [Baseten](https://www.baseten.co/) as a TTS provider for your voice agents.

### Installation

Install the plugin from PyPI:

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

```

### Authentication

The Baseten plugin requires a [Baseten API key](https://app.baseten.co/settings/api-keys).

Set the following in your `.env` file:

```shell
BASETEN_API_KEY=<your-baseten-api-key>

```

### Model deployment

You must deploy a TTS model such as [Orpheus](https://www.baseten.co/library/orpheus-tts/) to Baseten to use it with LiveKit Agents. Your deployment includes a private model endpoint URL to provide to the LiveKit Agents integration.

Baseten model endpoints come in two forms, HTTP and websocket.

The plugin selects its mode from the URL scheme:

- `https://` endpoints use HTTP synthesis. The agent sends the full text in a single request and receives the audio in the response.
- `wss://` endpoints use websocket streaming. The agent streams words to the model as the LLM generates them, and the model streams audio back as it produces it. This significantly reduces latency for voice agents. Streaming requires a websocket-capable [Baseten TTS deployment](https://www.baseten.co/library/tag/text-to-speech/).

When `model_endpoint` starts with `wss://`, the plugin reports `capabilities.streaming=True` and the agent uses streaming synthesis. Otherwise the plugin falls back to HTTP synthesis. No further configuration is needed to switch between the two.

### Usage

Use Baseten TTS within an `AgentSession` or as a standalone speech generator. 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 baseten

session = AgentSession(
   # Pass a wss:// URL for websocket streaming, or an https:// URL for HTTP synthesis.
   tts=baseten.TTS(
      model_endpoint="<your-model-endpoint>",
      voice="tara",
   )
   # ... llm, stt, etc.
)

```

### Parameters

This section describes some of the available parameters. See the [plugin reference](https://docs.livekit.io/reference/python/livekit/plugins/baseten/index.html.md#livekit.plugins.baseten.TTS) for a complete list of all available parameters.

- **`model_endpoint`** _(string)_ (optional) - Environment: `BASETEN_MODEL_ENDPOINT`: The endpoint URL for your deployed model, found in your Baseten dashboard. Pass a `wss://` URL to enable realtime websocket streaming, or an `https://` URL for HTTP synthesis.

- **`voice`** _(string)_ (optional) - Default: `tara`: The voice to use for speech synthesis.

- **`language`** _(LanguageCode)_ (optional) - Default: `en`: [Language code](https://docs.livekit.io/agents/models/tts.md#language-codes) for the output audio.

- **`temperature`** _(float)_ (optional) - Default: `0.6`: Controls the randomness of the generated speech. Higher values make the output more random.

- **`max_tokens`** _(int)_ (optional) - Default: `2000`: Maximum number of tokens to generate per request. (Websocket only.)

- **`buffer_size`** _(int)_ (optional) - Default: `10`: Number of words per chunk streamed to the model. Smaller values reduce time-to-first-audio at the cost of slightly more overhead. (Websocket only.)

## Additional resources

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

- **[Python package](https://pypi.org/project/livekit-plugins-baseten/)**: The `livekit-plugins-baseten` package on PyPI.

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

- **[GitHub repo](https://github.com/livekit/agents/tree/main/livekit-plugins/livekit-plugins-baseten)**: View the source or contribute to the LiveKit Baseten TTS plugin.

- **[Baseten docs](https://docs.baseten.co/)**: Baseten's full docs site.

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

- **[Baseten STT](https://docs.livekit.io/agents/models/stt/baseten.md)**: Guide to the Baseten STT plugin with LiveKit Agents.

---

This document was rendered at 2026-06-07T11:35:49.370Z.
For the latest version of this document, see [https://docs.livekit.io/agents/models/tts/baseten.md](https://docs.livekit.io/agents/models/tts/baseten.md).

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