elevenlabs
Elevenlabs — Text-to-Speech (TTS) — Convert text into expressive AI voiceovers with studio-grade natural pauses using Elevenlabs — Text-to-Speech — prompts up to 40,000 characters long.
elevenlabsGET /api/v1/models/elevenlabs/serversDetailed API pricing by parameter configuration
Actual unit price (credits) deducted from your wallet when calling POST /v1/generations (or check it in advance with POST /v1/generations/estimate).
Input — request parameters
/v1/generationsSend JSON in the standard structure "model": "elevenlabs", "server": "sv21" and the parameters below at the same level. Parameters not listed in the table are rejected (400).
| Parameter | Type | Supported values | Description |
|---|---|---|---|
modelrequired | string | elevenlabs | The package ID itself or the canonical model line ID (combined with the server selection parameter below). |
server | string | sv21auto | Pins the server (SV) that runs the order (the alias server_id is also accepted), or auto to pick the best-priced healthy server automatically. Check live servers via GET /v1/models/elevenlabs/servers. |
promptrequired | string | Up to 40,000 characters | Text to read aloud |
p_voice_idrequired | enum | hpp4J3VqNfWAUOO0d1UsCwhRBWXzGAHq8TQ4Fs17EXAVITQu4vr4xnSDxMaLFGY2WhTYpPnrIDTdsKH5IKne3meq5aSn9XLyUdCDJBFqnCBsd6RMkjVDRZzbN2lVS1w4EtoT3dr4eOWOSAz9YHcvj6GT2YYXdXwwSOYHLrjzK2X1ezoPC6crTX3LPaxmHKxFdv7VOQHJXb7hH8MSUJpSbSDYk0k2XrExE9yKIg1WjnnlVkGXbIHbv24MWmeRgasZH58ocgSgspJ2msm6clMCkdW9cjVigY5qzO86Huf0OWaliP95p4xoKVk53GoZ742BnPczCjzI2devNBz1zQrbonwK4e9ZLuTAKqWW03F9pFZP5JQG7iQjIQuC4BkupNInz6obpgDQGcFmaJgBpqHfZKP75CvOlQylNhV4 Default: | Voice — Fetched LIVE from ElevenLabs account |
p_model_idrequired | enum | eleven_v4eleven_v4_turboeleven_v3eleven_v3_conversationaleleven_multilingual_v2eleven_flash_v2_5eleven_turbo_v2_5 Default: | Voice model — Set “Voice model” for the generation request. |
p_stability | integer | 0 – 100 Default: | Stability — 0–100 (default 50) |
p_similarity_boost | integer | 0 – 100 Default: | Voice similarity — 0–100 (default 75) |
p_style | integer | 0 – 100 Default: | Style — 0–100 (0 = natural) |
p_speed | number | 0.7 – 1.2 Default: | Speed — 0.7–1.2 (default 1) |
p_language_code | string | Up to 2,000 characters | Language code (e.g. vi, en) — Set “Language code (e.g. vi, en)” for the generation request. |
- File parameters (string URL) accept a public http(s) link — the server downloads it — or a URL returned by the file upload API POST /account/ai/uploads.
- Optional parameters left blank use their default values. You can also send an Idempotency-Key header to retry safely without being charged twice.
Sample request (cURL)
curl -X POST https://promptflow.web.id/api/v1/generations \
-H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{
"model": "elevenlabs",
"server": "sv21",
"prompt": "An astronaut cat",
"p_voice_id": "hpp4J3VqNfWAUOO0d1Us",
"p_model_id": "eleven_v4",
"p_stability": 50,
"p_similarity_boost": 75,
"p_style": 0,
"p_speed": 1
}'Complete integration code sample (Upload file → Create job → Poll result)
Python 3
import os, time, requests
BASE = "https://promptflow.web.id/api"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}
r = requests.post(f"{BASE}/v1/generations", headers=HEADERS, json={
"model": "elevenlabs",
"server": "sv21",
"prompt": "An astronaut cat",
"p_voice_id": "hpp4J3VqNfWAUOO0d1Us",
"p_model_id": "eleven_v4",
"p_stability": 50,
"p_similarity_boost": 75,
"p_style": 0,
"p_speed": 1
}, timeout=60)
gen = r.json()
if not r.ok:
raise RuntimeError(gen.get("message") or r.text)
while gen.get("status") in ("queued", "processing"):
time.sleep(5)
gen = requests.get(f"{BASE}/v1/generations/{gen['id']}", headers=HEADERS, timeout=60).json()
if gen.get("status") != "succeeded":
raise RuntimeError(gen.get("error") or gen.get("status"))
print("Result:", gen["output"])Node.js (18+)
const BASE = "https://promptflow.web.id/api";
const headers = { "X-API-Key": process.env.API_KEY, "Content-Type": "application/json" };
const createRes = await fetch(`${BASE}/v1/generations`, {
method: "POST",
headers,
body: JSON.stringify({
"model": "elevenlabs",
"server": "sv21",
"prompt": "An astronaut cat",
"p_voice_id": "hpp4J3VqNfWAUOO0d1Us",
"p_model_id": "eleven_v4",
"p_stability": 50,
"p_similarity_boost": 75,
"p_style": 0,
"p_speed": 1
}),
});
let gen = await createRes.json();
if (!createRes.ok) throw new Error(gen.message || createRes.statusText);
while (["queued", "processing"].includes(gen.status)) {
await new Promise((r) => setTimeout(r, 5000));
gen = await fetch(`${BASE}/v1/generations/${gen.id}`, { headers }).then((r) => r.json());
}
if (gen.status !== "succeeded") throw new Error(gen.error ?? gen.status);
console.log("Result:", gen.output);Output — response
Jobs run asynchronously. POST /v1/generations immediately returns a generation object with status queued or processing; poll GET /v1/generations/{id} every 5–10 seconds until status is succeeded, failed or cancelled.
/v1/generations/{id}{
"id": "3f1c...-uuid",
"object": "generation",
"code": "T8KQ2M4X",
"model": "elevenlabs",
"canonical_model": "elevenlabs",
"server_id": "sv21",
"server_name": "SV21",
"status": "succeeded", // queued | processing | succeeded | failed | cancelled
"progress": 100,
"cost": 2400, // amount charged
"currency": "CREDITS",
"refunded": false,
"output": {
"type": "audio",
"files": [{ "url": "https://promptflow.web.id/uploads/ai/outputs/....mp3", "type": "audio", "name": "audio.mp3" }],
"text": null
},
"error": null,
"created_at": "2026-10-30T08:00:00.000Z",
"completed_at": "2026-10-30T08:01:12.000Z"
}| Field | Meaning |
|---|---|
| model / server_id | The exact package ID and server (SV) that executed the task. |
| output.files[].url | Result file links — download them to your own system; files on our server may be cleaned up after some time. |
| output.text | Text content (only for models that return text). |
| cost | Amount in credits charged to your balance; refunded automatically on failure or cancellation (refunded = true). |
| error | Error reason when status = failed. |
Get a quote before running
/v1/generations/estimateSame body as POST /v1/generations, without running or charging (your account's personal discount %, if any, is applied automatically).
# => {
# "object": "estimate",
# "model": "elevenlabs",
# "canonical_model": "elevenlabs",
# "server_id": "sv21",
# "server_name": "SV21",
# "cost": 2400,
# "currency": "CREDITS"
# }