2.3.1OAS 3.1

High-quality Arabic Text-to-Speech API supporting multiple dialects and streaming modes.

API Base URL
  • Server 1:https://api.silma.ai/tts/v2
Security
ApiKeyAuth (apiKey)

An API key is a token that you provide when making API calls. Include the token in a header parameter called apiKey.

Example: apiKey: 123

Binary Waveform Stream

Returns a raw stream of float32 audio bytes.

post
https://api.silma.ai/tts/v2/stream

Body

application/json

StreamTTSRequest

model_idstringrequired

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

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

textstringrequired
  • The text to synthesize into speech (up to 1000 characters).
  • To pronounce phone numbers correctly use <STAG_PN>92005455</STAG_PN>
  • To pronounce emails correctly use <STAG_EMAIL>test@silma.ai</STAG_EMAIL>
  • To pronounce links correctly use <STAG_LINK>www.silma.ai</STAG_LINK>
  • To insert a pause use the SSML break tag, e.g. <break time="500ms"/> or <break time="1.5s"/> (max 5s per pause; a bare <break/> pauses 0.5s). Only the “time” attribute is supported.
  • Break tags do not count toward the character limit or billed characters.

<= 1000 characters

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

creativitynumber(float)

Variance in speech prosody.

Default:0.2

speednumber(float)DEPRECATED
  • Deprecated. Kept for backward compatibility and behaves as before.
  • Use “speech_rate” to control how fast the voice speaks.

Default:0.4

speech_ratenumber(float)
  • Speaking rate multiplier. 1.0 is the voice’s natural pace, 1.2 is 20% faster and 0.8 is 20% slower.
  • The voice and its pitch stay the same at every rate.

Default:1

>= 0.7<= 1.4

voice_idstringrequired
  • The ID of the pre-defined voice.
  • English voices: [james, emma, isabella, oliver]
  • Arabic voices: [abdulaziz, fahd, layla, maryam, nouf, noura, omar, reema, yusuf, khalid]
  • Legacy Arabic voices: [salwa, saja, sultan, salman, sulaiman, salim]

Allowed values:jamesemmaisabellaoliverabdulazizfahdlaylamaryamnoufnouraomarreemayusufkhalidsalwasajasultansalmansulaimansalim

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

invalidate_user_cacheboolean
  • Pronunciation overrides and cached audio (see “enable_cache”) are cached on the server.
  • Set this to true on a single request to drop all of your cached overrides and cached audio. Overrides are then re-read from storage and the audio is generated again.
  • The UI sends this when you edit your pronunciation overrides. Otherwise, the server uses cached audio and overrides, which keeps the old pronunciation. You typically don’t need to use this unless you want to intentionally invalidate all cached audio and overrides for some reason.

Default:false

enable_cacheboolean
  • Cache the generated audio on the server and return it from the cache for identical requests, instead of generating it again.
  • Requests are identical when they call the same endpoint with the same “model_id”, “voice_id”, “text”, “speed”, “speech_rate”, “creativity”, “quality_to_inference_speed_ratio”, “custom_audio_id” and “enable_server_pronunciation_overrides”, from the same account.
  • Cached responses are billed half the characters (rounded up).
  • Cached audio is private to your account and kept for up to 30 days. Use “invalidate_user_cache” to drop it.
  • The “X-Cache” response header is “HIT” when the response came from the cache, “MISS” when it was generated, and “BYPASS” when caching was not requested.

Default:false

Response

application/octet-stream

A continuous stream of raw float32 bytes.

string(binary)
post/stream

Body

{ "model_id": "silma-tts-v2-english", "text": "أنا نموذج سِلْمَا الجديد لتحويل النص إلى كلام، أستطيع التحدث باللغة العربية مع أو بدون تشكيل.", "voice_id": "james" }
 
application/octet-stream

Audio File (non-streaming)

