🦋
SYNAPSE API
  • 📚SYNAPSE
  • Services
    • 💬Language Models
    • 🎨Stable Diffusion
    • 🖼️Stable Diffusion XL
    • 🛝Playground
    • 👨‍🎨DALL-E-3
    • 🎤Whisper
    • 🗣️Text To Speech
  • Info
    • ⛓️Limits
    • ❓Support
    • 🔑API Key
    • 👑Premium
Powered by GitBook
On this page
  • TTS Models
  • TTS Voices
  • Create Speech
  1. Services

Text To Speech

OpenAI's realistic text to speech model

TTS Models

GET /tts/list

List available TTS Models

Headers

Name
Value

Content-Type

application/json

Response

["tts-1", "tts-1-hd", ...]
{
  "error": "Invalid request"
}

TTS Voices

GET /tts/voices

List available TTS Voices

Headers

Name
Value

Content-Type

application/json

Response

["alloy", "echo", "fable", ...]

Create Speech

POST /tts/:model

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description
Default

input

string

Input text

none

voice

string

Voice

alloy

speed

number

Voice speed (0.25 - 4.0)

1.0

Response

{
  "data": "d2VsbF9oZWxsb190aGVyZV90Lm1lL3N5bmFwc2VfbGFicw....."
}
{
  "error": "Invalid request"
}
{
  "error": "Error during generation (TTS)"
}

Example

const res = await fetch('https://synapselabs.onrender.com/tts/tts-1-hd', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <your_api_key>'
  },
  body: JSON.stringify({
    input: 'hello',
    speed: 1.0,
    voice: 'alloy',
  }),
});

const data = await res.json();
const buf = Buffer.from(data.data, 'base64');
fs.writeFileSync('test.mp3', buf);
PreviousWhisperNextLimits

Last updated 1 year ago

🗣️