Skip to main content

Generate speech in 5 minutes

Send text to the Text-to-Speech endpoint and receive an audio file. This guide uses a synchronous request; see streaming generation when you need audio chunks as soon as they are available.

Before you start

Create a project and API key before making a request. See Get your API key for the complete walkthrough.

export VUILABS_API_BASE_URL="https://api-global.vuilabs.ai"
export VUILABS_API_KEY="your-api-key"
Keep your key safe

Never share your API key or add it to public source code.

Make your first request

curl --request POST \
--url "$VUILABS_API_BASE_URL/v1/text-to-speech" \
--header "X-API-Key: $VUILABS_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"generate_text": "Hello from VUILabs.",
"language": "en",
"speed": 1
}' \
--output speech.mp3

What happens next

The API returns raw audio bytes with HTTP 200. Save the response to a file or pass it directly to your audio player.

Need another voice? Choose an approved voice_id.

Need a faster first sound? Switch to the streaming endpoint.

Need a different file type? Set audio_format when it is enabled for your voice.

Continue with voices and output options, or open the full Text-to-Speech API reference.