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.

View as Markdown

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.

SettingValue
Base URLhttps://api.paxalabs.com/v1
API keyA Paxa key from the dashboard

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 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 lists every voice with its model, and the voice library plays them. For transcription, set the model to paxa-stt-lite-v1-preview, a Research preview.

Setup guides#

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
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.

CodeCause
unauthorizedThe API key is missing or mistyped.
insufficient_creditsThe account has run out of credits.
unknown_modelThe model is neither a Paxa model id nor an accepted name.
unknown_voiceThe voice is neither a voice of that model nor an accepted name.
validationA field is outside what Paxa accepts, such as a speed above 1.5. path names the field.

The error catalog 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
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.