Public API v1

Synthesize a multi-speaker dialogue

Synthesizes an ordered list of turns (1–50), each with its own voice and emotion, into a single concatenated WAV. Tokens are deducted upfront, billed by the submitted character count (minimum 50, × the AI surcharge only when you opt in with aiRefine: true), and refunded if synthesis fails. With aiRefine: true the dialogue is moderated and each turn is pronunciation-normalized (formulas, acronyms, mixed English), billed with the surcharge; by default (false) turns are synthesized as provided — no content check, no normalization, no surcharge. Pass engine ("v3" default, "v4" premium — billed at its own multiplier) to choose the TTS engine; every turn's voice must belong to it. Returns a presigned audioUrl.

post/api/v1/dialogue

Request body

pauseBetweenTurnsMsnumber

Silence gap between turns (ms, 0–5000).

temperaturenumber

Sampling temperature applied to all turns (0.0–2.0).

aiRefineboolean

AI text refinement. Defaults to FALSE on the public API: the text is synthesized as submitted, with no AI moderation and no pronunciation normalization, billed at the plain per-character rate. Set true to run the same AI step the web app uses — formulas, acronyms and mixed-in English are read correctly and the content is checked — billed with the AI surcharge and one extra model round-trip of latency. Deterministic text preparation is applied either way. Applies across every turn.

engine'v3' | 'v4'

TTS engine — "v3" (default) or "v4" (premium, billed at its own multiplier). Every turn's voice must belong to this engine (see GET /v1/voices?engine=…). Omit to use the platform default.

Example request

{
  "turns": [
    {
      "speaker": "Host",
      "voiceId": "Ngọc Lan",
      "text": "Xin chào, hôm nay bạn thế nào?",
      "emotion": "natural"
    }
  ],
  "pauseBetweenTurnsMs": 500,
  "temperature": 1,
  "engine": "v3"
}

Response

The concatenated dialogue, as a presigned WAV URL.

successboolean required
turnsCountnumber required

Number of turns synthesized.

speakersstring[] required

Unique speaker labels in order of first appearance.

audioUrlstring required

Presigned S3 download URL for the concatenated WAV.

audioUrlExpiresInnumber required

Seconds until audioUrl expires.

durationnumber required

Duration of the concatenated audio (seconds).

tokenCostnumber required

Tokens deducted for this request.

Example response

{
  "success": true,
  "turnsCount": 4,
  "speakers": [
    "Host",
    "Guest"
  ],
  "audioUrl": "https://s3.amazonaws.com/bucket/dialogue/job.wav?X-Amz-Expires=3600&...",
  "audioUrlExpiresIn": 3600,
  "duration": 12.4,
  "tokenCost": 120
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.