# Speech to Text > Speech-to-Text transforms audio into written transcription, allowing spoken language to be converted into text for various applications. ## Overview - **Model ID**: `speech-to-text` - **Category**: audio - **Provider**: modelslab - **Status**: active - **Screenshot**: `https://assets.modelslab.com/generations/f2534f26-caa0-4c9c-ac06-70666a0ff414.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/speech_to_text` - **Method**: POST ### Parameters - **`init_audio`** (required): The URL of the audio file to be transcribed. Supported formats: WAV, MP3,FLAC, OPUS. min: 5 seconds - max: 1 hour. - Type: file ("audio/mp3,audio/wav") - Example: Enter Audio URL - **`language`** (optional): The language code of the audio content in ISO 639-1 format (e.g. 'en' for English, 'es' for Spanish). - Type: select (options: English) - Example: Language ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v6/voice/speech_to_text \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "speech-to-text", "init_audio": "https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav", "language": "en" }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v6/voice/speech_to_text", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "speech-to-text", "init_audio": "https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav", "language": "en" } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v6/voice/speech_to_text", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "speech-to-text", "init_audio": "https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav", "language": "en" }) }) .then(response => response.json()) .then(data => console.log(data)); ``` ## Links - [Model Playground](https://modelslab.com/models/speech-to-text/speech-to-text) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)