Text to Speech API

This page explains how to interact with the standalone Text-to-Speech (TTS) API to generate audio from a given transcript, using a selected voice from the available voice list.

triangle-exclamation

Generate Audio from Text

POST https://api.convai.com/tts/


Headers

CONVAI-API_KEY*

String

Your Convai API Key.

Content-Type*

String

application/json


Request Body

Name
Type
Description

transcript*

String

The text to be converted into audio.

voice*

String

Specifies the type of voice used for the audio response. This can be retrieved using the Voice List API, from the voice_value attribute of the desired voice. NOTE : Realtime voices are not supported in the standalone TTS API endpoint.

filename

String

The name of the audio file.

encoding

String

This is the format of the audio file. We currently support WAV and MP3 formats for STT (speech-to-text) audio. By default, it is set to WAV. NOTE : MP3 is not supported by all voices.


Response

If the API call is successful, it returns the generated audio file as the response.


Sample Code Snippet

Last updated

Was this helpful?