Skip to main content
Generate complete audio from text. This is the simplest way to get started - provide text and receive audio back.

Basic Generation

Generation Parameters

The parameters you’ll touch most often (Python/REST snake_case; JavaScript uses camelCase):
  • text (required) and model_id — use kugel-3
  • voice_id — the voice to speak with (Using voices)
  • cfg_scale — expressiveness (see the guide below)
  • normalize + languagetext normalization; always set the language when you know it
  • word_timestampsword-level timestamps
  • speed — playback speed (see Speed Control below)
The complete table — every field with type, default, range, and error behavior — lives in the Generate Speech API reference.

CFG Scale Guide

The cfg_scale parameter controls how closely the model follows the voice characteristics. Accepted range: 1.22.5 (inclusive). Values outside this range are clamped into it.

Speed Control

The speed parameter adjusts playback rate using pitch-preserving time-stretching (WSOLA), so the voice pitch stays natural even at different speeds. Range: 0.8 (20% slower) to 1.2 (20% faster).
Dashboard: The playground in the KugelAudio dashboard includes a Slow / Normal / Fast speed toggle next to the model selector. Changes are reflected live in the SDK code snippet shown below the generator.
Speed applies to the whole request; to change the rate for just part of it, wrap that text in <prosody rate="...">:
For pauses, codes, and pronunciation fixes, see the Prompting guide: <break> tags, <spell> tags, and the unsupported-tags table.

Full Example with All Options

Async Generation

Playing Audio in the Browser

The JavaScript SDK provides utility functions for audio playback:

Pre-connecting for Low Latency

For latency-sensitive applications, pre-establish the WebSocket connection at startup to keep the handshake out of your first request — see Latency.
Without pre-connecting, the first TTS request includes WebSocket connection setup. Subsequent requests reuse the connection. See Latency for typical numbers. Pre-connecting moves this overhead to application startup.

Word Timestamps

Request per-word time alignments alongside the generated audio. Useful for subtitles, karaoke, lip-sync, and barge-in handling.
Word timestamps add no extra audio latency. For streaming use cases, see the Streaming Guide.

Next Steps

Streaming

Lower latency with real-time audio streaming

Text Processing

Text normalization and spell tags

Voices

Browse and use different voices

Models

Learn about available models