Documentation

Speak

Text to speech in one HTTP call: 15 voices, 31 languages, up to 10,000 characters a request. Your Mosaic API key works as is. On Pro and Teams (pricing).

Make speech

curl -X POST "https://speak.mosaic.site/v1/speak?voice=eve" \
  -H "X-API-Key: $KEY" \
  -d '{"text": "Hello! I can talk now."}' \
  -o speech.wav

Speak lives at https://speak.mosaic.site. Send the key as X-API-Key or as Authorization: Bearer.

Parameters

In the query string or the JSON body; the query string wins.

ParamDefaultValues
textrequiredUp to 10,000 characters
voiceeveSee Voices below
langen31 ISO codes, or na for unknown or mixed
speed1.050.7 (slow) to 2.0 (fast)
qualitybalancedfast, balanced, high
formatwavwav, pcm, mulaw
sample_rateby format8000, 16000, 44100; 8000 for mulaw, 44100 otherwise
streamfalsetrue sends audio in chunks as each is ready

Voices

Phone audio

For phone greetings and voice agents, ask for 8 kHz μ-law with format=mulaw&sample_rate=8000:

curl -X POST "https://speak.mosaic.site/v1/speak?voice=eve&format=mulaw&sample_rate=8000" \
  -H "X-API-Key: $KEY" \
  -d '{"text": "Thanks for calling. How can I help?"}' \
  -o greeting.ulaw

For a greeting saved to a file, leave stream off: you get a proper error status and the cache. Use stream=true only to play audio as it arrives. A stream can end early without an error, so treat an unexpectedly short one as a failure.

Limits and usage

Errors

Errors return {"error": {"code": "...", "message": "..."}}.

CodeWhat it means
missing_key, invalid_key401: no key, or the key isn't recognised
text_too_longOver 10,000 characters
unsupported_for_voice400: an English voice with another language or speed; use an F or M voice
rate_limited429: over 60 requests a minute; back off
model_loading503: the service just restarted; retry in about 30 seconds
platform_unavailable503: Mosaic is briefly unavailable; retry shortly

Endpoints

On https://speak.mosaic.site:

EndpointMethodDescription
/v1/speakPOSTText in, audio out
/v1/voicesGETVoices, with sample URLs
/v1/languagesGETLanguage codes
/v1/usageGETRequests and characters for your account