Skip to content

PyAI Speak · Streaming text to speech API

Streaming text to speech.
For natural replies.

Add natural spoken replies to chatbots, apps and phone agents with PyAI Speak. Stream audio as it arrives, keep your existing stack, and use runnable examples.

Your words. Your choice of voice. One speech API.

Your text → Your audioInteractive demo
Try your words. Take the code.

Choose a voice and listen. The code follows your settings.

62 / 240 characters

MP3 · No signup

Live demo: up to 30 requests per day.

import { writeFile } from "node:fs/promises";

const response = await fetch("https://api.pyai.com/v1/audio/speech", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PYAI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "pyai-speak",
    "input": "Hi, thanks for calling Acme Dental - how can I help you today?",
    "voice": "stock_ava_en_us",
    "response_format": "mp3"
  }),
});
if (!response.ok) throw new Error(await response.text());
await writeFile("speech.mp3", Buffer.from(await response.arrayBuffer()));

Set PYAI_API_KEY in your server environment. Saves your audio as speech.mp3.

Copy the code to use this text and voice, or explore the full Playground.

Open Playground

A real Speak API request, started only when you choose Generate & listen.

Natural speech, delivered progressivelyStock, cloned and designed voicesOpenAI-compatible API

Build the experience you need

Add spoken replies
to your app.

Start with the job: a chatbot that talks, replies during a phone conversation, or speech output for an AI agent. Use the existing guide or runnable example for that workflow.

01

Make your chatbot speak

Keep your chatbot and language model. Send its text replies to Speak from your backend and start playback as audio arrives in your app.

02

Add spoken replies to an existing phone app

Feed Speak audio into your current call transport. Keep your carrier and call controls; generating a spoken reply does not place a new call.

03

Use your voice-agent framework

Use Speak as the speech output in your LiveKit or Pipecat agent. Keep your chosen language model and use the existing adapters and complete agent examples.

Hear + Speak · Live demo

Ask a question. Hear the answer.

Record a question about PyAI, see Hear transcribe it, and listen to Speak read the reply. You can also type. The product answers are scripted; the transcription and speech use real PyAI APIs.

Three free questions, no signup required. Daily demo limits apply. Ready to build? Sign up from the demo or use your own key with the integration guide.

Available on ClawHub

Use PyAI Speak in OpenClaw.

Install the skills you need, connect your PyAI account through the official CLI, and ask your assistant to put them to work.

Speak · v1.0.0

Give your next answer a voice.

Turn your text into a spoken update, an accessible audio version or a voiceover with a supported PyAI voice.

Get Speak on ClawHub

A PyAI account and speech-generation permission. Speech generation consumes usage.

Create an account for Speak

A voice for the moment

A little character.
A lot of possibility.

A greeting needs warmth. An update needs clarity. Choose a voice that belongs in the experience you’re building.

01

Find the voice that fits.

Start with the stock catalog. Choose a voice for its character, language and delivery, then hear your own words before you commit.

Explore the voice catalog
02

Bring a voice of your own.

Enroll a voice you have permission to use, then synthesize with its voice ID through the same speech API. Cloning enrollment is free.

Explore voice cloning
03

Start with a description.

Describe the character you have in mind with prompt-to-voice design. Use the resulting voice in the same places you use a stock voice.

Explore voice design

Made for the pace of conversation

The next word.
Without the long wait.

Speak supports progressive streaming so applications can begin playback while audio is still arriving. Phone-ready formats let you connect speech to the way your callers actually listen.

Connect streaming speech to your app
Streaming synthesis

~53ms

Warm time to first audio byte

Measured in-region on the streaming path. First audio byte, rather than first spoken word. Cold-path TTFB is about 98 ms.

MP3WAVPCMG.711

Fits the way you build

Keep your application.
Change its voice layer.

Already using an OpenAI speech client? Point it at PyAI, use your key and choose a PyAI voice. The familiar request shape keeps the integration small.

ONE REQUEST, A USEFUL RESULT

Your textSpeakYour audio
  • Choose stock, cloned or designed voice IDs
  • Select the audio format your app needs
  • Play the result in your application
Configure the example above
Make it part ofPhone agentsProduct experiencesNotificationsAccessibilityInteractive applications

Speaker diarization

Know the words.
See who said them.

Speak creates audio. Pair it with Hear when you need speaker-labelled transcripts from recordings, with speaker turns and timestamps.

Reproducible task example · reviewed 17 November 2026

Stream a spoken reply into your app.

Start with text and an authorized project. The existing example distinguishes first audio bytes from playable output and stops on uncertain submission.

Open the task example

A little more detail

Good questions.
Clear answers.

Sandbox keys never bill; live usage requires available credit. See current rates ↗

What is Speak?

Speak is PyAI's text-to-speech (TTS) API. It turns text into natural speech over a low-latency streaming path, with 200 stock voices, free voice cloning, and prompt-to-voice design. It speaks the OpenAI /v1/audio/speech contract, so it's a drop-in replacement for OpenAI TTS.

How do I add voice to my chatbot?

Use Speak to turn your chatbot's text replies into natural audio. Keep your existing language model and app, submit text from your backend, and consume the audio response as it arrives. Listening, conversation logic and application actions remain separate parts of your app.

Can I add spoken replies to an existing phone app?

Yes. Use Speak for text-to-speech and send the returned audio through your existing call transport. You do not need to start a new call, buy a phone number or replace your carrier to use the speech API. The phone-speech example demonstrates one bounded streaming request.

Can I start playback before the whole response is ready?

Yes, with a streaming audio format and a player that consumes incoming chunks. The MP3 demo on this page waits for a complete clip; it does not demonstrate streaming playback. Use the streaming guide and check the effective delivery in your own application.

Can I send LLM tokens as they arrive?

Speak's HTTP endpoint takes a complete text string per request and can stream audio back. For a growing LLM reply, collect phrases, submit them in order, and cancel queued speech when the user interrupts. The LiveKit and Pipecat guides cover framework integration; audio streaming is not token-by-token text input.

Can I use speaker diarization with Speak?

PyAI supports speaker diarization through Hear async transcription jobs. Speak generates audio from text; Hear identifies speaker turns in recorded audio. Use Hear to produce a speaker-labelled transcript, then use Speak when your application needs spoken output.

How much does Speak TTS cost?

Voice cloning enrollment and prompt-to-voice design are free - you pay only for the audio you synthesize, billed per minute. Check our pricing page for the latest rates.

How do I migrate from OpenAI TTS?

Point your existing OpenAI SDK at https://api.pyai.com/v1 with your PyAI key. The /v1/audio/speech request shape matches, and the OpenAI preset voice names (alloy, echo, fable, onyx, nova, shimmer) are accepted and map to PyAI stock voices - so most code runs unchanged.

How many voices are there?

200 stock voices, plus your own cloned voices and prompt-designed voices. Browse the live catalog at GET /v1/voices, or pass an OpenAI preset name for drop-in compatibility.

What does voice cloning cost?

Cloning enrollment is free, as is prompt-to-voice design. You pay only for the audio you later synthesize with the voice, at the standard per-minute Speak rate.

Can I get telephony-ready audio?

Yes. Speak encodes server-side into mp3, wav, opus, pcm, or 8 kHz G.711 µ-law/A-law, so phone callers get exactly the format the line needs without a client-side resampler or µ-law encoder.

The next thing you build

Give your words
a voice.