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

# deAPI TTS

> DeAPITTSService synthesizes speech with deAPI's text-to-speech models and voices, including Kokoro voices and voice design.

> [!NOTE]
>
> **Community-maintained integration.** This service is built and
> maintained by
> [deapi-ai](https://github.com/deapi-ai)
> . Pipecat does not test or officially support it. Please report issues and
> request changes on the
> [source repository](https://github.com/deapi-ai/pipecat-deapi)
> . Learn more about
> [community integrations](https://docs.pipecat.ai/api-reference/server/services/community-integrations.md)
> .

## Overview

`DeAPITTSService` generates speech with [deAPI](https://deapi.ai)'s
text-to-speech models through its OpenAI-compatible speech endpoint. The
default model is Kokoro, with named voices in several languages; voice design
and other models are available through the same service. Each sentence is
synthesized as one complete audio file and pushed as audio frames.

> [card] [Source Repository](https://github.com/deapi-ai/pipecat-deapi)
>
> Source code, example, and issues for the deAPI integration

> [card] [Demo](https://github.com/deapi-ai/pipecat-deapi/blob/main/demo/demo.mp4)
>
> A recorded conversation with an agent running on deAPI

> [card] [deAPI Docs](https://docs.deapi.ai/openai-compatibility#text-to-speech)
>
> deAPI documentation for this endpoint

> [card] [API Keys](https://app.deapi.ai/settings/api-keys)
>
> Create and manage your deAPI API keys

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
uv add pipecat-deapi
```

## Prerequisites

1. **deAPI account**: Sign up at [deAPI](https://deapi.ai)
2. **API key**: Create a key in the [deAPI panel](https://app.deapi.ai/settings/api-keys)

### Required Environment Variables

* `DEAPI_API_KEY`: Your deAPI API key

## Configuration

**api\_key** `str` *required*

deAPI API key.

**base\_url** `str` (default: [https://oai.deapi.ai/v1/audio/speech](https://oai.deapi.ai/v1/audio/speech))

URL of the speech endpoint.

**aiohttp\_session** `aiohttp.ClientSession` (default: None)

Optional session for the HTTP requests. If not provided, the service creates
and closes its own.

**sample\_rate** `int` (default: None)

Output sample rate in Hz. If not provided, uses the pipeline's rate.

**settings** `DeAPITTSService.Settings` (default: None)

Runtime-configurable settings. See [Settings](#settings) below.

### Settings

| Parameter | Type | Default | Description |
| - | - | - | - |
| `model` | `str` | `"Kokoro"` | Text-to-speech model. |
| `voice` | `str` | `"af_nova"` | Voice of the model. On Kokoro the prefix selects the language; OpenAI voice names work. |
| `speed` | `float \| None` | `None` | Speech speed multiplier (Kokoro: 0.5 to 2.0). |
| `instructions` | `str \| None` | `None` | A description of the voice, for the voice-design model. |
| `language` | `str \| None` | `None` | Overrides the language chosen from the voice. |

## Usage

```python theme={null}
import os

from pipecat_deapi import DeAPITTSService

tts = DeAPITTSService(
    api_key=os.environ["DEAPI_API_KEY"],
    settings=DeAPITTSService.Settings(voice="af_nova"),
)
```

See the [source repository](https://github.com/deapi-ai/pipecat-deapi) for a complete voice agent.

## Compatibility

Tested with Pipecat v1.17.0. Check the [source repository](https://github.com/deapi-ai/pipecat-deapi) for the
latest tested version and changelog.


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