Public API v1

Synthesize text in a cloned voice

Zero-shot voice cloning. Upload a reference clip via POST /v1/upload, then pass its refFileId plus the exact refText (transcript of that clip) to synthesize text in that voice. Pass engine ("v3" default, "v4" premium) to choose the cloning engine; billing carries that engine's multiplier. Tokens are deducted upfront from text. Returns a presigned audioUrl.

post/api/v1/clone

Request body

textstring required

Vietnamese text to synthesize in the cloned voice.

refFileIdstring required

fileId returned by POST /v1/upload — the reference audio to clone. Must be one of your own uploads.

refTextstring required

Exact transcript of the reference audio. Required for zero-shot cloning quality.

emotion'natural' | 'storytelling' | 'tin_tuc' | 'tu_nhien' | 'doc_truyen' | 'emotion_0' | 'emotion_1' | 'emotion_2' | 'emotion_3' | 'emotion_4' | 'emotion_5' | 'emotion_6' | 'emotion_7' | 'emotion_8' | 'emotion_9' | 'emotion_10' | 'emotion_11' | 'emotion_12' | 'emotion_13' | 'emotion_14' | 'emotion_15' | 'emotion_16' | 'emotion_17' | 'emotion_18' | 'emotion_19'
temperaturenumber
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.

engine'v3' | 'v4'

TTS engine to clone on — "v3" (default) or "v4" (premium, billed at its own multiplier; V4 is built for cloning). The engine must declare the "clone" capability. Omit to use the platform default.

Example request

{
  "text": "Xin chào, đây là giọng nói được nhân bản.",
  "refFileId": "uploads/user-123/1716000000000_abc123.wav",
  "refText": "Đây là nội dung chính xác của đoạn audio tham chiếu.",
  "emotion": "natural",
  "temperature": 1,
  "engine": "v3"
}

Response

The synthesized audio in the cloned voice, as a presigned URL.

successboolean required
audioUrlstring required

Presigned S3 download URL for the cloned-voice WAV.

audioUrlExpiresInnumber required

Seconds until audioUrl expires.

durationnumber required

Duration of the synthesized audio (seconds).

tokenCostnumber required

Tokens deducted for this request.

Example response

{
  "success": true,
  "audioUrl": "https://s3.amazonaws.com/bucket/cloned/job.wav?X-Amz-Expires=3600&...",
  "audioUrlExpiresIn": 3600,
  "duration": 4.1,
  "tokenCost": 60
}

Changes

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