SILMA.AI - Dev Portal

Explore our API offerings

SILMA TTS API

2.3.1
The Official API of SILMA TTS to generate speech from text

Pipecat Integration

Get started by installing the package via pip

pip install pipecat-silma

Livekit Integration

Get started by installing the package via pip

pip install livekit-plugins-silma

OpenAI SDK

Get started by installing openai SDK

pip install openai

from openai import OpenAI
import wave

client = OpenAI(
  base_url="https://api.silma.ai/openrouter/v1",
  api_key="YOUR_API_KEY",
)


with client.audio.speech.with_streaming_response.create(
  model="silma-tts-v2-english",
  input="Hello! This is a text-to-speech test.",
  voice="emma",
  response_format="pcm"
) as response:

  with wave.open("output.wav", "wb") as wav_file:
    wav_file.setnchannels(1)
    wav_file.setsampwidth(2)
    wav_file.setframerate(24000)

    # Write chunks as they stream in
    for chunk in response.iter_bytes():
      wav_file.writeframes(chunk)