Skip to main content
POST
/
api
/
v1
/
AQL
/
Stream
/
TextToSpeech
Stream Speech
curl --request POST \
  --url https://gateway.widebot.net/api/v1/AQL/Stream/TextToSpeech \
  --header 'Content-Type: application/json' \
  --header 'x-bot: <api-key>' \
  --header 'x-user-auth: <api-key>' \
  --data '
{
  "TextMessage": "مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي",
  "LanguageCode": "ar",
  "Speaker": "Hesham",
  "Temperature": 0.8,
  "OutputSampleRate": 24000,
  "StreamChunkSize": 300
}
'
"data: {\"chunk_id\": 1, \"audio_data\": \"UklGRl4AAABXQVZFZm10...\", \"chunk_size\": 1024}\n\ndata: {\"chunk_id\": 2, \"audio_data\": \"VFJBVEVZRjQAAABXQVZF...\", \"chunk_size\": 1024}\n\ndata: {\"chunk_id\": 3, \"audio_data\": \"ZGF0YQQ=\", \"chunk_size\": 512}\n\ndata: {\"status\": \"complete\", \"total_chunks\": 3, \"total_duration\": 4.2, \"consumption\": \"58/15000\"}\n"

Authorizations

x-user-auth
string
header
required

Your API key from account settings

x-bot
string
header
required

Your bot ID from account settings

Body

application/json
TextMessage
string
required

Text to convert to speech

Example:

"مرحباً! هذا بث صوتي لحظي."

LanguageCode
string
required

Language code for speech

Example:

"ar"

Speaker
string
required

Voice to use for generation

Example:

"Hesham"

Temperature
number<float>

Controls speech variation

Required range: 0 <= x <= 1
Example:

0.8

OutputSampleRate
integer

Audio sample rate

Example:

24000

StreamChunkSize
integer

Size of audio chunks for streaming

Required range: x <= 400
Example:

300

Response

200 - text/event-stream

Streaming audio generation with progressive chunks

Server-sent events with audio chunks