For developers / Voice AI use cases
A voice for
your app

Add natural text-to-speech with progressive audio playback.
A practical way to start
A few clear steps.
One useful workflow.
Connect the pieces for this use case, then test the full experience with the calls, recordings or text your users will bring.
- 01
Pick a voice
Choose a stock voice, or your own cloned or designed voice.
- 02
Stream it
Play progressively from the first audio bytes instead of waiting for the whole file.
- 03
Ship it
Use the OpenAI-compatible request shape, then verify the voice, audio format and playback in your application.
Try the speech layer
Give your words
a voice.
Choose a voice, edit a short line and play the Speak response. The generated example updates with your choices, ready to use in your application.
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 PlaygroundThe right part of the voice stack
Built around your job.
Powered by PyAI.
Explore the product behind each part of this use case, including its controls, API examples and integration requirements.
Before you take it further
A little more detail.
A clearer next step.
Start with a sandbox key and a representative input. Review the result before widening the workflow.
How does PyAI support a voice for your app?
Use Speak with the /v1/audio/speech contract your OpenAI client already uses. Stream the response progressively while keeping your application in control of playback.
What does it cost to test this use case?
Sandbox keys never bill, so you can try the product before sending funded live traffic. Live usage requires available credit and uses the rates for the products in your workflow. See current pricing and account terms before a production rollout.
Can we keep our existing application?
Yes. Hear and Speak support OpenAI-compatible request shapes. Omni uses its native realtime protocol through the official SDK. You can also configure a managed Agent visually and connect the knowledge and tools your business already uses.
How do we keep the experience useful in production?
Test representative recordings or text, check the output in your own application, and keep error handling and retries visible. Hear produces transcripts, Speak produces speech, and Trace or Recap add review and summaries where they fit the workflow.
Put the idea into motion.
Sandbox keys never bill. Fund a live key when you go to production.