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

# Create Voice

> Create a new custom voice clone using either ElevenLabs or Cartesia provider.

**Supported Providers:**
- `elevenlabs`: ElevenLabs Instant Voice Cloning (IVC)
- `cartesia`: Cartesia Voice Cloning

## Supported Languages

The `language` parameter accepts the following language codes (supported by both providers):

| Code | Language | Code | Language | Code | Language |
|------|----------|------|----------|------|----------|
| `en` | English | `zh` | Chinese | `ja` | Japanese |
| `ko` | Korean | `fr` | French | `de` | German |
| `es` | Spanish | `pt` | Portuguese | `hi` | Hindi |
| `it` | Italian | `nl` | Dutch | `pl` | Polish |
| `ru` | Russian | `sv` | Swedish | `tr` | Turkish |
| `tl` | Tagalog | `bg` | Bulgarian | `ro` | Romanian |
| `ar` | Arabic | `cs` | Czech | `el` | Greek |
| `fi` | Finnish | `hr` | Croatian | `ms` | Malay |
| `sk` | Slovak | `da` | Danish | `ta` | Tamil |
| `uk` | Ukrainian | `hu` | Hungarian | `no` | Norwegian |
| `vi` | Vietnamese | `bn` | Bengali | `th` | Thai |
| `he` | Hebrew | `ka` | Georgian | `id` | Indonesian |
| `te` | Telugu | `gu` | Gujarati | `kn` | Kannada |
| `ml` | Malayalam | `mr` | Marathi | `pa` | Punjabi |

**Note**: If `language` is not specified, the system will auto-detect the language from the audio file.

## Audio Requirements

**Minimum Duration:**
- **30 seconds minimum** (recommended: 60-120 seconds for best quality)
- Shorter audio will result in error response

**Supported Formats:**
- MP3 (audio/mpeg)
- WAV (audio/wav)

**Quality Guidelines:**
- Sample rate: 44.1 kHz recommended
- Bit depth: 16-bit
- Content: Clear speech, single speaker
- Background: Minimal or no background noise
- Background noise removal is automatically enabled (ElevenLabs)

## Next Steps

After creating a voice:
1. Use the returned `voice` ID when creating avatars
2. The voice may take a few moments to generate preview
3. Voice is immediately available for text-to-speech synthesis



## OpenAPI

````yaml POST /api/open/v1/voice/{provider}/add
openapi: 3.1.0
info:
  title: NavTalk API
  description: NavTalk API for AI avatar management, file uploads, and video generation
  version: 1.0.0
servers:
  - url: https://api.navtalk.ai
    description: NavTalk Production Environment Server
  - url: https://qaapi.navtalk.ai
    description: NavTalk QA Environment Server
  - url: https://devapi.navtalk.ai
    description: NavTalk Development Environment Server
security:
  - navtalkLicenseAuth: []
