> ## 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 cloning

> The Voice cloning endpoint enables you to generate audio by providing a text input along with a valid audio URL or a pre-created voice using a voice_id.

<Warning>
  Make sure you add your [s3 details](/enterprise-api/general/update-s3-details) for `voice_cloning` server, so you can receive image generated in your bucket. Images generated without s3 details being added will be delete after **24 hours**
</Warning>

<Info>
  [voice\_id](https://modelslab.com/voice-lists) can be found here.
</Info>

## 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/v1/enterprise/voice/text_to_audio' \
```

<Note>
  You can either pass `init_audio` or `voice_id`. However, if both are passed at the same time the `init_audio` takes preference.
</Note>

## Body

```json json theme={null}
{    
  "key": "enteprise_api_key", 
  "prompt":"Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.", 
  "init_audio":"https://assets.modelslab.ai/generations/d5b64159-b9cc-4342-996e-ebde7e7e35c0.mp3", 
  "language":"english", 
  "webhook": null, 
  "track_id": null
}
```

## Body Attributes

<ParamField query="key" type="string" required>
  Your API Key used for request authorization.
</ParamField>

<ParamField query="prompt" type="string" required>
  Text prompt with description of the audio you want to generate.
</ParamField>

<ParamField query="init_audio" type="string" format="url">
  A valid audio URL to be voice-cloned. Minimum length: 4 seconds, Maximum length: 30 seconds.
</ParamField>

<ParamField query="voice_id" type="string">
  Optional. ID of voice from available list <a href="https://modelslab.com/voice-lists" target="_blank">Find Voice IDs Here</a>.
</ParamField>

<ParamField query="language" type="string" enum="[&#x22;english&#x22;, &#x22;arabic&#x22;, &#x22;chinese&#x22;, &#x22;spanish&#x22;, &#x22;german&#x22;, &#x22;czech&#x22;, &#x22;dutch&#x22;, &#x22;french&#x22;, &#x22;hindi&#x22;, &#x22;hungarian&#x22;, &#x22;italian&#x22;, &#x22;japanese&#x22;, &#x22;korean&#x22;, &#x22;polish&#x22;, &#x22;russian&#x22;, &#x22;turkish&#x22;]" default="english">
  The language of the voice. Default: english.
</ParamField>

<ParamField query="emotion" type="string" enum="[&#x22;neutral&#x22;, &#x22;happy&#x22;, &#x22;sad&#x22;, &#x22;angry&#x22;, &#x22;dull&#x22;]" default="neutral">
  The emotional tone of the generated voice. Options: neutral, happy, sad, angry, dull. Default: neutral.
</ParamField>

<ParamField query="base64" type="boolean" default="false">
  Whether the input sound clip is in base64 format. Default: false.
</ParamField>

<ParamField query="temp" type="boolean" default="false">
  Whether you want temporary links (useful if your country blocks access to storage sites). Default: false.
</ParamField>

<ParamField query="webhook" type="string" format="url">
  Provide a URL to receive a POST API call once the audio generation is complete.
</ParamField>

<ParamField query="track_id" type="string">
  This ID is returned in the response to the webhook API call and will be used to identify the request.
</ParamField>
