# Use Paxa in apps and frameworks

Apps and frameworks built for OpenAI's speech and transcription endpoints work with Paxa after two settings change. Setup guides for Open WebUI, LibreChat, AnythingLLM, Home Assistant, SillyTavern, LiveKit Agents, and Strands Agents.

Give the apps you already run voices that speak English, Thai, and Mandarin, mixed sentences included, and transcription for what your users say. Any app or framework built for OpenAI's speech and transcription endpoints can call Paxa.

## Connect an OpenAI-compatible app

Most apps need two settings.

| Setting | Value |
| --- | --- |
| Base URL | `https://api.paxalabs.com/v1` |
| API key | A Paxa key from the [dashboard](https://paxalabs.com/app/keys) |

An app that asks for the full endpoint takes `https://api.paxalabs.com/v1/audio/speech` for text to speech and `https://api.paxalabs.com/v1/audio/transcriptions` for speech to text. A new account starts with 100 free credits.

## Choose a model and a voice

An app's OpenAI defaults keep working. Paxa accepts OpenAI's speech and transcription model names, `gpt-4o-transcribe-diarize` aside, and its 13 voice names, and [maps each voice name](https://paxalabs.com/docs/accepted-voice-names) to a Paxa voice.

To choose the voice yourself, set the model to `paxa-tts-flash-v2` and the voice to a Paxa voice id, such as `khanomkrok`. [GET /v1/voices](https://paxalabs.com/docs/api/voices) lists every voice with its model, and the [voice library](https://paxalabs.com/voices) plays them. For transcription, set the model to `paxa-stt-lite-v1-preview`, a Research preview.

## Setup guides

- [Use Paxa with Open WebUI](https://paxalabs.com/docs/integrations/open-webui): Read chat replies aloud and dictate messages
- [Use Paxa with LibreChat](https://paxalabs.com/docs/integrations/librechat): Speech and transcription from librechat.yaml
- [Use Paxa with AnythingLLM](https://paxalabs.com/docs/integrations/anythingllm): Spoken replies, dictated prompts, and transcribed uploads
- [Use Paxa with Home Assistant](https://paxalabs.com/docs/integrations/home-assistant): A voice for the assistant and for announcements
- [Use Paxa with SillyTavern](https://paxalabs.com/docs/integrations/sillytavern): A voice for each character
- [Use Paxa with LiveKit Agents](https://paxalabs.com/docs/integrations/livekit): Speech and transcription for voice agents
- [Use Paxa with Strands Agents](https://paxalabs.com/docs/integrations/strands): Paxa tools for Strands agents through MCP

## Check the connection

Many apps show a generic error when a request fails. To read the cause, send the same request with curl, using the model and voice your app sends.

curl:

```bash
curl -X POST https://api.paxalabs.com/v1/audio/speech \
  -H "Authorization: Bearer $PAXA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "paxa-tts-flash-v2",
    "input": "สวัสดีครับ ยินดีต้อนรับสู่ Paxa Labs",
    "voice": "khanomkrok"
  }' \
  --output speech.mp3
```

A working setup writes an MP3 file. A refused request writes a short JSON body to the same file, and its `title` field names the cause.

| Code | Cause |
| --- | --- |
| unauthorized | The API key is missing or mistyped. |
| insufficient_credits | The account has run out of credits. |
| unknown_model | The model is neither a Paxa model id nor an accepted name. |
| unknown_voice | The voice is neither a voice of that model nor an accepted name. |
| validation | A field is outside what Paxa accepts, such as a speed above 1.5. `path` names the field. |

The [error catalog](https://paxalabs.com/docs/errors) lists every code.

## Tag your integration

If you publish an integration that other people install, such as a plugin or a client library, send the optional `x-paxa-client` request header with its name and version. It tells Paxa which integration a request comes from.

curl:

```bash
curl -X POST https://api.paxalabs.com/v1/audio/speech \
  -H "Authorization: Bearer $PAXA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-paxa-client: my-plugin/1.4.0" \
  -d '{
    "model": "paxa-tts-flash-v2",
    "input": "สวัสดีครับ ยินดีต้อนรับสู่ Paxa Labs",
    "voice": "khanomkrok"
  }' \
  --output speech.mp3
```

- The value is a name, or a name and a version joined by `/`, such as `my-plugin` or `my-plugin/1.4.0`.
- A name has 1 to 48 characters from lowercase letters, digits, `.`, `_`, and `-`, and starts with a letter or digit.
- A version has 1 to 24 characters from the same set plus `+`, and starts with a letter or digit.
- Paxa trims spaces around the value and lowercases it before reading it.
- Paxa ignores a value in any other form, and the request proceeds as if the header were absent.

The header changes nothing about the request, its response, or its price. The speech, transcription, OCR, Document Extraction, and translation endpoints read it, and voice design does not. On a live socket, send it with the upgrade request. The API's CORS policy allows it, which lets browser clients send it too.
