Skip to main content
POST
/
tts-stream
curl -X POST https://api.60db.ai/tts-stream \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This is a longer text that will be streamed in real-time.",
    "voice_id": "default-voice",
    "speed": 1,
    "stability": 50,
    "similarity": 75
  }' \
  --no-buffer
{"type":"chunk","result":{"audioContent":"SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4..."}}
{"type":"chunk","result":{"audioContent":"//uQxAAAAAAAAAAAAAAASW5mbwAAAA8AAAAGAAA..."}}
{"type":"complete"}

Documentation Index

Fetch the complete documentation index at: https://docs.60db.ai/llms.txt

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

Request

Headers

Authorization
string
required
Bearer token with your API key
Content-Type
string
required
application/json

Body

text
string
required
The text to convert to speech (max 5000 characters)
voice_id
string
ID of the voice to use
enhance
boolean
default:"true"
Enable audio enhancement
speed
number
default:"1"
Speech speed multiplier (0.5 to 2.0)
stability
number
default:"50"
Voice stability 0-100 (lower = more expressive, higher = more consistent)
similarity
number
default:"75"
Voice similarity 0-100 (how closely the output matches the source voice)

Response

The response is streamed as newline-delimited JSON (NDJSON). Each line contains a JSON object:

Chunk Object

type
string
Type of message: “chunk”, “complete”, or “error”
result
object
Contains the audio chunk data
result.audioContent
string
Base64-encoded audio chunk
message
string
Error message (only for error type)
curl -X POST https://api.60db.ai/tts-stream \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This is a longer text that will be streamed in real-time.",
    "voice_id": "default-voice",
    "speed": 1,
    "stability": 50,
    "similarity": 75
  }' \
  --no-buffer
{"type":"chunk","result":{"audioContent":"SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4..."}}
{"type":"chunk","result":{"audioContent":"//uQxAAAAAAAAAAAAAAASW5mbwAAAA8AAAAGAAA..."}}
{"type":"complete"}

Use Cases

Streaming is ideal for:
  • Real-time applications: Voice assistants, chatbots
  • Long-form content: Articles, books, documents
  • Low latency: Start playing audio before generation completes
  • Progressive enhancement: Display text while generating audio