---
title: "Generates a streamed audio file from a text string."
method: POST
path: "/v1/realtime/tts-stream"
---

# Generates a streamed audio file from a text string.

`POST /v1/realtime/tts-stream`

From the user's perspective, this is a standard request. In the response, we include specific headers: 'Transfer-Encoding' is set to 'chunked' to enable streaming, 'Connection' is set to 'keep-alive' to maintain the connection, and 'Content-Type' is set to 'audio/wav' to indicate the media type. These headers allow the client to stream audio data from the server in real time.  Important Note: after collecting the chunks, you need to add the wav header manually to the data. If you wish to get a wav header, please use the [Generate TTS File Data API](/api-reference/endpoint/rt-generate-tts).

## Request body

- RtTtsRequest
  - `text` string, required — The text to be generated as an aduio file.
  - `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](/src/api-reference/endpoint/preload-cloned-tts-voice).
  - `dialect` 'pls' | 'egy' | 'syr' | 'irq' | 'jor' | 'leb' | 'ksa' | 'uae' | 'bah' | 'qat' | 'kuw' | 'oma' | 'msa' | 'ar-sa' | 'en' — 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
  - `mulaw` boolean — Whether to use 'Mu-Law' algorithm in voice signal processing or not.
  - `expressiveness` number — Controls how expressive the generated speech sounds. `0` is flat and monotone, `1` is the natural default, and `2` is highly expressive.

## Response `200`

Streamed Successful Response - Chunked

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `500` — Server Side Error

---

[API](https://skmtc.net/tryhamsa/apis/hamsa-api.md) · [All operations](https://skmtc.net/tryhamsa/apis/hamsa-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryhamsa/hamsa-api/versions/ecbeb5d8dc13/schema)
