TTS quickstart

Make your first TTS request and save the result as a WAV file.
View as Markdown

In this quickstart, you will send one HTTPS request, save the generated audio as speech.wav, and play it locally.

1. Create an API key

Create a key in API Keys and copy it when it is shown. Store it in your server environment:

$export NARI_API_KEY="your-api-key"

Keys are server-side credentials. The authentication guide covers key management and browser applications.

2. Generate speech

$curl --fail --silent --show-error \
> https://api.narilabs.com/v1/audio/speech \
> -H "Authorization: Bearer $NARI_API_KEY" \
> -H "Content-Type: application/json" \
> --data '{
> "model": "qwen3-tts:free",
> "input": "Hello, welcome to Nari Labs.",
> "response_format": "wav"
> }' \
> --output speech.wav

3. Play the result

Open speech.wav in your audio player. On macOS, run:

$afplay speech.wav

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.

WebSocket support for streaming text input is coming soon.

Next steps