Call it
curl https://api.peume.com/v1/call/text-to-speech-2 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"voice_id": "your voice id",
"text": "your text",
"model": "example-voice-1"
}
}'const res = await fetch("https://api.peume.com/v1/call/text-to-speech-2", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"voice_id": "your voice id",
"text": "your text",
"model": "example-voice-1"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/text-to-speech-2",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"voice_id": "your voice id",
"text": "your text",
"model": "example-voice-1"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: text-to-speech-2.
Parameters
voice_idRequiredstringVoice to speak with: a public voice id from /voices, or a voice you cloned via /voices/clone.
textRequiredstringPlain text to speak, 1–5000 characters (no SSML).
languagestringLanguage code of the text, e.g. en, es, ja. Omit to detect it from the text; a wrong code gives speech with that language's accent.
expressiveness_boostnumber0.0–1.0, default 1.0. recommends 0.5 for the closest match to a cloned speaker.
with_timestampsbooleantrue adds original_characters and original_words: the start and end time of each character and word, for captions. Free.
modelstringheygen-voice-1 (default; best quality, $0.03 per 1,000 characters) or heygen-voice-1-turbo (faster, $0.004 per 1,000).
heygen-voice-1 · heygen-voice-1-turbo
Example: example-voice-1
