For developers / Voice AI use cases
Build a
voice-cloning product

Create a voice for each user and synthesize with it on demand.
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
Enroll a voice
Submit a reference clip; enrollment is free and returns a voice_id.
- 02
Synthesize
Pass the voice_id to /v1/audio/speech and stream the result.
- 03
Scale per-user
Associate the returned voice ID with the right user and apply your own consent and access controls.
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 build a voice-cloning product?
Enroll an authorized reference voice, then synthesize with its voice ID through Speak. You can also design a voice from a written description.
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.