Text to Speech

Convert text to speech audio using a specified voice.

Prerequisites

You must have at least one cloned voice. Use Create Voice (POST /v1/voices/add) to create a voice, then retrieve its voice_id from List Voices (GET /v2/voices).

Authenticate using the PersoPlatform-APIKey header.

--header 'PersoPlatform-APIKey: <your-api-key>'

The ElevenLabs-compatible xi-api-key header is also accepted:

--header 'xi-api-key: <your-api-key>'

URL Path Parameters

Replace {voice_id} in the URL with your voice ID. Retrieve available voice IDs from List Voices (GET /v2/voices).

ParameterRequiredDescription
voice_idYesThe ID of the voice to use for speech generation. Retrieve available voice IDs from List Voices (GET /v2/voices).
output_formatYesAudio format. Default: wav_24000 (see formats below)

Request Body Parameters

ParameterRequiredDescription
textYesText to convert to speech
model_idNoDefault: perso_multilingual_v1

Output Formats

FormatContent-TypeDescription
pcm_24000audio/L16Raw PCM 24kHz
wav_24000audio/wavWAV 24kHz
mp3_44100_192audio/mpegMP3 44.1kHz 192kbps

Example

Select "TextToSpeechRequest" from the Examples dropdown to see a request example.

curl --request POST 
--url "https://platform.perso.ai/api/speech/v1/text-to-speech/{voice_id}?output_format=mp3_44100_192"
--header "PersoPlatform-APIKey: <your-api-key>"
--header "Content-Type: application/json"
--header "Accept: */*"
--data '{"text": "Hello, this is a text to speech test."}'
Language
Credentials
Header
Response
Click Try It! to start a request and see the response here!