Skip to content

Create Text to Speech

FreshPOST
POST https://api.creatify.ai/api/text_to_speech/

Convert text to speech audio using a specified voice. The generated audio can be used in other Creatify video creation tasks or downloaded for standalone use.

Request Body

NameTypeRequiredDescription
textstringYesThe text to convert to speech
voice_idstringYesVoice ID to use (from /api/voices/)

Headers

HeaderTypeRequiredDescription
X-API-IDstringYesYour Creatify API ID
X-API-KEYstringYesYour Creatify API key
Content-TypestringYesapplication/json

Example Request

bash
curl -X POST 'https://api.creatify.ai/api/text_to_speech/' \
  -H 'X-API-ID: your-api-id' \
  -H 'X-API-KEY: your-api-key' \
  -H 'Content-Type: application/json' \
  -d '{
    "text": "Welcome to our product demonstration. Today we will show you all the amazing features.",
    "voice_id": "voice-en-001"
  }'

Response

json
{
  "id": "tts-001",
  "status": "pending",
  "text": "Welcome to our product demonstration. Today we will show you all the amazing features.",
  "voice_id": "voice-en-001",
  "created_at": "2024-01-15T10:30:00Z"
}

Status Codes

CodeDescription
201Task created successfully
400Bad request -- invalid parameters or empty text
401Unauthorized -- invalid API credentials
402Insufficient credits
429Rate limit exceeded
500Internal server error

TIP

List available voices with GET /api/voices/ to find the right voice for your content. You can also clone a custom voice with POST /api/voices/clone/.