Skip to main content
POST
/
api
/
generate-text-to-speech
Generate Text-to-Speech
curl --request POST \
  --url https://easy-peasy.ai/api/generate-text-to-speech \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "voiceID": "21m00Tcm4TlvDq8ikWAM",
  "text": "Hello! This is a test of the text-to-speech API. It supports multiple languages and custom voice settings."
}
'
{
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "url": "https://media.easy-peasy.ai/tts/27feb2bb-aeb4-4a83-9fb6-8f3f2a15885e/6848fb55-48e7-455d-bd56-3cb5ce2cd81e.mp3",
  "used_characters": 10,
  "status": "completed"
}

Authorizations

x-api-key
string
header
required

API key for authentication. Get yours at https://easy-peasy.ai/settings/api

Headers

x-api-key
string
required

Your API key

Body

application/json
voiceID
string
required

Voice ID to use for generation (get IDs from the Get TTS Voices endpoint)

Example:

"21m00Tcm4TlvDq8ikWAM"

text
string
required

The text to convert to speech

Example:

"Hello! This is a test of the text-to-speech API."

Response

Successfully generated audio

url
string<uri>

Publicly accessible URL of the generated audio file (MP3)

Example:

"https://media.easy-peasy.ai/tts/27feb2bb-aeb4-4a83-9fb6-8f3f2a15885e/6848fb55-48e7-455d-bd56-3cb5ce2cd81e.mp3"

uuid
string<uuid>

ID of the audio

Example:

"550e8400-e29b-41d4-a716-446655440000"

used_characters
integer

Word count of the text (used for billing)

Example:

10

status
enum<string>

Status of the speech generation

Available options:
completed
Example:

"completed"