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."}'
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The ID of the voice to use for speech generation. Retrieve available voice IDs from List Voices (GET /v2/voices).

Query Params
string
enum
required
Defaults to wav_24000

The desired audio output format.

Allowed:
Body Params
string
required
length between 1 and 5000
string
length ≥ 1
Defaults to perso_multilingual_v1
voice_settings
object
Responses

400

Bad Request - Invalid input data or parameters.

401

Unauthorized - Invalid or missing authentication credentials.

403

Forbidden - You do not have permission to perform this action.

404

Not Found - The requested resource could not be found.

500

Internal Server Error - An unexpected error occurred.

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
*/*