# Pika Voice Cloning

> Clone a voice from recordings of one speaker, then pass its `voice_id` as `voice` on a text-to-speech request. Only the organization that cloned a voice can use it.

- Console: https://dev.pika.art/voices
- Human guide: https://dev.pika.art/models/voice-cloning
- API index: https://dev.pika.art/llms.txt

## Clone a voice

```http
POST https://api.dev.pika.art/v1/voices
authorization: Bearer $PIKA_API_KEY
content-type: application/json

{
  "name": "Narrator",
  "sample_urls": ["https://example.com/narrator.mp3"],
  "consent_attested": true
}
```

- `name`: 1 to 100 characters.
- `sample_urls`: 1 to 25 HTTPS URLs of clean recordings of one speaker. One to two minutes in total works best. Upload local files first with the media uploads endpoint and pass the hosted URLs.
- `consent_attested`: must be `true`. It confirms you have the speaker's permission.

The `201` response:

```json
{
  "voice_id": "voice_3f9c2a1e8b7d4c6f9a0e5b2d7c1f8a4e",
  "name": "Narrator",
  "kind": "cloned",
  "provider": "elevenlabs",
  "created_at": 1789286400
}
```

`created_at` is unix seconds. Stock voices in the list have `kind: "stock"` and `null` for `provider` and `created_at`.

## Speak with it

Pass the `voice_id` as `voice` on a text-to-speech submit. A clone works only on models from the provider in its `provider` field.

```http
POST https://api.dev.pika.art/v1/media/elevenlabs/eleven-v4/text-to-speech
authorization: Bearer $PIKA_API_KEY
content-type: application/json

{
  "text": "Welcome back.",
  "voice": "voice_3f9c2a1e8b7d4c6f9a0e5b2d7c1f8a4e"
}
```

Models that take a cloned voice:

- [Eleven v4 Text To Speech](https://dev.pika.art/models/elevenlabs/eleven-v4/text-to-speech) (`elevenlabs/eleven-v4/text-to-speech`, provider `elevenlabs`, ElevenLabs)
- [Eleven v4 Turbo Text To Speech](https://dev.pika.art/models/elevenlabs/eleven-v4-turbo/text-to-speech) (`elevenlabs/eleven-v4-turbo/text-to-speech`, provider `elevenlabs`, ElevenLabs)

## Endpoints

| Endpoint | Does |
| --- | --- |
| `POST /v1/voices` | Clone a voice. Answers `201` with the voice. Synchronous; can take over a minute. |
| `GET /v1/voices` | `{ results: [...] }`: stock voices, then your clones, newest first. |
| `GET /v1/voices/{voice_id}` | One clone. |
| `DELETE /v1/voices/{voice_id}` | Deletes a clone. Answers `204`. Queued requests that use it fail. |

## Limits and errors

- Up to 100 clones per organization.
- The first 5 clones are free, deleted ones included. Each one after costs $1.

| Error | Meaning |
| --- | --- |
| `409` | The organization already has 100 clones. Delete one first. |
| `400` | The samples could not be fetched, or the provider refused them. |
| `invalid_input` | A text-to-speech request named an unknown, deleted, or another organization's voice. |

