# Use Paxa with Home Assistant

Give Home Assistant's voice assistant and announcements a voice that speaks English, Thai, and Mandarin, through the OpenAI TTS custom integration.

Give your Home Assistant voice assistant and announcements a voice that speaks English, Thai, and Mandarin, mixed sentences included. The [OpenAI TTS](https://github.com/sfortis/openai_tts) custom integration, installed from HACS, connects to Paxa through its Custom preset.

Menu and field names can differ between versions of the integration.

## Add Paxa as a provider

1. Install the integration: In HACS, search for OpenAI TTS, download it, and restart Home Assistant.
2. Add an entry: Go to Settings > Devices & services > Add integration > OpenAI TTS, and pick the Custom / Self-hosted provider.
3. Connect Paxa: Set API Endpoint to `https://api.paxalabs.com/v1/audio/speech` and API Key to your Paxa API key.

Setup checks the entry with an empty text, which Paxa refuses before it reads the key. A mistyped key passes that check and fails at the first announcement. When speech fails, check the key against the dashboard first.

## Add a TTS agent

Add a TTS agent to the entry and set these fields.

| Field | Value |
| --- | --- |
| Model | `paxa-tts-flash-v2` |
| Voice | A Paxa voice id, such as `khanomkrok` |
| Speed | From 0.5 to 1.5 |
| Audio format | `mp3` |

- Type the voice. The Custom preset has no voice list for Paxa, and any voice id from [GET /v1/voices](https://paxalabs.com/docs/api/voices) whose model is `paxa-tts-flash-v2` works. OpenAI's voice names, such as `alloy`, also work ([accepted voice names](https://paxalabs.com/docs/accepted-voice-names)).
- Keep Speed between 0.5 and 1.5. The slider runs from 0.25 to 4.0, and Paxa answers 400 outside its own range.
- Keep Audio format on `mp3`, or choose `opus`, `wav`, or `pcm`. `aac` and `flac` answer 400.

## Use it in the voice assistant

Open Settings > Voice assistants, pick the assistant, and choose the agent under Text-to-speech. The assistant's own Voice setting takes priority over the agent's voice. Set it to a Paxa voice as well.

The agent is a regular text-to-speech entity. Home Assistant's `tts.speak` action and the integration's `openai_tts.say` action both use it for announcements.
