SILMA TTS API

WebSocket Streaming

Establish a full-duplex connection for TTS.
Handshake: Upgrade request to wss://api.silma.ai/tts/v2/ws/stream.
Process:

  1. Client sends TTSRequest JSON.
  2. Server sends messages with status: started, streaming, completed, or failed.
get
https://api.silma.ai/tts/v2/ws/stream

Response

101

Switching Protocols to WebSocket.

get/ws/stream
 
101

TTSRequest

object
model_idstringrequired

The model id to use (KSA dialect or MSA).

Allowed values:silma-tts-v2-msasilma-tts-v2-ksa

textstringrequired

The text to synthesize into speech.

<= 250 characters

Example:أنا نموذج سِلْمَا الجديد لتحويل النص إلى كلام، أستطيع التحدث باللغة العربية مع أو بدون تشكيل.

creativitynumber(float)

Variance in speech prosody.

Default:0.2

speednumber(float)

Speed of the generated speech.

Default:0.2

voice_idstringrequired

The ID of the pre-defined voice.

Allowed values:sarahsalmasalwasajasultansalmansulaimansalim

user_idstring

Optional user identifier, needed only for pronunciation overrides and loading custom voices. Find it here https://app.silma.ai/api-keys

custom_audio_idstring
  • The ID representing your uploaded custom voice to be cloned.
  • This should be an ID for a voice (ex:voice_1769817467123) in the “Custom Voices” section in https://app.silma.ai/voices.
  • If you use this parameter then you should use the “user_id” parameter as well.
enable_server_pronunciation_overridesboolean

This indicates that you have added custom pronunciation overrides to your account via https://app.silma.ai/control. Enabling this feature will automatically customize the model based on your overrides.

Default:false

Example

ErrorResponse

object
detailstring

Error message details.

Example