Skip to main content
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.

Authentication

Requires API key authentication via x-api-key header.

Path Parameters

Request Body

Example Request Body

Response

Status Code: 200 OK Headers:
  • Content-Type: audio/raw;codec=pcm16;rate=24000;channels=1
  • Cache-Control: no-cache
  • Connection: keep-alive
Body: Stream of PCM16 audio chunks (24kHz, mono)

Error Responses

400 Bad Request
402 Payment Required

Example Usage

JavaScript

Python

Cost Calculation

The cost is calculated based on:
  • Text length (number of characters)
  • Model cost per character
Cost is deducted from your wallet balance upon successful generation.
Wallet Balance: Ensure your wallet has sufficient balance before making requests. Check your balance in the Munsit dashboard.

Authorizations

x-api-key
string
header
required

API key for authentication

Path Parameters

model_id
string
required

The model identifier to use for generation

Body

application/json
voice_id
string
required

The voice ID to use for synthesis

text
string
required

The Arabic text to convert to speech

stability
number
required

Voice stability (0.0 to 1.0). Higher values produce more consistent output

Required range: 0 <= x <= 1
streaming
boolean
required

If true, returns streaming PCM16 audio. If false, returns complete WAV file

speed
number
default:1

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.2

Response

Audio response (streaming or complete file)

PCM16 audio stream (when streaming=true)