paths:
  /api/open/v1/voice/{provider}/add:
    post:
      tags:
        - Voice
      summary: Create Voice
      description: >-
        Create a new custom voice clone using either ElevenLabs or Cartesia
        provider.


        **Supported Providers:**

        - `elevenlabs`: ElevenLabs Instant Voice Cloning (IVC)

        - `cartesia`: Cartesia Voice Cloning


        ## Supported Languages


        The `language` parameter accepts the following language codes (supported
        by both providers):


        | Code | Language | Code | Language | Code | Language |

        |------|----------|------|----------|------|----------|

        | `en` | English | `zh` | Chinese | `ja` | Japanese |

        | `ko` | Korean | `fr` | French | `de` | German |

        | `es` | Spanish | `pt` | Portuguese | `hi` | Hindi |

        | `it` | Italian | `nl` | Dutch | `pl` | Polish |

        | `ru` | Russian | `sv` | Swedish | `tr` | Turkish |

        | `tl` | Tagalog | `bg` | Bulgarian | `ro` | Romanian |

        | `ar` | Arabic | `cs` | Czech | `el` | Greek |

        | `fi` | Finnish | `hr` | Croatian | `ms` | Malay |

        | `sk` | Slovak | `da` | Danish | `ta` | Tamil |

        | `uk` | Ukrainian | `hu` | Hungarian | `no` | Norwegian |

        | `vi` | Vietnamese | `bn` | Bengali | `th` | Thai |

        | `he` | Hebrew | `ka` | Georgian | `id` | Indonesian |

        | `te` | Telugu | `gu` | Gujarati | `kn` | Kannada |

        | `ml` | Malayalam | `mr` | Marathi | `pa` | Punjabi |


        **Note**: If `language` is not specified, the system will auto-detect
        the language from the audio file.


        ## Audio Requirements


        **Minimum Duration:**

        - **30 seconds minimum** (recommended: 60-120 seconds for best quality)

        - Shorter audio will result in error response


        **Supported Formats:**

        - MP3 (audio/mpeg)

        - WAV (audio/wav)


        **Quality Guidelines:**

        - Sample rate: 44.1 kHz recommended

        - Bit depth: 16-bit

        - Content: Clear speech, single speaker

        - Background: Minimal or no background noise

        - Background noise removal is automatically enabled (ElevenLabs)


        ## Next Steps


        After creating a voice:

        1. Use the returned `voice` ID when creating avatars

        2. The voice may take a few moments to generate preview

        3. Voice is immediately available for text-to-speech synthesis
      operationId: createVoice
      parameters:
        - name: provider
          in: path
          description: The voice provider type
          required: true
          schema:
            type: string
            enum:
              - elevenlabs
              - cartesia
            example: elevenlabs
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateVoiceRequest'
            encoding:
              file:
                contentType: audio/mpeg, audio/wav
      responses:
        '200':
          description: Voice created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVoiceResponse'
              examples:
                elevenlabs:
                  summary: ElevenLabs voice created
                  value:
                    code: 200
                    message: SUCCESS
                    data:
                      voice: J8K3LmN9PqR5StU7VwX1
                      name: My Custom Voice
                      description: Custom voice created via API
                cartesia:
                  summary: Cartesia voice created
                  value:
                    code: 200
                    message: SUCCESS
                    data:
                      voice: a0e99841-438c-4a64-b679-ae501e7d6091
                      name: My Cartesia Voice
                      description: Custom Cartesia voice
        '400':
          description: Validation failed or creation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NavtalkErrorResponse'
              examples:
                providerNotFound:
                  summary: Provider not found
                  value:
                    code: 400
                    message: Provider not found
                invalidProviderType:
                  summary: Invalid provider type
                  value:
                    code: 400
                    message: >-
                      Only ElevenLabs and Cartesia providers are supported for
                      creating voices
                noPermission:
                  summary: No permission to operate provider
                  value:
                    code: 400
                    message: You have no permission to operate this provider
                noFile:
                  summary: Audio file required
                  value:
                    code: 400
                    message: Audio file is required
                durationTooShort:
                  summary: Audio duration too short
                  value:
                    code: 400
                    message: >-
                      Audio duration is too short: 15 seconds. Minimum required:
                      30 seconds (Recommended: 60-120 seconds)
                cannotParseAudio:
                  summary: Cannot parse audio file
                  value:
                    code: 400
                    message: 无法解析音频时长：不支持的或损坏的音频文件
                creationFailed:
                  summary: Voice creation failed
                  value:
                    code: 400
                    message: 'Failed to create voice: API error details'
      security:
        - navtalkLicenseAuth: []
components:
  schemas:
    CreateVoiceRequest:
      required:
        - providerId
        - voiceName
        - file
      type: object
      properties:
        providerId:
          type: string
          description: The provider ID (ElevenLabs or Cartesia)
          example: b92a28fb2ea737457c7f13ba554759c0
        voiceName:
          type: string
          description: Name for the new voice
          example: My Custom Voice
        language:
          type: string
          description: >-
            Optional language code for the voice. Supported by both ElevenLabs
            and Cartesia. See supported languages list in documentation.
          enum:
            - en
            - zh
            - ja
            - ko
            - fr
            - de
            - es
            - pt
            - hi
            - it
            - nl
            - pl
            - ru
            - sv
            - tr
            - tl
            - bg
            - ro
            - ar
            - cs
            - el
            - fi
            - hr
            - ms
            - sk
            - da
            - ta
            - uk
            - hu
            - 'no'
            - vi
            - bn
            - th
            - he
            - ka
            - id
            - te
            - gu
            - kn
            - ml
            - mr
            - pa
          example: zh
        description:
          type: string
          description: >-
            Optional description for the voice. Supported by both ElevenLabs and
            Cartesia.
          example: Custom cloned voice for my application
        file:
          type: string
          format: binary
          description: Audio file (MP3 or WAV, minimum 30 seconds)
    CreateVoiceResponse:
      type: object
      properties:
        code:
          type: integer
          example: 200
        message:
          type: string
          example: SUCCESS
        data:
          type: object
          properties:
            voice:
              type: string
              description: The created voice ID (use as voice parameter)
              example: J8K3LmN9PqR5StU7VwX1
            name:
              type: string
              description: The voice name
              example: My Custom Voice
            description:
              type: string
              description: Voice description
              example: Custom voice created via API
    NavtalkErrorResponse:
      type: object
      properties:
        code:
          type: integer
          example: 400
        message:
          type: string
          example: Invalid license key
  securitySchemes:
    navtalkLicenseAuth:
      type: apiKey
      in: header
      name: license
      description: NavTalk API license key (e.g. sk_navtalk_...)

````