Skip to main content
POST
/
tts-stream
curl -X POST https://api-dev.qcall.ai/tts/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"
  }' \
  --no-buffer
{"type":"chunk","result":{"audioContent":"SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4..."}}
{"type":"chunk","result":{"audioContent":"//uQxAAAAAAAAAAAAAAASW5mbwAAAA8AAAAGAAA..."}}
{"type":"complete"}

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.0"
Speech speed (0.5 to 2.0)

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-dev.qcall.ai/tts/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"
  }' \
  --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