pipedog is an unofficial community port of Pipecat, not affiliated with Daily.
pipedog
Text-to-speech

Gradium

Text-to-speech with GradiumTTSService, over Gradium's WebSocket API.

Overview

  • GradiumTTSService: streams text over a WebSocket to Gradium and pushes 48 kHz audio as it arrives.

Installation

bun add @pipedog/gradium
import { GradiumTTSService } from "@pipedog/gradium/tts";

Prerequisites

  • A Gradium account and an API key from Gradium.
  • Pass the key as apiKey. The examples read it from GRADIUM_API_KEY.

GradiumTTSService

Connects to wss://api.gradium.ai/api/speech/tts, with the key in the x-api-key header.

Configuration

Prop

Type

Settings

Runtime-updatable settings, passed as settings: new GradiumTTSService.Settings({...}) (GradiumTTSSettings). Any setting you leave out keeps the default below.

SettingTypeDefaultDescription
modelstring"default"Speech model.
voicestring"_6Aslh2DxfmnRLmP"Voice id. Changing it reconnects the socket.
languageLanguage | nullnullLanguage.

Usage

tts.ts
import { GradiumTTSService } from "@pipedog/gradium/tts";

const tts = new GradiumTTSService({
  apiKey: process.env.GRADIUM_API_KEY ?? "",
  settings: new GradiumTTSService.Settings({ voice: "_6Aslh2DxfmnRLmP" }),
});

Notes

  • The sample rate is fixed at 48000 Hz.
  • jsonConfig takes a JSON string of extra model settings, sent with the setup message.
RuntimeWorksWhat it needs
Bun✅ yesNothing.
Node.js✅ yesNothing.
Deno✅ yesNothing.
Cloudflare Workers✅ yesNothing.

Generated from pipecat.runtimes and pipecat.compat in packages/gradium/package.json: ✅ means the compat smoke test passes on that runtime.

Runtime notes

  • The WebSocket goes through the core websocketConnect, with headers on the handshake.
  • The deprecated InputParams, params, voice_id and model constructor options are not ported.
  • Tested against a local WebSocket server (upstream has no Gradium TTS test), not against Gradium itself.

pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.

Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).

On this page