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

# Create Cloned Voice

> Create cloned voice from uploaded sample.

This endpoint creates a cloned voice from an uploaded voice sample using the specified TTS provider. The cloning process varies by provider but typically completes within seconds to minutes.

### Path Parameters

* `assistant_id` (integer, **required**): The unique identifier of the assistant to associate the cloned voice with.

### Request Body

The request body is a JSON object containing cloning configuration.

* `voice_sample_id` (integer, **required**): ID of the uploaded voice sample to clone from
* `provider` (string, **required**): TTS provider to use for voice cloning
  * Common values: `elevenlabs`, `resemble`, `cartesia`. The providers endpoint returns the current supported set.
* `name` (string, **required**): Display name for the cloned voice
* `description` (string, optional): Description of the cloned voice
* `language` (string, optional): Language code (e.g., `en`, `es`, `fr`)
* `enhance_quality` (boolean, optional): Whether to apply quality enhancement. Default: `true`
* `tags` (array of strings, optional): Tags for organizing cloned voices
* `metadata` (object, optional): Additional provider-specific metadata

### Example Request

```json Request theme={null}
{
  "voice_sample_id": 123,
  "provider": "elevenlabs",
  "name": "Custom Professional Voice",
  "description": "Professional voice for customer service interactions",
  "language": "en",
  "enhance_quality": true,
  "tags": ["professional", "customer-service"],
  "metadata": {
    "use_case": "customer_support"
  }
}
```

### Response

A successful request returns the cloned voice object with initial status.

```json Response theme={null}
{
  "success": true,
  "cloned_voice": {
    "id": 456,
    "name": "Custom Professional Voice",
    "provider": "elevenlabs",
    "provider_voice_id": "voice_abc123xyz",
    "status": "processing",
    "created_at": "2024-01-15T10:45:00Z"
  }
}
```

### Response Fields

* `id` (integer): Unique identifier for the cloned voice
* `name` (string): Display name of the cloned voice
* `provider` (string): TTS provider used for cloning
* `provider_voice_id` (string): Provider-specific voice identifier
* `status` (string): Current cloning status
* `created_at` (string): ISO 8601 timestamp of creation

### Cloning Status

* `processing`: Voice cloning is in progress
* `ready`: Voice is successfully cloned and ready for use
* `failed`: Voice cloning failed, check error details

### Provider-Specific Behavior

#### ElevenLabs

* **Processing Time**: Usually 5-30 seconds
* **Instant Preview**: Voice ready for immediate testing
* **Voice ID**: Returns ElevenLabs voice ID for direct API usage
* **Quality**: High-quality instant cloning from short samples

#### Resemble AI

* **Processing Time**: 2-10 minutes for training
* **Professional Quality**: Advanced training algorithms
* **Voice UUID**: Returns Resemble voice UUID
* **Customization**: Supports advanced voice customization options

### Example Requests

```bash ElevenLabs Voice Cloning theme={null}
curl -X POST "https://api.burki.dev/api/v1/assistants/123/cloned-voices/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "voice_sample_id": 123,
    "provider": "elevenlabs",
    "name": "ElevenLabs Professional Voice",
    "language": "en",
    "enhance_quality": true
  }'
```

```bash Resemble AI Voice Cloning theme={null}
curl -X POST "https://api.burki.dev/api/v1/assistants/123/cloned-voices/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "voice_sample_id": 123,
    "provider": "resemble",
    "name": "Resemble Custom Voice",
    "description": "High-quality professional voice",
    "enhance_quality": true,
    "tags": ["professional", "brand"]
  }'
```

### Error Responses

**400 Bad Request** - Invalid parameters:

```json theme={null}
{
  "detail": "Provider 'invalid_provider' is not supported"
}
```

**404 Not Found** - Voice sample not found:

```json theme={null}
{
  "detail": "Voice sample with ID 123 not found"
}
```

**500 Internal Server Error** - Provider cloning failed:

```json theme={null}
{
  "detail": "Voice cloning failed: Insufficient account balance"
}
```

### Best Practices

1. **Provider Selection**: Choose ElevenLabs for quick prototyping, Resemble for production quality
2. **Naming Convention**: Use descriptive names that indicate voice characteristics
3. **Quality Settings**: Enable quality enhancement for better results
4. **Monitoring**: Check cloning status regularly for large-scale operations
5. **Error Handling**: Implement retry logic for transient provider failures


## OpenAPI

````yaml POST /api/v1/assistants/{assistant_id}/cloned-voices/create
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/assistants/{assistant_id}/cloned-voices/create:
    post:
      tags:
        - assistants
      summary: Create Cloned Voice
      description: Create cloned voice from uploaded sample.
      operationId: >-
        create_cloned_voice_api_v1_assistants__assistant_id__cloned_voices_create_post
      parameters:
        - name: assistant_id
          in: path
          required: true
          schema:
            type: integer
            title: Assistant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClonedVoiceRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateClonedVoiceRequest:
      properties:
        voice_sample_id:
          type: integer
          title: Voice Sample Id
          description: ID of the uploaded voice sample
        provider:
          type: string
          title: Provider
          description: TTS provider to use for voice cloning
        name:
          type: string
          title: Name
          description: Name for the cloned voice
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the cloned voice
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: Language code (e.g., 'en', 'es')
        enhance_quality:
          type: boolean
          title: Enhance Quality
          description: Whether to enhance voice quality
          default: true
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Tags for organizing voices
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Additional metadata
      type: object
      required:
        - voice_sample_id
        - provider
        - name
      title: CreateClonedVoiceRequest
      description: Schema for creating a cloned voice.
      example:
        description: A cloned voice for my assistant
        enhance_quality: true
        language: en
        metadata: {}
        name: My Custom Voice
        provider: elevenlabs
        tags:
          - custom
          - professional
        voice_sample_id: 1
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````