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

# Voice Upload

> Upload an audio file and retrieve a `voice_id` for use with the [Voice-cloning](/voice-cloning/voice-cloning) endpoint.

## Request

Make a `POST` request to below endpoint and pass the required parameters as a request body.

```curl curl theme={null}
--request POST 'https://modelslab.com/api/v6/voice/voice_upload' \
```

## Body

```json json theme={null}
{       
    "key":"",    
    "name":"Jacob",    
    "init_audio":"https://assets.modelslab.ai/generations/5c3eef10-0eb4-4db8-8b12-fc4eedbf30b9.mp3",    
    "language":"english"
}
```


## OpenAPI

````yaml POST /voice/voice_upload
openapi: 3.1.0
info:
  title: ModelsLab Voice API
  description: >-
    A comprehensive API for AI-driven voice and audio generation including
    text-to-speech, voice cloning, music generation, and audio processing
    capabilities
  license:
    name: MIT
  version: 6.0.0
servers:
  - url: https://modelslab.com/api/v6
security: []
paths:
  /voice/voice_upload:
    post:
      summary: Upload voice for training
      description: Uploads an audio file to create a voice ID for use with text-to-audio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceUploadRequest'
      responses:
        '200':
          description: Voice upload response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceUploadResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    VoiceUploadRequest:
      type: object
      required:
        - key
        - name
        - init_audio
        - language
      properties:
        key:
          type: string
          description: API key to authorize the request
        name:
          type: string
          description: Display name assigned to the voice being uploaded
        init_audio:
          type: string
          format: uri
          description: >-
            URL of audio file to upload. MP3/WAV, 10-25 seconds for optimal
            results
        base64:
          type: boolean
          default: false
          description: Whether audio file is provided as base64 string
        language:
          type: string
          enum:
            - english
            - arabic
            - spanish
            - german
            - czech
            - brazilian portuguese
            - chinese
            - dutch
            - french
            - hindi
            - hungarian
            - italian
            - japanese
            - korean
            - polish
            - russian
            - turkish
          description: Language of the voice
        gender:
          type: string
          enum:
            - male
            - female
          description: Gender of the audio
        thumbnail:
          type: string
          format: uri
          description: Thumbnail image URL for the audio
    VoiceUploadResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
          description: Status of the voice upload
        message:
          type: string
          description: Response message
        voice_id:
          type: string
          description: Generated voice ID for the uploaded voice
    Error:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Error message description

````