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": "Majd",
  "dialect": "pls",
  "mulaw": false
}'
This response does not have an example.

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 <api-key>'

Body

application/json
text
string
required

The text to be generated as an aduio file.

Example:

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

speaker
string
required

The speaker name, Suggestions: Amjad, Lyali, Salma, Mariam, Dalal, Lana, Jasem, Samir, Carla, Nada, or you can provide another values from the voice agents dashboard. You can also provide your own cloned voice's id here in the speaker field, but you need to preload that voice into the system first from here

Example:

"Majd"

dialect
enum<string>

The dialect of each country by its country code. Recommended voices per dialect are: pls (Palestinian): Amjad, Layan, Talin, Rema, Ali; leb (Lebanese): Carla, Majd; jor (Jordanian): Lana, Jasem, Nada, Sarah; syr (Syrian): Dalal, Mais; ksa (Saudi): Hiba, Khadija, Fahd, Jasem; bah (Bahraini): Mazen, Ruba; uae (Emirati): Salma, Dima; egy (Egyptian): Mariam, Samir, Nada, Ali, Ahmed; irq (Iraqi): Lyali, Fatma.

Available options:
pls,
egy,
syr,
irq,
jor,
leb,
ksa,
uae,
bah,
qat,
msa
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.