Skip to main content
Pipecat is a framework for building real-time voice and multimodal agents. Its GradiumTTSService lets a Pipecat pipeline stream synthesized speech through Gradium’s WebSocket API.

Pipecat Gradium reference

API reference for GradiumTTSService.

Gradium voice example

Complete Pipecat example using Gradium services.

Gradient Bang

Pipecat’s multiplayer game, using Gradium for TTS by default.

Gradium TTS guide

Gradium WebSocket TTS setup and streaming behavior.

Installation

Install Pipecat with the Gradium extra:
Set your Gradium API key in the environment:

Basic setup

Create a GradiumTTSService with your API key and a Gradium voice ID. Pipecat’s current pattern is to pass runtime options through GradiumTTSService.Settings(...).
Then place the service in the audio pipeline after the LLM and before the transport output:

Configuration

Common settings:
Gradium TTS in Pipecat outputs audio at 48kHz. Pipecat sets this sample rate automatically.

Runtime behavior

  • Streaming audio: Gradium emits audio over a WebSocket, which Pipecat forwards through the active transport.
  • Word timestamps: Gradium timestamp events can support synchronized text display.
  • Voice switching: Updating the voice setting at runtime reconnects the Gradium WebSocket with the new voice.
  • Connection events: on_connected, on_disconnected, and on_connection_error are available for logging and health checks.

Example project

Gradient Bang is Pipecat’s multiplayer game and uses Gradium as the default TTS provider. Its bot environment includes TTS_PROVIDER=gradium, making it a useful larger reference for a real voice-agent application built on Pipecat.