Text to speech
Turning written text into audio that does not sound like a GPS unit reading directions is harder than it looks, which is why most teams outsource it instead of building it. This text to speech API accepts plain text and returns natural voice audio, ready to drop into an app, a video, or an IVR menu.
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.
Why text alone isn't enough anymore
Written content increasingly needs an audio counterpart: an article read aloud for commuters, a product description spoken inside an app for accessibility, an automated phone line that greets callers by name. Early speech synthesis handled this with concatenated word fragments that sounded stitched together; modern voice models generate continuous, naturally paced speech instead, which is the baseline this endpoint targets — audio a listener can sit through without noticing it was machine-made.
What the request looks like
You send plain text in the request body and the task queues asynchronously, returning a task_id right away. Because speech generation for longer passages takes real processing time, the finished audio file arrives later — through a signed webhook, which is the recommended path for anything automated, or through a signed link valid for 24 hours if you'd rather poll manually. There is no synchronous 'wait and get audio back' mode; the architecture is built around not blocking your application while a voice file renders.
Where natural TTS actually gets used
Accessibility is the most direct use — screen-reader-style narration for users who prefer or need audio over text — but it is far from the only one. Product teams use it for in-app voice guidance, e-learning platforms narrate lesson text without hiring voice talent for every update, and marketing teams generate quick voiceovers for short videos without booking studio time. In every case the appeal is the same: text changes fast, and re-recording a human voice actor for every edit does not scale.
Cost and reliability
Pricing is a small per-request base fee plus a per-1000-character rate, so a short app notification costs a fraction of a full article. Every task gets up to three automatic retries before failing, and a failed task is never billed — you only pay for audio that actually got generated. That predictability matters most when this endpoint is called programmatically, hundreds of times a day, as part of a larger content pipeline rather than a one-off request.
Access, delivery and data handling
As with the rest of the API, this endpoint requires prepaid balance; without it, requests return HTTP 402 instead of a degraded free response. Generated audio and the text used to create it are deleted once the retention window ends and are never used to train any model — you get the file through your webhook or your signed link, and nothing lingers past that.
What you can do with it
Accessible article narration
Generate an audio version of every published article automatically so readers can listen instead of read.
In-app voice guidance
Turn dynamic UI text or onboarding tips into spoken audio without pre-recording every possible variant.
IVR and phone greetings
Produce voice prompts for a phone system from text that changes often, like store hours or account balances.
Quick video voiceovers
Convert a script into a spoken track for short marketing or social videos without booking studio time.
FAQ
How does the text to speech API work?
You send plain text, the task queues asynchronously and returns a task_id, and the generated voice audio is delivered later via signed webhook or a signed link valid 24 hours.
Is the 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 the text to speech API cost?
It costs $0.005 per request plus $0.008 per 1000 characters of input text.
What audio format is returned?
You receive a standard audio file suitable for playback in apps, IVR systems and video editors, delivered through your webhook or signed link.
Can I control pauses or pronunciation?
This endpoint takes plain text; if you need explicit control over pauses, emphasis or pronunciation, use the SSML text to speech endpoint instead.
Does it support Spanish or other languages?
This endpoint handles general natural voice synthesis; for native Spanish voices specifically, use the dedicated Spanish text to speech endpoint.
Why is text to speech asynchronous instead of instant?
Generating natural speech for longer text takes real processing time, so results are delivered via webhook or signed link rather than returned in the same request.
What happens if a text to speech task fails?
It is retried automatically up to three times at no cost; if it still fails you get a clear error and are never charged for it.
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 \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hola, este es un mensaje de prueba."}'const res = await fetch("https://api.kit.forhosting.com/voice/tts", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Hola, este es un mensaje de prueba."
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/voice/tts",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Hola, este es un mensaje de prueba."
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/voice/tts", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Hola, este es un mensaje de prueba."}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Hola, este es un mensaje de prueba."}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/voice/tts", 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": "Hola, este es un mensaje de prueba."
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "voice.tts",
"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. |