SSML text to speech
Plain-text speech synthesis picks its own pauses and stress, which works fine until you need a specific word emphasized, a number read a particular way, or a two-second pause before the punchline. This SSML text to speech API accepts marked-up text and gives you that control directly, instead of hoping the model guesses right.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
What SSML is and why it exists
Speech Synthesis Markup Language is a W3C standard built specifically to let a writer tell a voice engine how to say something, not just what to say: where to pause, which syllable to stress, how to pronounce an acronym or a proper name, whether a string of digits is a date, a phone number or a plain quantity. It has been the industry way of controlling synthesized speech for years precisely because plain text is genuinely ambiguous — '2/3' can be a date, a fraction or a score, and only markup resolves that reliably.
How the request and response work
You submit SSML-tagged text in the request body instead of plain text, using standard tags for breaks, emphasis, phoneme pronunciation and prosody. The task is queued asynchronously and returns a task_id immediately; the rendered audio, respecting every pause and stress you marked, is delivered afterward via a signed webhook or a signed link valid for 24 hours. Malformed markup is caught and reported as a clear error rather than silently ignored, so you know immediately if a tag needs fixing.
Where the control actually matters
Plain TTS is fine for a notification; SSML earns its keep when the stakes are higher — an audiobook narrator that needs a dramatic pause, a pharmaceutical voice prompt that must pronounce a drug name exactly right, an e-learning module that stresses the one word a learner should not miss, or an automated announcement reading flight numbers and times where ambiguity is unacceptable. Anyone building voice content where the wrong emphasis changes the meaning reaches for markup instead of hoping plain text renders correctly.
Fitting it into automated content
Because SSML is just structured text, it is easy to generate programmatically — a content pipeline can wrap numbers in the right tags, insert breaks between sections, or mark up a name with a phonetic hint, all without human intervention. That is precisely the audience this endpoint serves: teams that already generate scripts algorithmically and need the resulting audio to sound deliberate, not default. Pricing reflects that lighter, more precise use — a small per-request base plus a per-1000-character rate on the marked-up text, with failed tasks never billed after automatic retries.
Access and how results are handled
This endpoint requires prepaid balance like every other one in the API; a request without balance returns HTTP 402 rather than a partial or degraded result. Submitted markup and generated audio are removed after the retention period and are never used to train models — delivery is strictly through your webhook or a temporary signed link, and nothing is kept beyond that window.
What you can do with it
Audiobook narration with pacing
Mark up chapter text with deliberate pauses and emphasis so the narration sounds directed rather than flat.
Pharmaceutical and medical prompts
Use phoneme tags to guarantee a drug or ingredient name is pronounced exactly right in an automated voice message.
Flight and transit announcements
Mark up flight numbers, times and gate letters so they are read unambiguously instead of guessed at by a plain-text engine.
E-learning emphasis cues
Stress the specific word in a lesson sentence that a learner must not miss, using emphasis tags instead of rewriting the sentence.
FAQ
What is SSML and how does the SSML text to speech API use it?
SSML is a markup standard for controlling speech synthesis; this endpoint accepts SSML-tagged text and renders audio that follows your specified pauses, emphasis and pronunciation.
Which SSML tags are supported?
Standard tags for breaks, emphasis, phoneme pronunciation and prosody are supported; malformed tags are rejected with a clear error rather than silently ignored.
Is the SSML text to speech API free?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
How much does SSML text to speech cost?
It costs $0.002 per request plus $0.0025 per 1000 characters of marked-up text, priced lower per character than plain TTS due to its more targeted use.
Do I need SSML for basic text to speech?
No, if you just need natural-sounding audio from plain text without controlling pauses or pronunciation, the standard text to speech endpoint is simpler and sufficient.
How do I get the generated audio?
The task runs asynchronously and returns a task_id immediately; the finished audio is delivered via a signed webhook or a signed link valid for 24 hours.
What happens if my SSML markup is invalid?
The request fails with a clear error describing the markup problem, and failed tasks are never charged.
Can I use SSML to control pronunciation of names or acronyms?
Yes, phoneme tags let you specify exact pronunciation for names, acronyms or technical terms that a default voice model might otherwise guess incorrectly.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/voice/tts-ssml \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"…"}'const res = await fetch("https://api.kit.forhosting.com/voice/tts-ssml", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "…"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/voice/tts-ssml",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "…"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/voice/tts-ssml", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"…"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"…"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/voice/tts-ssml", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "…"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "voice.tts_ssml",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 200 |
max_minutes | 180 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |