> ## Documentation Index
> Fetch the complete documentation index at: https://daily-docs-pr-5366.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Floe Text-to-Speech

> BYOK-first text-to-speech for Pipecat — route your own OpenAI key through Floe for per-call metering and spend caps, or go keyless.

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="Floe Labs" maintainerUrl="https://github.com/Floe-Labs" repo="https://github.com/Floe-Labs/pipecat-floe" />

## Overview

`FloeTTSService` provides an OpenAI-compatible interface for text-to-speech
through [Floe](https://floelabs.xyz) — a unified billing ledger for voice AI
where one key powers the LLM, STT, and TTS legs of an agent, metered per call
and bounded by pre-call spend caps. It extends Pipecat's `OpenAITTSService`, so
streamed audio, metrics, and tracing work unchanged.

**BYOK-first.** Pass `provider_key=` with your own vendor key and Floe routes the
call on your key, billing only its service fee while still metering the call and
enforcing your spend caps. Omit it to go **keyless** and let Floe manage the keys.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/Floe-Labs/pipecat-floe">
    Source code, examples, and issues for the Floe integration
  </Card>

  <Card title="PyPI Package" icon="cube" href="https://pypi.org/project/pipecat-floe/">
    The `pipecat-floe` package on PyPI
  </Card>

  <Card title="Floe" icon="book" href="https://floe-labs.gitbook.io/docs">
    Documentation and supported models for Floe
  </Card>

  <Card title="API Keys" icon="key" href="https://dev-dashboard.floelabs.xyz">
    Create and manage your Floe agent keys
  </Card>
</CardGroup>

## Installation

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

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

## Prerequisites

### Floe Account Setup

Before using the Floe TTS service, you need:

1. **Floe Account**: Sign up at the [Floe dashboard](https://dev-dashboard.floelabs.xyz)
2. **API Key**: Create an agent key from your dashboard. New keys come with
   welcome credit that covers the first calls.

### Required Environment Variables

* `FLOE_API_KEY`: Your Floe agent key for authentication

## Configuration

<ParamField path="api_key" type="str" default="None">
  Floe agent key. Falls back to the `FLOE_API_KEY` environment variable if not
  provided. Raises `ValueError` if neither is set.
</ParamField>

<ParamField path="model" type="str" default="openai/tts-1">
  Fully qualified `provider/model` identifier (for example `"openai/tts-1"`). A
  bare model name is rejected by Floe.
</ParamField>

<ParamField path="voice" type="str" default="alloy">
  Voice identifier to synthesize with.
</ParamField>

<ParamField path="base_url" type="str" default="https://credit-api.floelabs.xyz/v1">
  Floe OpenAI-compatible base URL.
</ParamField>

<ParamField path="task_id" type="str" default="None">
  Optional Floe task ID sent as the `X-Floe-Task-Id` header, so a per-task
  budget can bound one conversation. Attached via a custom `httpx` client; if
  you pass your own `http_client`, add the header to it yourself.
</ParamField>

<ParamField path="provider_key" type="str" default="None">
  **BYOK.** Your upstream vendor key, sent as the `X-Floe-Provider-Key` header.
  Floe routes the call on your key and bills only its service fee, while still
  metering the call and enforcing your spend caps. Omit for the keyless path.
  Like `task_id`, it's attached via a custom `httpx` client; if you pass your own
  `http_client`, add the header to it yourself.
</ParamField>

<ParamField path="kwargs">
  Additional keyword arguments passed through to the underlying
  `OpenAITTSService`.
</ParamField>

## Usage

```python theme={null}
import os
from pipecat_floe import FloeLLMService, FloeSTTService, FloeTTSService
from pipecat.pipeline.pipeline import Pipeline

# One Floe key powers all three legs, on a single budget.
# BYOK — set OPENAI_API_KEY to run on your own vendor key (Floe meters + caps,
# fee-only); leave it unset to run keyless.
oai = os.getenv("OPENAI_API_KEY")
stt = FloeSTTService()                                              # keyless streaming STT
llm = FloeLLMService(model="openai/gpt-4o-mini", provider_key=oai)  # BYOK if set, else keyless
tts = FloeTTSService(model="openai/tts-1", voice="alloy", provider_key=oai)

# ...or omit provider_key to run keyless (Floe manages the vendor keys).
pipeline = Pipeline([stt, llm, tts])
```

See the [source repository](https://github.com/Floe-Labs/pipecat-floe) for a
complete runnable example wiring a WebSocket transport → STT → LLM → TTS.

## Compatibility

Built and verified against Pipecat v1.7.0+. Check the [source
repository](https://github.com/Floe-Labs/pipecat-floe) for the latest tested
version and changelog.
