XTTS-v2

XTTS

Coqui XTTS-v2 multilingual zero-shot voice cloning TTS (tts_models/multilingual/multi-dataset/xtts_v2).

Audio Generationvoice-cloningtext-to-speechttsspeech-synthesismultilingualFine-tunable
XTTS-v2: Audio Generation model on Kainguru

About XTTS-v2

Coqui XTTS-v2 — a multilingual zero-shot voice cloning text-to-speech model. Given a text string and a short reference audio clip of a speaker, it synthesizes new speech in that speaker's voice, with optional quality verification (WER/CER retries) and fine control over decoder sampling and reference-audio preprocessing.

Capabilities

  • Zero-shot voice cloning — clone a speaker from a short data_path reference WAV
  • Multilingual synthesis — language supports 17 languages (English, Turkish, French, German, Italian, Portuguese, Polish, Russian, Dutch, Czech, Arabic, Chinese, Japanese, Hungarian, Korean, Hindi, Spanish)
  • Quality verification — optional verify pass checks WER/CER against the input text and retries generation (wer_threshold, cer_threshold, max_attempts)
  • Decoder sampling control — generation_kwargs group exposes temperature, repetition/length penalty, top-k/top-p, speed, and GPT conditioning length
  • Reference-audio preprocessing — preprocessing group can denoise, trim silence, and peak-normalize the speaker reference before cloning
  • Reproducible generation — fix output with seed

XTTS-v2 inputs and output

NameTypeRequiredDefaultDetails
texttextYes—Text to be synthesized. Empty values are not accepted.
Min 1 characters · text/plain
data_pathfileYes—Speaker reference WAV. The source audio that will be cloned.
audio/wav
languagetextNoenLanguage code for synthesis.
Allowed: en, tr, fr, de, it, pt, pl, ru, nl, cs, ar, zh-cn, ja, hu, ko, hi, es
verifybooleanNotrueWhether to verify the generated audio against the input text using WER/CER metrics.
wer_thresholdnumberNo0.15Word Error Rate threshold. Generation is retried if WER exceeds this value.
0–1
cer_thresholdnumberNo0.08Character Error Rate threshold. Generation is retried if CER exceeds this value.
0–1
max_attemptsintegerNo3Maximum number of generation retries when WER/CER checks fail.
1–10
seedintegerNo1234Random seed for reproducible generation.
0–2147483647
generation_kwargsobjectNo—Advanced sampling parameters for the XTTS decoder.
generation_kwargs.temperaturenumberNo0.85Sampling temperature. Lower values produce more monotone speech with fewer errors.
0.3–1
generation_kwargs.repetition_penaltynumberNo1.5Penalizes repeated tokens. Higher values reduce repetition.
1–5
generation_kwargs.length_penaltynumberNo0.85Adjusts the generated sequence length.
0.5–2
generation_kwargs.top_kintegerNo50Number of highest-probability tokens to keep for sampling.
1–200
generation_kwargs.top_pnumberNo0.95Cumulative probability threshold for nucleus sampling.
0.5–1
generation_kwargs.speednumberNo0.95Speech rate multiplier.
0.5–2
generation_kwargs.enable_text_splittingbooleanNofalseSplit long input text into shorter segments for better quality.
generation_kwargs.gpt_cond_lenintegerNo30Max length in seconds of the speaker conditioning audio used by the GPT stage.
6–30
generation_kwargs.gpt_cond_chunk_lenintegerNo4Chunk size in seconds for the GPT conditioning step.
1–30
generation_kwargs.sound_norm_refsbooleanNofalseWhether to normalize the speaker reference audio amplitude.
preprocessingobjectNo—Preprocessing options applied to the speaker reference audio before cloning.
preprocessing.noise_reducetextNoautoControls noise reduction on the speaker reference audio.
Allowed: auto, true, false
preprocessing.trim_silencebooleanNofalseRemove leading and trailing silence from the speaker reference audio.
preprocessing.peak_normalizebooleanNofalseNormalize the speaker reference audio to the target peak level.
preprocessing.trim_threshold_dbnumberNo-40.0Silence threshold in decibels for silence trimming.
preprocessing.peak_targetnumberNo0.95Target peak amplitude for normalization (0.0-1.0).
0–1

Output. Returns WAV audio: Generated speech audio file

Run XTTS-v2 with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=XTTS" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "data_path": "https://kainguru-public-dev.s3.ca-central-1.amazonaws.com/samples/019de2e8-858f-7c23-a09d-2b13d7052dc8_xtts-sample-input.wav",
    "text": "Hi, this is a test recording. I will try to clone with this audio.",
    "cer_threshold": 0.08,
    "language": "en",
    "max_attempts": 3,
    "seed": 1234,
    "verify": true,
    "wer_threshold": 0.15
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "XTTS",
        {
          "data_path": "https://kainguru-public-dev.s3.ca-central-1.amazonaws.com/samples/019de2e8-858f-7c23-a09d-2b13d7052dc8_xtts-sample-input.wav",
          "text": "Hi, this is a test recording. I will try to clone with this audio.",
          "cer_threshold": 0.08,
          "language": "en",
          "max_attempts": 3,
          "seed": 1234,
          "verify": True,
          "wer_threshold": 0.15
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune XTTS-v2

You can fine-tune XTTS-v2 on your own data and run the tuned model through the same API. Dataset: Voice clips of ONE voice, each with the transcript of what is said in it. Items are {file, text}; the backend builds the trainer metadata.csv automatically.

The steps are in the docs.

XTTS-v2 pricing

Price per second: 0.007 credits ($0.00007). The price is shown again before every run; all prices are on the pricing page.

CosyVoice3 0.5B: Audio Generation model on Kainguru
Audio Generation

CosyVoice3 0.5B

Text-to-speech in nine languages and Chinese dialects: clone a voice from a short clip, steer emotion, speed or…

Fine-tunable
MOSS-TTS Realtime: Audio Generation model on Kainguru
Audio Generation

MOSS-TTS Realtime

Natural speech for voice agents in 20 languages, in a voice cloned from a short clip. Built for streaming, served here…

Fine-tunable
MOSS-TTS v1.5: Audio Generation model on Kainguru
Audio Generation

MOSS-TTS v1.5

Speech in 31 languages from text, in a voice cloned from a short clip, with the language, the length and pauses under…

Fine-tunable
MOSS-TTSD: Audio Generation model on Kainguru
Audio Generation

MOSS-TTSD

Two-speaker dialogue from a script of [S1] and [S2] turns, up to 90 seconds, each voice cloned from its own short…

Fine-tunable
Qwen3-TTS 1.7B Base: Audio Generation model on Kainguru
Audio Generation

Qwen3-TTS 1.7B Base

Text-to-speech in ten languages that copies a voice from a few seconds of speech. Fine-tune it on recordings of one…

Fine-tunable
VoxCPM2: Audio Generation model on Kainguru
Audio Generation

VoxCPM2

Text-to-speech in 30 languages at 48 kHz: design a voice from a description, clone one from a short clip, or continue…

Fine-tunable