TTS quickstart
In this quickstart, you will send one HTTPS request, save the generated audio as speech.wav, and play it locally.
Low time-to-first-audio (TTFA) requires stream: true. This quickstart covers basic usage and waits for the complete audio to be generated. For faster playback startup, follow the streaming audio guide to receive and play audio as it arrives.
1. Create an API key
Create a key in API Keys and copy it when it is shown. Store it in your server environment:
Keys are server-side credentials. The authentication guide covers key management and browser applications.
2. Generate speech
voice is required and case-sensitive. Use diana for Diana (female) or leon for Leon (male), rather than the display names Diana or Leon. The voice catalog lists the IDs available for each model.
3. Play the result
Open speech.wav in your audio player. On macOS, run:
If you hear “Hello, welcome to Nari Labs,” your request succeeded.
For best results, write input with normal capitalization and punctuation.
Why this model
Qwen3-TTS is best suited to output-streaming applications where low time-to-first-audio (TTFA) matters. This quickstart uses a WAV file to keep the first request simple; the streaming audio guide shows how to play audio as it arrives and explains the streaming response format.
For applications that receive text incrementally, use the TTS input streaming guide.
Next steps
- Adjust request fields and input limits.
- Choose a voice or model.
- Use streaming audio when you need progressive playback.