REST API
Base URL: https://tts.ummahitsolutions.com/api/v1
Authenticate every request with your API key (create one on the API keys page):
Authorization: Bearer YOUR_API_KEY
Generation is asynchronous: you submit text, then check the status until it is completed, then download the audio.
The first request after a quiet period can take 1–3 minutes while the voice engine wakes up (status: "starting").
Each character costs 1 credit; failed generations are refunded automatically. Max 5,000 characters per request. Limit: 60 requests/minute.
1. List voices
curl https://tts.ummahitsolutions.com/api/v1/voices \
-H "Authorization: Bearer YOUR_API_KEY"
Languages & dialects
curl https://tts.ummahitsolutions.com/api/v1/languages \
-H "Authorization: Bearer YOUR_API_KEY"
| Code | Name | Script | Voices |
|---|---|---|---|
en | English (English) | Latin | any voice |
ur | Urdu (اردو) | Urdu (Nastaliq), RTL | any voice |
ar | Arabic (العربية) | Arabic (Naskh), RTL | any voice |
dhanni | Dhanni (Chakwal) (ڈھنی) | Shahmukhi (Nastaliq), RTL | native voices only — pass a voice_id of this language, or omit it to use the default |
2. Create speech
curl -X POST https://tts.ummahitsolutions.com/api/v1/tts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"السلام علیکم! یہ ایک ٹیسٹ ہے۔","language":"ur","voice_id":"VOICE_ID","speed":1.0,"format":"mp3"}'
| Field | Required | Description |
|---|---|---|
text | yes | Up to 5,000 characters |
voice_id | no | From /voices. Omit to use the language's default voice (or an automatic voice). |
language | no | A code from /languages: en, ur, ar, dhanni (omit = auto-detect) |
speed | no | 0.5 – 2.0 (default 1.0) |
format | no | mp3 (default) or wav |
Response 202:
{"id":"9b2f…","status":"queued","characters":31,"credits":31,"audio_url":null, "engine":{"message":"Waiting in queue…","progress":0}, …}
3. Check status
curl https://tts.ummahitsolutions.com/api/v1/generations/ID \
-H "Authorization: Bearer YOUR_API_KEY"
status is one of queued, starting, processing, completed, failed. Poll every 2–5 seconds.
4. Download audio
curl -L https://tts.ummahitsolutions.com/api/v1/generations/ID/audio \
-H "Authorization: Bearer YOUR_API_KEY" -o speech.mp3
Account
curl https://tts.ummahitsolutions.com/api/v1/account -H "Authorization: Bearer YOUR_API_KEY"
Errors
| Code | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 403 | Account suspended |
| 422 | Validation error, e.g. not enough credits or text too long (errors explains) |
| 429 | Too many requests |
Python example
import time, requests
API = "https://tts.ummahitsolutions.com/api/v1"
H = {"Authorization": "Bearer YOUR_API_KEY"}
job = requests.post(f"{API}/tts", headers=H, json={"text": "Hello from Ummah Voice", "language": "en"}).json()
while job["status"] not in ("completed", "failed"):
time.sleep(3)
job = requests.get(f"{API}/generations/{job['id']}", headers=H).json()
if job["status"] == "completed":
open("speech.mp3", "wb").write(requests.get(job["audio_url"], headers=H).content)
else:
print("Failed:", job["error"])