Overview
Convert text to natural-sounding speech using a library of built-in voices, or clone a custom voice from a short audio sample for consistent narration.
Primary Endpoint
/api/v1/video/send_ttsGenerate text-to-speech audio
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| msg | string | Yes | Text content to convert to speech (1-3000 characters) |
| tts_id | string | No | System voice ID (MongoDB ObjectId). Must provide either tts_id or user_voice_id. |
| user_voice_id | string | No | Custom cloned voice ID (MongoDB ObjectId). Must provide either tts_id or user_voice_id. |
| country | string | No | Locale language part (e.g. 'en', 'zh', 'pt', 'ja'). Optional when using user_voice_id, defaults to 'en'. Combine with `region` to form locale like 'en-US'/'zh-CN'. Values should come from POST /api/v1/anchor/language_list (top-level `value`). |
| region | string | No | Locale region part (e.g. 'US', 'CN', 'BR', 'JP'). Optional when using user_voice_id, defaults to 'US'. Combine with `country` to form locale like 'en-US'/'zh-CN'. Values should come from POST /api/v1/anchor/language_list (child `value`). |
| speechRate | number | No | Speech speed multiplier (0.5-2.0) |
| type | enum: turnstile | aliyun_captcha | No | Captcha type (required when captcha verification is needed) |
| turnstile_token | string | No | Captcha token (required when type is 'turnstile') |
| captchaVerifyParam | string | No | Captcha verification parameter (required when type is 'aliyun_captcha') |
Request Example
curl -X POST "https://www.a2e.com.cn/api/v1/video/send_tts" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"msg": "Welcome. Let's start your AI journey.",
"tts_id": "66dc3c1b7dc1f1c483cc5ab8",
"user_voice_id": "66f1234567890abcdef12345",
"country": "en",
"region": "US",
"speechRate": 1,
"type": "turnstile",
"turnstile_token": "0x4AAAAAAxxxxxxxxxxxxxxxxxx",
"captchaVerifyParam": "xxxxxxxxxxxx"
}'Related Endpoints
/api/v1/anchor/tts_listList system voices (TTS presets)
/api/v1/anchor/language_listList supported languages/regions for voices
/api/v1/anchor/voice_listList available voices by country/region
/api/v1/anchor/voice_listList available voices (GET)
/api/v1/video/send_ttsGenerate text-to-speech audio
/api/v1/tts/preview/listGet TTS preview list
/api/v1/tts/preview/{id}Delete TTS preview record
/api/v1/userVoice/trainingStart voice training
/api/v1/userVoice/trainingRecordGet voice training records
/api/v1/userVoice/completedRecordGet completed voice training records
/api/v1/userVoice/{_id}Delete voice training record
/api/v1/userVoice/{_id}Get voice training record detail
/api/v1/userVoice/{_id}Update voice training record name
Responses
Text-to-speech generation successful
Invalid request parameters
Unauthorized - Invalid or missing bearer token