Convert your text to natural AI speech with our fast web app and powerful API. Enjoy unlimited free usage for websites, apps, and projects — SEO-friendly and easy to integrate!
POST
(Recommended) or GET
requests to index.php?api=1
.text
and voice
(male
/female
) parameters. Send in POST body (form-data/x-www-form-urlencoded) or GET query string.queued
, processing
, completed
, failed
).queue_position
(jobs ahead) for queued
status.output_urlpath
upon completion.hash
(10-char SHA1) for identification and de-duplication.201 Created
for newly created jobs, 200 OK
when polling or finding existing jobs.GET
is supported but not recommended due to:
POST
for all API interactions.
Note: This API endpoint requires a separate background worker process to actually process the 'queued' jobs.
Send POST
or GET
requests to http://experimentaldata.co.uk/text_to_speech/?api=1
with text
and voice
parameters.
curl -X POST \
'http://experimentaldata.co.uk/text_to_speech/?api=1' \
-F 'text=This is a POST API test.' \
-F 'voice=female'
(Polling uses the exact same POST request.)
http://experimentaldata.co.uk/text_to_speech/?api=1&text=Hello+world!&voice=male
(Warning: Subject to URL length limits and other issues mentioned above.)
{
"id": 125,
"hash": "a1b2c3d4e5",
"text": "This is an API test.",
"voice": "female",
"status": "completed",
"created_at": "2023-10-28 11:30:00",
"updated_at": "2023-10-28 11:30:05",
"processing_started_at": "2023-10-28 11:30:02",
"error_message": null,
"output_urlpath": "https://yourdomain.com/text_to_speech/output/a1b2c3d4e5.wav",
"queue_position": 0
}
{
"status": "error",
"message": "Parameter 'text' cannot be empty."
}
The service generates audio files in the standard WAV format.
Yes, the current limit is 5000 characters per request. For longer texts, please submit them in multiple parts. Using the API via GET
may impose lower practical limits due to URL length restrictions.
There is no guaranteed retention period. Files may be removed periodically. Please download your generated audio promptly.
While GET
is supported for flexibility, POST
is strongly recommended for API interactions. Using POST
aligns with web standards for submitting data or requesting actions that change state (like creating a job queue entry). It also avoids issues with URL length limits, browser/proxy caching, and prevents sensitive text from appearing directly in URLs or server logs.
This PHP script acts as the API endpoint and queue manager. A separate, independent background worker script/service (not included) handles the actual audio generation using a TTS engine and updates the job status in the database.
Disclaimer: Use responsibly. This is a free service with limitations. Audio quality depends on the backend TTS engine. Do not submit sensitive data. Generated files are not guaranteed permanent storage.