---
title: "Create new voice from audio/video file sample"
method: POST
path: "/saas/voice/clone"
tags: ["Voice"]
---

# Create new voice from audio/video file sample

`POST /saas/voice/clone`

### Description
Endpoint allows users to clone voices from audio or video samples. Uploading process is similar to the
[Blob API](https://api.palabra.ai/docs#/Blob).

Notice, for now samples count for voice cloning is limited to `1` sample.

Files submission occurs in several requests:
1. Client sends a POST request to the endpoint with a list of files to upload. Server verify the request
and generates a pre-signed URL for each submitted file.
2. Client sends a POST request to each pre-signed URL with the file to upload.
3. *Optional:* Client might request 'GET /saas/voice/m/voice_id' to receive processing status.

### Examples
#### cURL

**1. Submitting a list of voice data to create voice records.**

```shell
curl -X 'POST' \
  'https://api.palabra.ai/saas/voice/clone' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <JWT_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "data": {
    "name": "Awesome voice name",
    "samples": [
      {
        "filename": "mysample.pm3",
        "mime_type": "audio/x-wav",
        "display_name": "mysample",
        "description": "My voice sample",
        "denoise": false,
        "speech_normalization": false,
        "lang_code": "en"
      }
    ],
    "description": "My awesome voice",
    "labels": {
      "gender": "Male",
      "age_group": "Young",
      "mood": "Neutral"
    }
  }
}'
```

**2. Submitting files**

Endpoint respond with a JSON array object containing `url` and `form_data` keys for each submitted file.
In the following example, we're use cURL command making a POST FormData request to upload a file:
```shell
curl -X POST \
-F 'key=bl...0f' \
-F 'x-amz-algorithm=AWS4-HMAC-SHA256' \
... Other form data fields from the response...
-F 'policy=eyJleHBpc...zA3WiJ9XX0=' \
-F 'x-amz-signature=463f78071...847af0c' \
-F file=@<file path at your file system> \
https://url.from.the/response/
```

### References
- [Blob API](https://api.palabra.ai/docs#/Blob)

## Request body

- GenericRequestPayloadVoiceCloneRequest
  - `data` VoiceCloneRequest, required
    - `name` string, required — Name of the of the voice
    - `samples` VoiceSample[], required — List of voice samples to upload
      - `filename` string, required — File name. Ex: 'awesome_file.mp4'
      - `mime_type` 'audio/x-wav' | 'audio/wav' | 'audio/mp3' | 'audio/x-m4a' | 'audio/mpeg' | 'audio/flac' | 'video/webm' | 'video/mp4' | 'video/mpeg' | 'image/png' | 'image/jpeg' | 'image/webp', required — Allowed MIME types
      - `display_name` string — File display name.
      - `description` string — File description.
      - `item_id` string — Identifier of the item. It represents the file ID in the request when uploading multiple files. Use it to identify the upload URL in the response related to the target file.
      - `denoise` boolean — Set `denoise` to `true` denoise if a sample contains background noise
      - `speech_normalization` boolean — Set `speech_normalization` to `true` if a sample needs to be normalized
      - `lang_code` 'ar' | 'ar-ae' | 'ar-sa' | 'az' | 'hy' | 'be' | 'bg' | 'bs' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'en-au' | 'en-ca' | 'en-gb' | 'en-us' | 'es' | 'es-mx' | 'es-co' | 'es-ar' | 'es-ch' | 'es-la' | 'et' | 'fi' | 'fil' | 'fr' | 'fr-ca' | 'gl' | 'he' | 'hi' | 'hr' | 'hu' | 'id' | 'is' | 'it' | 'ja' | 'kk' | 'ko' | 'lt' | 'lv' | 'mk' | 'ms' | 'nl' | 'no' | 'pl' | 'pt' | 'pt-br' | 'ro' | 'ru' | 'sk' | 'sl' | 'sr' | 'sv' | 'sw' | 'ta' | 'th' | 'tr' | 'uk' | 'ur' | 'vi' | 'zh' | 'zh-hans' | 'zh-hant' | 'auto' | 'bn' | 'eu' | 'fa' | 'ga' | 'mn' | 'mr' | 'mt' | 'ug' | 'yue', required
    - `description` string — Description of the file.
    - `labels` Labels
      - `gender` 'Female' | 'Male' | 'Neutral'
      - `age_group` 'Young' | 'Middle Age' | 'Senior'
      - `mood` 'Neutral' | 'Happy' | 'Sad' | 'Angry'
    - `skip_external_voice` boolean — Skip external voice provider creation during cloning
    - `attributes` string[] — Custom voice attributes/tags

## Response `200`

Successful Response

- GenericResponsePayloadVoiceCloneResponseData
  - `ok` boolean — Indicates if the request was successful or not.
  - `data` VoiceCloneResponseDataOutput, required
    - `utc_created_at` string, date-time, required
    - `voice_id` string, uuid, required
    - `user_id` string, required
    - `name` string, required
    - `voice_type` 'instantly_cloned' | 'instantly_cloned_builtin', required
    - `processing_status` 'created' | 'pending' | 'ready' | 'failed', required
    - `description` string
    - `labels` Labels
      - `gender` 'Female' | 'Male' | 'Neutral'
      - `age_group` 'Young' | 'Middle Age' | 'Senior'
      - `mood` 'Neutral' | 'Happy' | 'Sad' | 'Angry'
    - `lang_code` 'ar' | 'ar-ae' | 'ar-sa' | 'az' | 'bg' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'en-au' | 'en-ca' | 'en-gb' | 'en-us' | 'es' | 'es-mx' | 'es-co' | 'es-ar' | 'es-ch' | 'es-la' | 'fi' | 'fil' | 'fr' | 'fr-ca' | 'he' | 'hi' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'ms' | 'nl' | 'no' | 'pl' | 'pt' | 'pt-br' | 'ro' | 'ru' | 'sk' | 'sv' | 'ta' | 'tr' | 'uk' | 'vi' | 'zh' | 'zh-hans' | 'zh-hant'
    - `has_external_voice` boolean — Whether an external voice provider voice exists
    - `attributes` string[] — Custom voice attributes/tags
    - `samples` UploadBlobResponseData[], required — Pre-signed links to upload voice samples
      - `item_id` string, required — Identifier of the item from upload request.
      - `blob_id` string, required — Blob ID
      - `url` string, uri, required — Upload URL
      - `form_data` object, required — Form data for uploading the file

## Other responses

- `default` — Default Response

---

[API](https://skmtc.dev/palabra/apis/palabra-api.md) · [All operations](https://skmtc.dev/palabra/apis/palabra-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/palabra/palabra-api/revisions/cb8721654525/schema)