Generates the whole text and returns one finished audio file, for narration use cases (audiobooks, voice-overs, e-learning).

  • Same text limit (1000 characters), pause tags and billing as /stream. Responses are never cached (“enable_cache” is ignored).
post
https://api.silma.ai/tts/v2/generate

Body

application/json

GenerateTTSRequest

model_idstringrequired

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

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

textstringrequired
  • The text to synthesize into speech (up to 1000 characters).
  • To pronounce phone numbers correctly use <STAG_PN>92005455</STAG_PN>
  • To pronounce emails correctly use <STAG_EMAIL>test@silma.ai</STAG_EMAIL>
  • To pronounce links correctly use <STAG_LINK>www.silma.ai</STAG_LINK>
  • To insert a pause use the SSML break tag, e.g. <break time="500ms"/> or <break time="1.5s"/> (max 5s per pause; a bare <break/> pauses 0.5s). Only the “time” attribute is supported.
  • Break tags do not count toward the character limit or billed characters.

<= 1000 characters

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

creativitynumber(float)

Variance in speech prosody.

Default:0.2

speednumber(float)DEPRECATED
  • Deprecated. Kept for backward compatibility and behaves as before.
  • Use “speech_rate” to control how fast the voice speaks.

Default:0.4

speech_ratenumber(float)
  • Speaking rate multiplier. 1.0 is the voice’s natural pace, 1.2 is 20% faster and 0.8 is 20% slower.
  • The voice and its pitch stay the same at every rate.

Default:1

>= 0.7<= 1.4

voice_idstringrequired
  • The ID of the pre-defined voice.
  • English voices: [james, emma, isabella, oliver]
  • Arabic voices: [abdulaziz, fahd, layla, maryam, nouf, noura, omar, reema, yusuf, khalid]
  • Legacy Arabic voices: [salwa, saja, sultan, salman, sulaiman, salim]

Allowed values:jamesemmaisabellaoliverabdulazizfahdlaylamaryamnoufnouraomarreemayusufkhalidsalwasajasultansalmansulaimansalim

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

invalidate_user_cacheboolean
  • Pronunciation overrides and cached audio (see “enable_cache”) are cached on the server.
  • Set this to true on a single request to drop all of your cached overrides and cached audio. Overrides are then re-read from storage and the audio is generated again.
  • The UI sends this when you edit your pronunciation overrides. Otherwise, the server uses cached audio and overrides, which keeps the old pronunciation. You typically don’t need to use this unless you want to intentionally invalidate all cached audio and overrides for some reason.

Default:false

enable_cacheboolean
  • Cache the generated audio on the server and return it from the cache for identical requests, instead of generating it again.
  • Requests are identical when they call the same endpoint with the same “model_id”, “voice_id”, “text”, “speed”, “speech_rate”, “creativity”, “quality_to_inference_speed_ratio”, “custom_audio_id” and “enable_server_pronunciation_overrides”, from the same account.
  • Cached responses are billed half the characters (rounded up).
  • Cached audio is private to your account and kept for up to 30 days. Use “invalidate_user_cache” to drop it.
  • The “X-Cache” response header is “HIT” when the response came from the cache, “MISS” when it was generated, and “BYPASS” when caching was not requested.

Default:false

response_formatstring
  • The format of the returned audio file: “wav” (16-bit mono PCM) or “mp3” (128 kbps mono).
  • “enable_cache” is ignored: every /generate request is generated.

Allowed values:wavmp3

Default:wav

Response

The audio file.

string(binary)
post/generate

Body

{ "model_id": "silma-tts-v2-english", "text": "أنا نموذج سِلْمَا الجديد لتحويل النص إلى كلام، أستطيع التحدث باللغة العربية مع أو بدون تشكيل.", "voice_id": "james" }
 

SSE Audio Stream

Returns audio chunks and metadata via Server-Sent Events. Note that this implementation accepts a JSON body in a GET request.

