Skip to main content
API key is optional but recommended for better service limits.

Base URL

http://tts.sawt.sa/

Authentication

Authorization
Bearer your-api-key-here (optional)

POST /v1/text-to-speech/generate

Generate speech from text using streaming response.

Request Headers

Authorization
Bearer YOUR_API_KEY (optional)
Content-Type
required
application/json

Request Body

text
string
required
Text to convert to speech
format
string
required
Audio format for output (e.g., “wav”)
chunk_size
number
required
Size of audio chunks for streaming (e.g., 128, 32)
{
  "text": "السلام عليكم، كيف الحال",
  "format": "wav",
  "chunk_size": 32
}

Response

The API returns a streaming audio response with:
Content-Type
string
audio/ (e.g., audio/wav)
Response Body
binary
Streaming audio data in the specified format

Error Codes

Status CodeDescription
200Success - Audio stream returned
400Bad Request - Invalid request body or parameters
401Unauthorized - Invalid or missing API key
422Validation Error - Request body validation failed
500Internal Server Error - Server processing error
curl -X POST "http://tts.sawt.sa/v1/text-to-speech/generate" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"text": "السلام عليكم، كيف الحال", "format": "wav", "chunk_size": 32}' \
  --output output.wav