# Clone voice

URL: https://clippie.ai/developers/docs/clone-voice

Clones a narrator voice from an audio sample and saves it to the user's voices. Upload the sample first with upload_file (1 to 3 minutes of one person speaking clearly, no music, MP3 or WAV under 10 MB) and pass its fileId. Before calling, ask the user to confirm this and pass consent: true only when they do: "I own this voice, or I have the speaker's permission to clone it. I won't use it to impersonate anyone or to mislead people." Spends no credits but uses one of the plan's custom voice slots. Returns a voice id for text_to_speech and every voiceId input. Clone once and reuse the id; do not clone the same voice again.

## At a glance

| Property | Value |
| --- | --- |
| REST | `POST https://api.clippie.ai/v1/voices/clone` |
| MCP tool | `clone_voice` |
| Scope | `create` |
| Cost | Spends nothing. Needs the `create` scope. |

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `fileId` | body | string | Yes |  | file_… from upload_file: an audio file of the voice. 1-80 chars. |
| `name` | body | string | Yes |  | What to call the voice, e.g. "Narrator". 1-60 chars. |
| `consent` | body | boolean | Yes |  | True only after the user confirms: "I own this voice, or I have the speaker's permission to clone it. I won't use it to impersonate anyone or to mislead people." |
| `removeBackgroundNoise` | body | boolean | No | `false` | Clean up background noise in the sample first. Leave off for clean recordings. |
| `idempotencyKey` | body | string | No |  | Reuse it when retrying, so a retry returns the voice from the first call instead of cloning twice. 1-200 chars. |

## Example

curl:

```bash
curl https://api.clippie.ai/v1/voices/clone \
  -H "Authorization: Bearer $CLIPPIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fileId": "file_FROM_UPLOAD_FILE",
    "name": "Narrator",
    "consent": true
  }'
```

clone-voice.mjs:

```js
const auth = { Authorization: `Bearer ${process.env.CLIPPIE_API_KEY}` };

const res = await fetch('https://api.clippie.ai/v1/voices/clone', {
  method: 'POST',
  headers: { ...auth, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "fileId": "file_FROM_UPLOAD_FILE",
    "name": "Narrator",
    "consent": true
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
console.log(await res.json());
```

## Response

`200` with JSON. The full response schema is in the [OpenAPI spec](https://api.clippie.ai/v1/openapi.json).

## From an MCP client

Your AI calls `clone_voice` with the same fields as JSON arguments. See [MCP server](https://clippie.ai/developers/docs.md#mcp) to connect one.

tools/call:

```json
{
  "name": "clone_voice",
  "arguments": {
    "fileId": "file_FROM_UPLOAD_FILE",
    "name": "Narrator",
    "consent": true
  }
}
```
