> ## Documentation Index
> Fetch the complete documentation index at: https://runcrate.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Voice Cloning API

> Clone any voice from a short audio sample using HiggsAudio, Zonos, and Chatterbox. Generate speech that sounds like the original speaker.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

Clone a voice from a short reference audio sample and generate new speech in that voice. Useful for personalized TTS, localization, audiobook narration, and character voices.

## Available models

| Model                       | Languages | Strengths                               |
| --------------------------- | --------- | --------------------------------------- |
| **HiggsAudio V2.5**         | 20+       | Highest fidelity, emotion preservation  |
| **Zonos v0.1**              | 10+       | Fast inference, real-time apps          |
| **Chatterbox Multilingual** | 30+       | Widest language coverage, cross-lingual |

***

## Basic voice cloning

Provide a 10-30 second audio sample of the target voice:

<CodeGroup>
  ```python Python theme={"theme":"github-dark"}
  from runcrate import Runcrate

  client = Runcrate(api_key="rc_live_YOUR_API_KEY")
  audio = client.models.text_to_speech(
      model="bosonai/HiggsAudioV2.5",
      input="Welcome to our quarterly earnings call. Strong growth across all segments.",
      reference_audio="./ceo-sample.mp3",
  )
  with open("cloned-speech.mp3", "wb") as f:
      f.write(audio)
  ```

  ```typescript TypeScript theme={"theme":"github-dark"}
  import Runcrate from '@runcrate/sdk';
  import { writeFileSync } from 'fs';

  const rc = new Runcrate({ apiKey: 'rc_live_YOUR_API_KEY' });
  const audio = await rc.models.textToSpeech({
    model: 'bosonai/HiggsAudioV2.5',
    input: 'Welcome to our quarterly earnings call.',
    referenceAudio: './ceo-sample.mp3',
  });
  writeFileSync('cloned-speech.mp3', Buffer.from(audio));
  ```

  ```bash curl theme={"theme":"github-dark"}
  curl https://api.runcrate.ai/v1/audio/speech \
    -H "Authorization: Bearer rc_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"model": "bosonai/HiggsAudioV2.5", "input": "Welcome to our quarterly earnings call.", "reference_audio": "https://example.com/ceo-sample.mp3"}' \
    --output cloned-speech.mp3
  ```
</CodeGroup>

<Tip>
  `reference_audio` accepts a **file path** (auto base64-encoded), a **URL**, or raw **base64** data.
</Tip>

***

All examples below reuse the same `client`.

## Cross-lingual cloning

```python theme={"theme":"github-dark"}
audio = client.models.text_to_speech(
    model="ResembleAI/chatterbox-multilingual",
    input="Bienvenidos a nuestra presentacion trimestral.",
    reference_audio="./english-speaker.mp3", language="es",
)
with open("spanish-clone.mp3", "wb") as f:
    f.write(audio)
```

***

## Real-time cloning (Zonos)

```python theme={"theme":"github-dark"}
audio = client.models.text_to_speech(
    model="Zyphra/Zonos-v0.1-transformer",
    input="Your order has been confirmed and will arrive by Thursday.",
    reference_audio="./brand-voice.mp3",
)
with open("notification.mp3", "wb") as f:
    f.write(audio)
```

***

## Batch narration

```python theme={"theme":"github-dark"}
chapters = [
    {"file": "ch01.mp3", "text": "Chapter one. The morning light crept through the curtains."},
    {"file": "ch02.mp3", "text": "Chapter two. The letter arrived on a Tuesday."},
    {"file": "ch03.mp3", "text": "Chapter three. Three weeks had passed since the call."},
]
for ch in chapters:
    audio = client.models.text_to_speech(
        model="bosonai/HiggsAudioV2.5", input=ch["text"], reference_audio="./narrator.mp3",
    )
    with open(ch["file"], "wb") as f:
        f.write(audio)
```

***

## Tips

* **Reference quality matters.** Clean recording, minimal noise, 10-30s of clear speech.
* **HiggsAudio for fidelity.** When the clone must be indistinguishable from the original.
* **Chatterbox for languages.** 30+ languages, cross-lingual cloning.
