POST
Synchronous Text-To-Speech(TTS) API
Synchronous text-to-speech service, supporting multiple providers' TTS models with unified interface and unified calling parameters
/api/v1/common/tts-sync
Request Parameters
Request Headers
Parameter Name | Type | Required | Description |
---|---|---|---|
X-API-Key | string | Required | User API key for authentication |
Content-Type | string | Required | application/json |
Request Body
Parameter Name | Type | Required | Description |
---|---|---|---|
model | string | Required | TTS model name, can be obtained through the models list API |
text | string | Required | Text content to be converted to speech (maximum 10,000 characters supported) |
voice | string | Required | Voice ID, unique identifier for each voice under a model |
speed | number | Optional | Speech speed, range 0.5-2.0, default 1.0 |
pitch | number | Optional | Pitch multiplier, range 0.5-2.0, default 1.0 |
volume | number | Optional | Volume multiplier, range 0.5-2.0, default 1.0 |
format | string | Optional | Output audio format, supports mp3, wav, etc., default mp3 |
Request Example
curl -X POST https://unifiedtts.com/api/v1/common/tts-sync \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "edge-tts",
"voice": "en-US-JennyNeural",
"text": "Hello, this is a test of text to speech synthesis.",
"speed": 1.0,
"pitch": 1.0,
"volume": 1.0,
"format": "mp3"
}'
Response Description
Success Response (200)
Field | Type | Description |
---|---|---|
success | boolean | Whether the operation was successful |
message | string | Response message description |
timestamp | number | Response timestamp (Unix timestamp in milliseconds) |
data | object | Business data object |
└─ request_id | string | Request ID for tracking and debugging |
└─ audio_url | string | Audio file download link |
└─ file_size | number | Audio file size in bytes |
Response Example
{
"success": true,
"message": "Success",
"timestamp": 1703123456789,
"data": {
"request_id": "req_abc123456789",
"audio_url": "https://unifiedtts.com/api/v1/audio/download/abc123.mp3",
"file_size": 245760
}
}
Important Notice
The voices supported by each model are subject to official model support. This interface may have delays or inaccuracies. Please refer to the official documentation of each TTS provider if you have any questions.
Login Required for Online Testing
Please log in and get an API Key first, then you can test the API online
Login