Langsung ke konten utama

Documentation Index

Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt

Use this file to discover all available pages before exploring further.

Body Permintaan

Timeout permintaan sinkron: endpoint non-chat ini menunggu model yang dirutekan selesai. Input besar, audio panjang, atau batch besar dapat melebihi default client umum 30s, jadi atur timeout HTTP client Anda minimal 120s.
model
string
default:"tts-1"
Model TTS: tts-1 (standar) atau tts-1-hd (kualitas lebih tinggi).
input
string
wajib
Teks untuk menghasilkan audio. Maksimum 4096 karakter.
voice
string
wajib
Voice yang digunakan: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse.
response_format
string
default:"mp3"
Format audio: mp3, opus, aac, flac, wav, pcm.
speed
number
default:"1.0"
Kecepatan audio (0.25 hingga 4.0).

Respons

Mengembalikan file audio dalam format yang diminta.
curl -X POST "https://api.tokenlab.sh/v1/audio/speech" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1-hd",
    "voice": "nova",
    "input": "Hello, welcome to TokenLab!"
  }' \
  --output speech.mp3

Sampel Voice

VoiceDeskripsi
alloyNetral, seimbang
ashTenang, terukur
balladMelodis, ekspresif
coralHangat, mengundang
echoHangat, percakapan
fableEkspresif, naratif
novaRamah, jelas
onyxDalam, berwibawa
sageBijaksana, penuh pertimbangan
shimmerLembut, halus
verseDinamis, serbaguna