post
https://platform.perso.ai/api/speech/v1/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).
| Parameter | Required | Description |
|---|---|---|
voice_id | Yes | The ID of the voice to use for speech generation. Retrieve available voice IDs from List Voices (GET /v2/voices). |
output_format | Yes | Audio format. Default: wav_24000 (see formats below) |
Request Body Parameters
| Parameter | Required | Description |
|---|---|---|
text | Yes | Text to convert to speech |
model_id | No | Default: perso_multilingual_v1 |
Output Formats
| Format | Content-Type | Description |
|---|---|---|
pcm_24000 | audio/L16 | Raw PCM 24kHz |
wav_24000 | audio/wav | WAV 24kHz |
mp3_44100_192 | audio/mpeg | MP3 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."}'