# Clone a voice

`POST https://www.getrevox.com/api/voices/clone`

Clone a voice from an audio recording. Send audio as a base64-encoded string. The cloned voice will be available in GET /voices.

## Request body (JSON)

- `audio` (string, required): Base64-encoded audio data (max ~7.5MB decoded) Constraints: max length 10000000.
- `contentType` (enum (string), required): MIME type of the audio One of: `audio/webm`, `audio/wav`, `audio/mpeg`, `audio/ogg`, `audio/mp4`, `video/webm`.
- `name` (string, required): Name for the cloned voice Constraints: min length 1.
- `language` (enum (string), required): Language of the voice One of: `en`, `fr`, `es`, `de`, `it`, `pt`, `ru`, `zh`.

## Example request

```bash
curl -X POST https://www.getrevox.com/api/voices/clone \
  -H "Authorization: Bearer $REVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": "string",
    "contentType": "audio/webm",
    "name": "Appointment reminder",
    "language": "en"
  }'
```

## Responses

### 201: Created

- `id` (string, required)
- `cartesiaVoiceId` (string, required)
- `name` (string, required)
- `language` (string, required)
- `createdAt` (string, required)

### 400: Invalid request: the body or a parameter failed validation

- `message` (string, optional)
- `error` (string, optional)
- `bodyErrors` (object, optional): The validation errors returned from the API.
  - `issues` (array of object, required)
    - `path` (array of one of, required)
      - One of, **string** (string)
      - One of, **number** (number)
    - `message` (string, required)
    - `code` (string, optional)

### 401: Missing or invalid API key

- `message` (string, optional)
- `error` (string, optional)
- `bodyErrors` (object, optional): The validation errors returned from the API.
  - `issues` (array of object, required)
    - `path` (array of one of, required)
      - One of, **string** (string)
      - One of, **number** (number)
    - `message` (string, required)
    - `code` (string, optional)

### 502: HTTP 502

- `message` (string, optional)
- `error` (string, optional)
- `bodyErrors` (object, optional): The validation errors returned from the API.
  - `issues` (array of object, required)
    - `path` (array of one of, required)
      - One of, **string** (string)
      - One of, **number** (number)
    - `message` (string, required)
    - `code` (string, optional)