Call it
curl https://api.peume.com/v1/call/text-to-speech-4 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"text": "your text",
"model": "s2.1-pro"
}
}'const res = await fetch("https://api.peume.com/v1/call/text-to-speech-4", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"text": "your text",
"model": "s2.1-pro"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/text-to-speech-4",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"text": "your text",
"model": "s2.1-pro"
}
},
)
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-4.
Parameters
textRequiredstringText to speak (1–5000 characters). Billed per UTF-8 byte: an English letter is 1 byte, a Chinese character 3. Steer delivery inline with bracket cues, e.g. '[whispers] I can't believe it [laughs]'. For dialogue, prefix turns with <|speaker:0|>, <|speaker:1|>… and pass one voice_id per speaker.
modelstrings2.1-pro (default; best quality/latency, 83 languages), s2-pro (previous generation, same price), or drama-3 (newest; direct each line in plain language, e.g. '[low, gravelly, tired] Status report.'; priced higher).
s2.1-pro · s2-pro · drama-3
Example: s2.1-pro
voice_idstringVoice to speak with: a public voice id from /voices, or a voice you cloned via /voices/clone. For multi-speaker dialogue pass an array (2–10 ids), one per <|speaker:N|>. Omit for the default voice.
reference_audio_urlstringInstant voice cloning without saving a voice: HTTPS URL of a clean 10–30 s recording (WAV/MP3/FLAC, ≤ 20 MB) to imitate. Requires reference_text; cannot be combined with voice_id.
reference_textstringExact transcript of reference_audio_url (not billed).
temperaturenumberExpressiveness 0–1 (higher = more varied). Upstream default 0.7.
top_pnumberNucleus sampling 0–1. Upstream default 0.7.
prosodyobjectlatencystringQuality/latency trade-off: normal (best quality, default), balanced, or low.
normal · balanced · low
normalizebooleanNormalize English/Chinese text (numbers, dates) before speaking. Default true.
