Public API v1

Dub an .srt subtitle file into a timecode-aligned WAV

Changed on

Synthesizes each subtitle cue and places it at its start timecode (silence-padded; overruns shift later cues). Billed by total submitted cue-text characters (~1 token/char, minimum 50, × the AI surcharge only when you opt in with aiRefine=true) — NOT output duration. With aiRefine=true the subtitles are moderated and each cue is AI-normalized; by default cues are synthesized as provided, with no content check and no surcharge. Pass engine to choose the TTS engine (each is billed at its own multiplier), or omit it for the configured default — GET /v1/engines reports it as isDefault. Tokens are deducted upfront and refunded if synthesis fails.

post/api/v1/srt

Request

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

Request body multipart/form-data

filestring binary required
voiceIdstring required
emotionstring
temperaturenumber
aiRefineboolean

AI text refinement across all cues (moderation + per-cue AI normalization, billed with the AI surcharge). Defaults to FALSE: cues are synthesized as submitted, with no content check and no surcharge. Pass true to opt in — as a multipart field, the string "true" (or 1/on/yes); anything else, an empty field included, leaves the AI step off.

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 cue. As a multipart field, the string "false" (or 0/off/no) turns it off; anything else leaves it on.

engine'v4'

TTS engine — each billed at its own multiplier. Omit it for the configured default, which GET /v1/engines reports as isDefault. The voice must belong to the engine that runs; the two catalogues share no ids.

Example request

{
  "voiceId": "Ngọc Lan",
  "emotion": "natural",
  "temperature": 1,
  "applyPronunciation": true,
  "engine": "v4"
}

Response

The timecode-aligned track, plus per-cue placement showing where speed-fit or drift moved a cue.

successboolean required
cuesCountnumber required

Number of subtitle cues synthesized.

audioUrlstring required

Presigned S3 download URL for the timecode-aligned WAV.

audioUrlExpiresInnumber required

Seconds until audioUrl expires.

durationnumber required

Total duration of the dubbed track (seconds).

sampleRatenumber required

Output sample rate.

tokenCostnumber required

Tokens deducted (computed from total cue text).

Example response

{
  "success": true,
  "cuesCount": 42,
  "audioUrl": "https://s3.amazonaws.com/bucket/srt/job.wav?X-Amz-Expires=86400&...",
  "audioUrlExpiresIn": 86400,
  "duration": 128.4,
  "sampleRate": 48000,
  "tokenCost": 1875,
  "placements": [
    {
      "index": 7,
      "scheduledStartMs": 12000,
      "actualStartMs": 12180,
      "windowMs": 2000,
      "durationMs": 2400,
      "speed": 1.2,
      "overflowed": true
    }
  ]
}

Changes