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

# Clone a voice from recordings

> Submit recordings of one speaker. The complete multipart body must fit within 4 MiB.

Creating a clone uses one [private voice slot](https://docs.gengen.farm/api-reference/elevenlabs/overview.md#choose-a-voice) and has no separate creation fee.

**Prepare the recordings.** Aim for about 1–2 minutes **in total across all samples**. Use one speaker with a consistent speaking style and recording level. Avoid background noise and room reverb.

**Upload limits.** Send 1–10 nonempty files by repeating the multipart `files` field. The entire multipart body, including form headers and boundaries, must fit within 4 MiB. Set `consent=true` to confirm you have the rights and consent to clone the speaker.

```bash theme={"dark"}
curl https://gengen.farm/v1/audio/voices/clone \
  -H "Authorization: Bearer $GENGEN_API_KEY" \
  -F 'name=Narrator' \
  -F 'consent=true' \
  -F 'files=@narrator.mp3;type=audio/mpeg'
```

| Result | Next step |
| - | - |
| `201`, `active` | Use the returned `voiceId` for speech or dialogue with any active key in this workspace. |
| `201`, `verificationRequired` | Send your `voiceId` to [GENGEN support](https://gengen.farm/support), then [check the voice status](https://docs.gengen.farm/api-reference/elevenlabs/get-voice.md). |
| `202` | [Poll the returned `statusUrl`](https://docs.gengen.farm/api-reference/elevenlabs/get-voice-operation) instead of uploading again. |

Without an `Idempotency-Key`, uploading twice can create two voices. For a [safe retry](https://docs.gengen.farm/api-reference/elevenlabs/overview.md#retrying-a-request), keep the same fields, file order, names, media types and contents.


## OpenAPI

````yaml openapi/audio.yaml POST /audio/voices/clone
openapi: 3.1.0
info:
  title: GENGEN Audio API
  version: 1.0.0
  description: >-
    Speech, dialogue, voice design, workspace voices, realtime sessions and
    completion webhooks.
servers:
  - url: https://gengen.farm/api/gengen/v1
security:
  - bearerAuth: []
paths:
  /audio/voices/clone:
    post:
      tags:
        - Voices
      summary: Create an Instant Voice Clone
      description: >-
        Submit recordings of one speaker. The complete multipart body must fit
        within 4 MiB.
      operationId: audio-clone-voice
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Scoped to the workspace and creation operation. Without this header
            each submission is independent and can occupy another slot. To retry
            safely, reuse the same key and input. Changing the input under the
            same key returns 409.
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[!-~]{1,128}$
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              additionalProperties: false
              required:
                - name
                - files
                - consent
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Name that identifies the voice.
                files:
                  type: array
                  minItems: 1
                  maxItems: 10
                  description: >-
                    Audio recordings of the speaker to clone. Repeat this field
                    for multiple files.
                  items:
                    type: string
                    format: binary
                consent:
                  type: string
                  enum:
                    - 'true'
                  description: >-
                    Confirm that you have the rights and consent to clone this
                    voice.
                description:
                  type: string
                  minLength: 1
                  maxLength: 1000
                  description: Description of the voice.
                remove_background_noise:
                  type: boolean
                  default: false
                  description: >-
                    Remove background noise from the recordings. Leave off for
                    clean samples; processing them can reduce clone quality.
      responses:
        '201':
          description: Saved voice or idempotent replay. Use for generation when active.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrivateVoice'
        '202':
          description: Creation is pending confirmation. Poll the returned statusUrl.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PrivateVoice'
                  - type: object
                    required:
                      - operationId
                      - statusUrl
        '422':
          description: >-
            Read error.message for the rejection reason. Replaying the same
            keyed request returns that rejection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            For audio.voice_limit, free a private slot. For
            audio.provider_rate_limited, wait and retry with the original input
            and key if supplied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: >-
            Invalid request or authorization, changed idempotency input (409),
            expired candidate or removed voice (410), payload too large (413),
            provider rejection (422), full workspace (429), or service
            unavailable (503).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PrivateVoice:
      type: object
      required:
        - name
        - kind
        - status
        - models
      properties:
        operationId:
          type: string
          format: uuid
          description: Creation tracking ID returned while pending.
        statusUrl:
          type: string
          description: >-
            Relative URL for polling a pending creation with the workspace API
            key.
        id:
          type: string
          description: Same as voiceId once the voice has an ID.
        voiceId:
          type: string
          description: Same value as id. Use for speech and dialogue when active.
        name:
          type: string
        kind:
          type: string
          enum:
            - clone
            - design
        status:
          type: string
          enum:
            - creating
            - reconciling
            - active
            - verificationRequired
            - failed
            - deleting
            - deleted
        message:
          type: string
          description: >-
            Optional provider explanation on a failed or reconciling private
            voice. Use status to determine the outcome.
        models:
          type: array
          items:
            type: string
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.