> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.narilabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.narilabs.com/_mcp/server.

# TTS quickstart

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

> **Note**
>
> 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](/streaming-audio) to receive and play audio as it arrives.

## 1. Create an API key

Create a key in [API Keys](https://app.narilabs.com/keys) and copy it when it is shown. Store it in your server environment:

```bash
export NARI_API_KEY="your-api-key"
```

Keys are server-side credentials. The [authentication guide](/authentication) 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](/voices#list-available-voices) lists the IDs available for each model.

```bash
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",
    "voice": "diana",
    "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:

```bash
afplay speech.wav
```

If you hear “Hello, welcome to Nari Labs,” your request succeeded.

> **Note**
>
> For best results, write input with [normal capitalization and punctuation](/generate-speech#prepare-your-text).

## 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](/streaming-audio) 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](/streaming-text).

## Next steps

* Adjust [request fields and input limits](/generate-speech).
* Choose a [voice](/voices) or [model](/models-and-pricing).
* Use [streaming audio](/streaming-audio) when you need progressive playback.