get
https://api.silma.ai/tts/v2/stream_sse

Headers

Acceptstringrequired

Example:text/event-stream

Body

application/json

TTSRequest

model_idstringrequired

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

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

textstringrequired
  • The text to synthesize into speech (up to 250 characters).
  • To pronounce phone numbers correctly use <STAG_PN>92005455</STAG_PN>
  • To pronounce emails correctly use <STAG_EMAIL>test@silma.ai</STAG_EMAIL>
  • To pronounce links correctly use <STAG_LINK>www.silma.ai</STAG_LINK>
  • To insert a pause use the SSML break tag, e.g. <break time="500ms"/> or <break time="1.5s"/> (max 5s per pause; a bare <break/> pauses 0.5s). Only the “time” attribute is supported.
  • Break tags do not count toward the character limit or billed characters.

<= 250 characters

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

creativitynumber(float)

Variance in speech prosody.

Default:0.2

speednumber(float)DEPRECATED
  • Deprecated. Kept for backward compatibility and behaves as before.
  • Use “speech_rate” to control how fast the voice speaks.

Default:0.4

speech_ratenumber(float)
  • Speaking rate multiplier. 1.0 is the voice’s natural pace, 1.2 is 20% faster and 0.8 is 20% slower.
  • The voice and its pitch stay the same at every rate.

Default:1

>= 0.7<= 1.4

voice_idstringrequired
  • The ID of the pre-defined voice.
  • English voices: [james, emma, isabella, oliver]
  • Arabic voices: [abdulaziz, fahd, layla, maryam, nouf, noura, omar, reema, yusuf, khalid]
  • Legacy Arabic voices: [salwa, saja, sultan, salman, sulaiman, salim]

Allowed values:jamesemmaisabellaoliverabdulazizfahdlaylamaryamnoufnouraomarreemayusufkhalidsalwasajasultansalmansulaimansalim

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

invalidate_user_cacheboolean
  • Pronunciation overrides and cached audio (see “enable_cache”) are cached on the server.
  • Set this to true on a single request to drop all of your cached overrides and cached audio. Overrides are then re-read from storage and the audio is generated again.
  • The UI sends this when you edit your pronunciation overrides. Otherwise, the server uses cached audio and overrides, which keeps the old pronunciation. You typically don’t need to use this unless you want to intentionally invalidate all cached audio and overrides for some reason.

Default:false

enable_cacheboolean
  • Cache the generated audio on the server and return it from the cache for identical requests, instead of generating it again.
  • Requests are identical when they call the same endpoint with the same “model_id”, “voice_id”, “text”, “speed”, “speech_rate”, “creativity”, “quality_to_inference_speed_ratio”, “custom_audio_id” and “enable_server_pronunciation_overrides”, from the same account.
  • Cached responses are billed half the characters (rounded up).
  • Cached audio is private to your account and kept for up to 30 days. Use “invalidate_user_cache” to drop it.
  • The “X-Cache” response header is “HIT” when the response came from the cache, “MISS” when it was generated, and “BYPASS” when caching was not requested.

Default:false

Response

200 text/event-stream

Stream of SSE events (data: {audio, text, status}).

statusstring

Allowed values:streamingcompleted

audiostring

Base64 encoded float32 waveform.

textstring

The specific text chunk processed.

alignmentobject

The timestamps marking the start and end of the data chunk.

Show Child Parameters
get/stream_sse

Body

{ "model_id": "silma-tts-v2-english", "text": "أنا نموذج سِلْمَا الجديد لتحويل النص إلى كلام، أستطيع التحدث باللغة العربية مع أو بدون تشكيل.", "voice_id": "james" }
 
200 text/event-stream

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.
    The started message includes cache (HIT, MISS or BYPASS, see enable_cache) and billed_characters.
get
https://api.silma.ai/tts/v2/ws/stream

Response

101

Switching Protocols to WebSocket.

get/ws/stream
 
101