# Text to Speech > The Text-to-Audio 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. The output is an audio file that mimics the sound of the provided audio URL or the selected voice. ## Overview - **Model ID**: `text-to-speech` - **Category**: audio - **Provider**: modelslab - **Status**: active - **Screenshot**: `https://assets.modelslab.com/generations/cb6874c9-1839-4696-84c1-6abe5651f690.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_speech` - **Method**: POST ### Parameters - **`prompt`** (required): Prompt - Type: textarea - **`voice_id`** (required): - Type: select (options: henry, nova, madison, adam, michael, bella, kimberly, jessica, nicole, daniel, eric, sarah, levi, savannah, savannah, William, Sophia, santa, sierra, sierra, Olivia, Tiago, Mariana, Elodie, Alejo, Dorita, Mia, Tess, Giulia, Riya, Vishal, Hikari, Yui, Meiling, anaya) - **`language`** (optional): Language - Type: select (options: american english, Brazilian Portuguese, French, Spanish, English, Italian, British, Hindi, Japanese, Mandarin Chinese) - Example: Language - **`speed`** (optional): - Type: number (range: 0.5-2) ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v6/voice/text_to_speech \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "text-to-speech", "prompt": "Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.", "voice_id": "adam", "language": "american english", "speed": "0.8" }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v6/voice/text_to_speech", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "text-to-speech", "prompt": "Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.", "voice_id": "adam", "language": "american english", "speed": "0.8" } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v6/voice/text_to_speech", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "text-to-speech", "prompt": "Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.", "voice_id": "adam", "language": "american english", "speed": "0.8" }) }) .then(response => response.json()) .then(data => console.log(data)); ``` ## Links - [Model Playground](https://modelslab.com/models/text-to-speech/text-to-speech) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)