Synthesize speech (query params)
const url = 'https://example.com/v1/adapters/tts/polly?format=mp3&fallback=true';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/adapters/tts/polly?format=mp3&fallback=true' \ --header 'Authorization: Bearer <token>'Synthesizes speech from the query parameters and streams the audio.
Either text or text_b64 is required.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”TTS engine selector.
Query Parameters
Section titled “Query Parameters”Voice id. Short alias v.
Language code. Short alias l.
Plain text to synthesize. Required unless text_b64 is set.
Base64-encoded text. Required unless text is set.
Speech speed. Short alias s.
Audio format. Short alias f. Defaults to mp3.
Sample rate in Hz. Short alias sr.
Provider model. Short alias m.
Allow voice fallback. Short alias fb. Defaults to true.
Short alias for voice.
Short alias for language.
Short alias for speed.
Short alias for format.
Short alias for sampleRate.
Short alias for model.
Short alias for fallback.
Provider-specific free-form synthesis settings, supplied as dot-delimited
nested query keys of the form advanced_settings.<section>.<key>=<value>
(alias prefix as), e.g. as.s.param1=100. The keys are flattened into a
nested object per section; the accepted sections and keys are
provider-specific.
object
Skip the freeswitch URI length guard when true.
Responses
Section titled “Responses”Synthesized audio stream.
Headers
Section titled “Headers”1 on cache hit, 0 otherwise.
Error response.
object
Examplegenerated
{ "code": "example", "reason": "example", "message": "example"}Error response.
object
Examplegenerated
{ "code": "example", "reason": "example", "message": "example"}Forbidden
Error response.
object
Examplegenerated
{ "code": "example", "reason": "example", "message": "example"}Error response.
object
Examplegenerated
{ "code": "example", "reason": "example", "message": "example"}