Generate Text-to-Speech
Text To Speech
Text-to-Speech Stream
Generate speech from Arabic text using a specific model. Supports both streaming and non-streaming responses.
POST
Generate Text-to-Speech
Generate speech from Arabic text with streaming PCM16 audio output. Audio chunks are streamed as they’re generated, providing low-latency audio delivery.
402 Payment Required
Authentication
Requires API key authentication viax-api-key header.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model_id | string | Yes | The model identifier to use for generation |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
voice_id | string | Yes | The voice ID to use for synthesis |
text | string | Yes | The Arabic text to convert to speech |
stability | number | Yes | Voice stability (0.0 to 1.0). Higher values produce more consistent output |
speed | number | No | Speech speed (0.7 to 1.2, default 1.0). Values below 1.0 slow down speech, above 1.0 speed it up |
streaming | boolean | Yes | Must be true for streaming response |
Example Request Body
Response
Status Code:200 OK
Headers:
Content-Type: audio/raw;codec=pcm16;rate=24000;channels=1Cache-Control: no-cacheConnection: keep-alive
Error Responses
400 Bad RequestExample Usage
JavaScript
Python
Cost Calculation
The cost is calculated based on:- Text length (number of characters)
- Model cost per character
Wallet Balance: Ensure your wallet has sufficient balance before making requests. Check your balance in the Munsit dashboard.
Authorizations
API key for authentication
Path Parameters
The model identifier to use for generation
Body
application/json
The voice ID to use for synthesis
The Arabic text to convert to speech
Voice stability (0.0 to 1.0). Higher values produce more consistent output
Required range:
0 <= x <= 1If true, returns streaming PCM16 audio. If false, returns complete WAV file
Speech speed multiplier (0.7 to 1.2). Values below 1.0 slow down speech, values above 1.0 speed it up
Required range:
0.7 <= x <= 1.2Response
Audio response (streaming or complete file)
PCM16 audio stream (when streaming=true)
