Capabilities
Text to speech
Pendra turns text into natural-sounding speech — voice announcements, audio versions of written content, spoken responses for assistants and IVR systems. It's OpenAI-compatible, so existing text-to-speech code works against Pendra by swapping the base URL and key.
Generate speech
Send a model and the input text (up to
4,096 characters) and you get back a WAV file, ready to save or play.
Pick a voice from the model's preset voices, or leave it out
to use the model's default. The Pendra SDKs (0.17 and later) also tell you
which worker generated it, as speech.pendra.worker; the
OpenAI SDKs work too, since the endpoint is OpenAI-compatible.
from pendra import Pendra
client = Pendra()
speech = client.audio.speech.create(
model="your-speech-model", # an id from /models?type=speech
input="Good morning, and welcome to today's briefing.",
)
speech.write_to_file("speech.wav")
Voices
Each speech model ships with a set of preset voices. The
/models?type=speech entry for a model
lists its voices and the default_voice used when
a request omits one — so you can present the choices in your product and
default sensibly. Passing a voice the model doesn't have returns a clear
error.
Output format
Speech is returned as a WAV file (24 kHz, 16-bit mono) — playable
everywhere and easy to convert if you need something smaller for
delivery (e.g. ffmpeg -i speech.wav speech.mp3).
Finding speech models
The speech models available to you are the ones your connected workers
serve — list them, with their voices, at
/models?type=speech, and pass one of their
ids as model.