Control variation with temperature

temperature sets how much a Paxa TTS Flash v2 reading varies from one request to the next, from 0 to 2. What it changes, designed voices, where it is read, and billing.

View as Markdown

temperature is a field of POST /v1/tts that sets how much a reading varies from one request to the next: its pacing, pauses, breaths, and melody. It runs from 0 to 2 and defaults to 0.5. Paxa TTS Flash v2 reads it.

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

Values#

  • 0 varies least. The same text in the same voice comes back closest in timing and melody from one request to the next. Two requests are not guaranteed to match.
  • 0.5 is the default. An omitted field and 0.5 are one request.
  • 2 varies the reading most.
  • Values round to the nearest 0.1. A value outside 0 to 2 answers 400 validation.

Designed voices#

On a designed voice, as on any other, lower values hold the voice steadier and higher values vary it more.

Models#

Paxa TTS Flash v2 (paxa-tts-flash-v2) reads temperature. On Paxa TTS Flash (paxa-tts-flash-v1), a value that rounds to 0.5 is accepted, and any other answers 400 validation with path body.temperature and reason not_allowed, before any charge.

Where it is read#

  • POST /v1/tts.
  • POST /v1/audio/speech, as a Paxa extension to OpenAI's body. The OpenAI-compatible transcription endpoint ignores its own temperature.
  • The start frame of WS /v1/tts/live, fixed for the connection. The started event echoes it when it is not 0.5. A start frame whose model refuses it answers an error event with validation, and the connection stays open for a corrected start frame.

Billing and idempotency#

A request costs the same at every temperature. Under an Idempotency-Key, temperature is part of the request: a retry with a different value answers 422 idempotency_mismatch, and an omitted field matches 0.5.