Synthesize Character Speech
POST/characters/synthesize
Synthesize speech using character's voice and personality. Automatically saves to TTS history.
Authentication
Authorization: Bearer vm_sk_… with the media.write permission (or all.write). See Authentication.
Request body
application/json
| Field | Type | Description |
|---|---|---|
character_id* | string | Character ID |
emotion | EmotionType | |
options | SynthesisOptionsRequest | |
text* | string | Text to synthesize |
Response
200 application/json
| Field | Type | Description |
|---|---|---|
audio_url* | string | URL to download synthesized audio |
character_id* | string | |
duration_seconds* | number | |
emotion* | EmotionTypeone of neutral, happy, sad, angry, excited, calm, surprised, thoughtful, confused, determined, analytical, storytelling, suspicious, friendly, encouraging, patient, dramatic, confident, inspiring | |
format* | string | |
processed_text* | string | Text after speech pattern processing |
synthesis_id* | string | Unique synthesis ID |
voice_profile_id* | string | Voice profile ID used for synthesis |
{
"audio_url": "string",
"character_id": "string",
"duration_seconds": 0,
"emotion": "neutral",
"format": "string",
"processed_text": "string",
"synthesis_id": "string",
"voice_profile_id": "string"
}Errors
401 | Missing, wrong, revoked or expired key. |
403 | The key lacks media.write, the route is not available to keys, or the key's IP allow-list refuses this client. |
402 | Not enough credits, or the key reached its spending cap. |
422 | The request failed validation; `detail` lists the fields. |
429 | Over a rate limit; retry after `Retry-After` seconds. |
All statuses: Errors.
Example
curl -X POST "https://api.voicemint.io/api/v1/characters/synthesize" \
-H "Authorization: Bearer $VOICEMINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"character_id": "string",
"emotion": "neutral",
"options": {
"format": "mp3",
"pitch": 0,
"sample_rate": 24000,
"speed": 1,
"volume": 1
},
"text": "string"
}'