Create Text to Speech
FreshPOSTPOST 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
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to convert to speech |
voice_id | string | Yes | Voice ID to use (from /api/voices/) |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
X-API-ID | string | Yes | Your Creatify API ID |
X-API-KEY | string | Yes | Your Creatify API key |
Content-Type | string | Yes | application/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
| Code | Description |
|---|---|
201 | Task created successfully |
400 | Bad request -- invalid parameters or empty text |
401 | Unauthorized -- invalid API credentials |
402 | Insufficient credits |
429 | Rate limit exceeded |
500 | Internal 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/.