Generate audio
/api/v1/tts/post/ Converts text to an audio file. The built-in Gulnoza model is used for language=uz. For en and ru, model, mood, and speed are not sent.
Authentication
Send X-Api-Key. Public requests may require reCAPTCHA.
speed must be 0 or between 0.5-2.0. mood is only for the built-in Gulnoza flow. When voice_id is used, mood is not sent. Request fields
transcript required Assalomu alaykum Text to synthesize.
language optional uz Supported values: uz, en, ru. Default: uz.
model optional Gulnoza Only for the built-in uz flow. There is currently one model: Gulnoza.
mood optional Neutral Only for built-in Gulnoza. There are 4 moods: Neutral, Cheerful, Happy, Sad. Not sent for voice_id, en, or ru flows.
speed optional 1.0 Only for the uz flow. 0 uses the default speed. Custom range: 0.5-2.0.
voice_id optional 12 READY custom voice ID owned by the user. If voice_id is used, mood is not sent.
webhook_notification_url optional https://example.com/webhooks/tts Runs TTS asynchronously when provided.
Examples
Sync request
curl --request POST \
--url https://back.aisha.group/api/v1/tts/post/ \
--header 'X-Api-Key: your_api_key' \
--header 'Accept-Language: uz' \
--form 'transcript=Assalomu alaykum, bu AIsha TTS sinovi.' \
--form 'language=uz' \
--form 'model=Gulnoza' \
--form 'mood=Neutral' \
--form 'speed=1.0' Async request
curl --request POST \
--url https://back.aisha.group/api/v1/tts/post/ \
--header 'X-Api-Key: your_api_key' \
--form 'transcript=Webhook orqali qaytadigan sinov matni.' \
--form 'language=uz' \
--form 'webhook_notification_url=https://example.com/webhooks/tts' Responses
Sync success
{
"audio_path": "/media/tts_audios/request-id.wav"
} Async queued
{
"id": 184,
"task_id": "7d5f8779-9cb0-4230-9318-2f8c3c3f0e31",
"status": "PENDING"
} Status codes
Audio is ready and `audio_path` is returned.
Async task was queued.
Invalid transcript, language, model, or speed.
Custom voice requires authentication.
Insufficient balance.
TTS service is temporarily unavailable.