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

# Custom Voices

> Clone your own voice using a short audio sample

Create your own custom voice clones from audio samples. Custom voices are passed to TTS using the `voice_id` parameter (not `voice`).

## Create a Custom Voice

Upload an audio file to create a new voice clone. A minimum of 10 seconds of clear audio is recommended for best results.

> [!NOTE]
>
> New voice clones are enhanced by default (`enhance=true`). To opt out, send `enhance=false` when creating a voice. See the [opt-out example](#opt-out-of-enhancement).

```python theme={null}
import json
import gradium

client = gradium.client.GradiumClient()

voice = await gradium.voices.create(
    client,
    audio_file="my_voice_sample.wav",
    name="My Custom Voice",
    description="A voice created from my recording",
    language="en",
    start_s=0.0,
)
print(json.dumps(voice, indent=2))
```

### Opt out of enhancement

To create a voice without enhancement, set `enhance=false` in your voice creation request:

```bash theme={null}
curl -X POST https://api.gradium.ai/api/voices/ \
  -H "x-api-key: $GRADIUM_API_KEY" \
  -F "audio_file=@my_voice_sample.wav" \
  -F "name=My Custom Voice" \
  -F "language=en" \
  -F "enhance=false"
```

Omit `enhance`, or set it to `true`, to use the default enhancement.

Voice responses include the stored `enhance` value. After creating a voice, [retrieve it](https://docs.gradium.ai/api-reference/endpoint/get-voice.md) and check for `"enhance": false` to confirm the opt-out was saved.

### Parameters

The API accepts the following parameters. `enhance` and `timeout_s` are available through direct API requests.

| Parameter | Type | Required | Description |
| :- | :- | :-: | :- |
| `audio_file` | `string` | Yes | Path to the audio file (WAV, MP3, etc.) |
| `name` | `string` | Yes | A name for the voice |
| `description` | `string` | No | A description of the voice |
| `language` | `string` | Yes | Language spoken in the audio sample. One of `"en"`, `"fr"`, `"de"`, `"es"`, `"pt"`. Also what [Voice Localization](https://docs.gradium.ai/guides/voices/voice-localization.md) uses as the source language, so it must match the recording. |
| `start_s` | `float` | No | Start time in seconds to begin sampling from the audio file (default `0.0`) |
| `enhance` | `boolean` | No | Enhance the new voice clone (default `true`). Set to `false` to opt out. |
| `timeout_s` | `float` | No | Maximum seconds to wait for embedding extraction (default `10.0`) |
| `input_format` | `string` | No | Audio format. If omitted, inferred from the file extension |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.