Skip to main content
POST
/
v1
/
realtime
/
tts
Generates an audio file from a text string (not streamed).
curl --request POST \
  --url https://api.tryhamsa.com/v1/realtime/tts \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "مرحباً بكم في جميعاً في همسة!",
  "speaker": "Amjad",
  "dialect": "pls",
  "mulaw": false
}
'
"<string>"

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Body

application/json
text
string
required

The text to be generated as an aduio file.

Example:

"مرحباً بكم في جميعاً في همسة!"

speaker
string
required

The speaker (voice) name. Pick a voice that matches the chosen dialect — see the dialect field for voice examples per dialect. You can also pass the UUID of a custom cloned voice, but you must first preload it via the Preload Cloned Voice endpoint.

Example:

"Amjad"

dialect
enum<string>

The dialect to synthesize, identified by its country/region code. Voice examples per dialect:

  • pls (Palestinian) — Amjad, Layan
  • egy (Egyptian) — Mariam, Samir
  • syr (Syrian) — Dalal, Mais
  • irq (Iraqi) — Lyali, Fatma
  • jor (Jordanian) — Lana, Jasem
  • leb (Lebanese) — Carla, Majd
  • ksa (Saudi) — Hiba, Fahd
  • uae (Emirati) — Salma, Dima
  • bah (Bahraini) — Mazen, Ruba
  • qat (Qatari) — Deema, Faisal
  • kuw (Kuwaiti) — Mai, Hatem
  • oma (Omani) — Aisha, Jaber
  • msa (Modern Standard Arabic / Fusha) — Salem, Tamim
  • ar-sa (Arabic – Gulf) — Khalid, Rahma
  • en (English) — Emma, James
Available options:
pls,
egy,
syr,
irq,
jor,
leb,
ksa,
uae,
bah,
qat,
kuw,
oma,
msa,
ar-sa,
en
Example:

"pls"

mulaw
boolean
default:false

Whether to use 'Mu-Law' algorithm in voice signal processing or not.

Example:

false

Response

Successful response

The response is of type file.