# Voice cloning > The Text-to-Audio endpoint generates audio from text using either a provided audio URL or a voice_id, producing output that mimics the selected voice ## Overview - **Model ID**: `voice-cloning` - **Category**: audio - **Provider**: modelslab - **Status**: active - **Screenshot**: `https://assets.modelslab.com/generations/20bcaebb-b6e3-4944-80ab-a1c54505399b.webp` ## API Information This model can be used via our HTTP API. See the API documentation and usage examples below. ### Endpoint - **URL**: `https://modelslab.com/api/v6/voice/text_to_audio` - **Method**: POST ### Parameters - **`init_audio`** (required): init_audio - Type: file ("audio/mp3,audio/wav,audio/mp4") - Example: Enter Audio URL - **`prompt`** (required): Prompt - Type: textarea - **`language`** (required): language - Type: select (options: german, brazilian, portuguese, chinese, turkish, italian, russian, turkish, hindi, french, korean, english) - Example: language - **`stream`** (optional): Stream response in base64 format - Type: toggle ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v6/voice/text_to_audio \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "voice-cloning", "init_audio": "https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav", "prompt": "Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.", "language": "english", "stream": false }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v6/voice/text_to_audio", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "voice-cloning", "init_audio": "https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav", "prompt": "Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.", "language": "english", "stream": False } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v6/voice/text_to_audio", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "voice-cloning", "init_audio": "https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav", "prompt": "Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.", "language": "english", "stream": false }) }) .then(response => response.json()) .then(data => console.log(data)); ``` ## Links - [Model Playground](https://modelslab.com/models/voice-cloning/voice-cloning) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)