Public API v1

Synthesize a multi-speaker dialogue

Changed on

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 AI-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 to choose the TTS engine (each is billed at its own multiplier); omit it for the configured default, which GET /v1/engines reports as isDefault. Every turn’s voice must belong to the engine that runs. Returns a presigned audioUrl.

post/api/v1/dialogue

Request

  • Base URL
    https://api.vieneu.io
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

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 AI 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, and so is your pronunciation dictionary (see applyPronunciation). Applies across every turn.

applyPronunciationboolean

Read the text through your account's pronunciation dictionary — the rules saved at https://vieneu.io/#/pronunciation (Từ điển phát âm). Defaults to TRUE, and changes nothing until you have saved rules there. The rules run after aiRefine and before synthesis; you are billed for the text you sent, and that is the text kept with the job. Set false to read this request as written. If your rules make the text longer than the request limit, or more than twice as long plus 1,000 characters, the call is refused with 400 PRONUNCIATION_EXPANDED_TOO_LONG, uncharged. Applies to each turn, against the 5000-character turn limit.

engine'v4'

TTS engine — each is billed at its own multiplier. Every turn's voice must belong to this engine (see GET /v1/voices?engine=…). Omit to use the configured default; GET /v1/engines names it as isDefault and lists the live multipliers.

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,
  "applyPronunciation": true,
  "engine": "v4"
}

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