Custom TTS Integration
Use your own API key for text-to-speech in FULL mode sessions.
Using your own TTS API Key
Some developers may want to use your own TTS voice provider. This is true if you:
- have pre-existing ElevenLabs voices they want to use in LiveAvatar
- want finer control over voice selection and configuration.
Note: as of now we only support the following third party providers:
- ElevenLabs
This guide walks through how to
- Add your ElevenLabs API Key
- Import a third party voice
- Start a FULL mode session with your new voice
Adding your API Key
First, register your ElevenLabs API key with LiveAvatar. We encrypt all user secrets with Amazon Encryption library and Amazon KMS. We will return a newly created secret_id in the response that references your stored secret.
See endpoint details here.
curl --request POST \
--url https://api.liveavatar.com/v1/secrets \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"secret_type": "ELEVENLABS_API_KEY",
"secret_value": "your_elevenlabs_api_key",
"secret_name": "<display name of your secret>"
}
'
Importing a voice
Next, we will import a voice configuration, using the API key that was stored stored. This will create a voice in LiveAvatar, signaling which ElevenLabs voice to use with your API key. We save this on LiveAvatar side as a voice and it will now appear when you attempt to list your voices.
You will need to provide a voice_id from your ElevenLabs account. You can find your available voice IDs in the ElevenLabs dashboard or via the ElevenLabs API.
See endpoint details here.
curl --request POST \
--url https://api.liveavatar.com/v1/voice/third_party \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"provider_voice_id": "<elevenlabs_voice_id>",
"secret_id": "<secret_id>",
"name" : “<voice_display_name>”
}
'
If the voice is deleted from ElevenLabs or if the secret is removed, this voice will automatically become invalid.
Starting a Session
Finally, when starting a FULL mode session, you can specify which voice configuration you want us to use. Simply set the voice_id when creating a session token. When we start the session, instead of using our default voice logic, we will use your ElevenLabs API key and voice to generate audio.
See the endpoint details here.
Updated about 17 hours ago