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

# Clone a voice

> Create a custom voice by cloning from an audio sample. Upload a single clean audio file (WAV, MP3, FLAC, OGG, AAC, M4A, or WebM), up to 20 MB. You must set `cloning_consent` to `true` to confirm you have the right to clone the voice in the sample.

The new voice is processed asynchronously; poll `GET /v1/voices` until it appears as ready before using it for synthesis.



## OpenAPI

````yaml POST /v1/voices
openapi: 3.1.0
info:
  title: Chariot AI API
  version: '1'
  description: >-
    Chariot AI is a text-to-speech (TTS) platform built for Indian and English
    voices. Convert text into natural-sounding speech over a simple REST call,
    an HTTP audio stream, or a low-latency WebSocket. This reference documents
    the public, API-key-authenticated endpoints. Speech-to-text (ASR) is coming
    soon.
  contact:
    name: Chariot AI Support
    email: support@chariot.in
    url: https://chariot.in
servers:
  - url: https://api.chariot.in
    description: Production
  - url: https://dev-api.chariot.in
    description: Development / sandbox
security:
  - APIKeyHeader: []
tags:
  - name: Text to Speech
    description: Convert text into speech synchronously or as a stream.
  - name: Voices
    description: List the voice catalog and manage your cloned (custom) voices.
  - name: Account
    description: Inspect your credit balance and usage.
paths:
  /v1/voices:
    post:
      tags:
        - Voices
      summary: Clone a voice
      description: >-
        Create a custom voice by cloning from an audio sample. Upload a single
        clean audio file (WAV, MP3, FLAC, OGG, AAC, M4A, or WebM), up to 20 MB.
        You must set `cloning_consent` to `true` to confirm you have the right
        to clone the voice in the sample.


        The new voice is processed asynchronously; poll `GET /v1/voices` until
        it appears as ready before using it for synthesis.
      operationId: createVoice
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateVoiceForm'
            encoding:
              use_cases:
                style: form
                explode: true
      responses:
        '200':
          description: The created voice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ConsentRequired'
        '413':
          $ref: '#/components/responses/FileTooLarge'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    CreateVoiceForm:
      type: object
      required:
        - voice_name
        - file
        - cloning_consent
      properties:
        voice_name:
          type: string
          description: Display name for the new voice.
        voice_description:
          type: string
        file:
          type: string
          format: binary
          description: >-
            The reference audio sample. WAV, MP3, FLAC, OGG, AAC, M4A, or WebM,
            up to 20 MB.
        cloning_consent:
          type: boolean
          description: >-
            Must be `true`. Confirms you have the right to clone the voice in
            the sample.
          default: false
        language:
          $ref: '#/components/schemas/Language'
        accent:
          $ref: '#/components/schemas/Accent'
        gender:
          $ref: '#/components/schemas/Gender'
        age:
          $ref: '#/components/schemas/AgeCategory'
        use_cases:
          type: array
          items:
            $ref: '#/components/schemas/UseCase'
    Voice:
      type: object
      properties:
        voice_id:
          type: string
          format: uuid
        voice_name:
          type: string
          example: Matt
        voice_description:
          type: string
        voice_sample:
          type:
            - string
            - 'null'
          format: uri
          description: URL to a short preview clip of the voice, when available.
        sprite_url:
          type:
            - string
            - 'null'
          format: uri
        color:
          type:
            - string
            - 'null'
        language:
          oneOf:
            - $ref: '#/components/schemas/Language'
            - type: 'null'
        accent:
          oneOf:
            - $ref: '#/components/schemas/Accent'
            - type: 'null'
        gender:
          oneOf:
            - $ref: '#/components/schemas/Gender'
            - type: 'null'
        age:
          oneOf:
            - $ref: '#/components/schemas/AgeCategory'
            - type: 'null'
        use_cases:
          type: array
          items:
            $ref: '#/components/schemas/UseCase'
    Language:
      type: string
      enum:
        - en
        - hi
    Accent:
      type: string
      enum:
        - american
        - british
        - indian
    Gender:
      type: string
      enum:
        - male
        - female
        - neutral
    AgeCategory:
      type: string
      enum:
        - young
        - middle_aged
        - old
    UseCase:
      type: string
      enum:
        - conversational
        - commercial
        - narration
        - customer_support
        - wellness
    Error:
      type: object
      description: Standard error envelope returned by all endpoints.
      properties:
        statusCode:
          type: integer
          description: HTTP status code, echoed in the body.
        error:
          type: string
          description: Machine-readable error class name.
        message:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - statusCode
        - error
        - message
  responses:
    Unauthorized:
      description: >-
        Authentication failed — the API key is missing, invalid, expired, or the
        request origin is not allowed for this key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: No credentials provided
              value:
                statusCode: 401
                error: UnauthorizedException
                message: No API key or user credentials provided
            invalid:
              summary: Invalid or unknown API key
              value:
                statusCode: 401
                error: UnauthorizedException
                message: Invalid API Key or user credentials
    ConsentRequired:
      description: Voice cloning requires you to accept the voice-cloning terms.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            error: ForbiddenException
            message: >-
              Voice cloning requires consent to the voice-cloning terms.
              Resubmit with cloning_consent=true (the cloning checkbox).
    FileTooLarge:
      description: The uploaded audio file exceeds the 20 MB limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 413
            error: ContentTooLargeException
            message: File too large, limit is 20 MB
    ValidationError:
      description: >-
        The request failed validation. This includes malformed JSON, missing or
        wrongly typed fields, out-of-range values, and business-rule violations
        such as text length limits or a voice that is not ready for synthesis.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            text_too_long:
              summary: Text over the 500-character limit
              value:
                statusCode: 422
                error: ValidationException
                message: >-
                  Input text of length 812 is more than maximum character count
                  of 500 characters!
            voice_not_ready:
              summary: Voice still processing
              value:
                statusCode: 422
                error: ValidationException
                message: >-
                  Voice 3acc7441-4dce-4245-a365-0bae822c8c30 is not ready for
                  TTS yet!
    ServerError:
      description: >-
        An unexpected error occurred while processing the request. Any credits
        charged for a failed generation are refunded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 500
            error: ProcessException
            message: TTS prediction error! for input of length 128
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: chariotai-api-key
      description: >-
        Your Chariot AI API key, generated from the dashboard. Send it in the
        `chariotai-api-key` header on every request.

````