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.
PyAI Speak · Streaming text to speech API
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.
Choose a voice and listen. The code follows your settings.
62 / 240 characters
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 PlaygroundA real Speak API request, started only when you choose Generate & listen.
Build the experience you need
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.
Keep your chatbot and language model. Send its text replies to Speak from your backend and start playback as audio arrives in your 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.
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
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
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
Turn your text into a spoken update, an accessible audio version or a voiceover with a supported PyAI voice.
Get Speak on ClawHubA PyAI account and speech-generation permission. Speech generation consumes usage.
Create an account for SpeakA voice for the moment
A greeting needs warmth. An update needs clarity. Choose a voice that belongs in the experience you’re building.
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 catalogEnroll a voice you have permission to use, then synthesize with its voice ID through the same speech API. Cloning enrollment is free.
Explore voice cloningDescribe 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 designMade for the pace of conversation
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~53ms
Measured in-region on the streaming path. First audio byte, rather than first spoken word. Cold-path TTFB is about 98 ms.
Fits the way you build
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
Speaker diarization
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
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 exampleA little more detail
Sandbox keys never bill; live usage requires available credit. See current rates ↗
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.