curl --request POST \
--url https://modelslab.com/api/v6/voice/text_to_audio \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"prompt": "<string>",
"init_audio": "<string>",
"voice_id": "<string>",
"language": "english",
"speed": 1,
"base64": false,
"temp": false,
"webhook": "<string>",
"track_id": 123
}
'{
"generationTime": 123,
"id": 123,
"output": [
"<string>"
],
"proxy_links": [
"<string>"
],
"future_links": [
"<string>"
],
"links": [
"<string>"
],
"meta": {},
"eta": 123,
"message": "<string>",
"tip": "<string>",
"fetch_result": "<string>",
"audio_time": 123
}Voice Cloning
Generate audio from text by cloning a provided audio URL or a selected voice ID.
curl --request POST \
--url https://modelslab.com/api/v6/voice/text_to_audio \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"prompt": "<string>",
"init_audio": "<string>",
"voice_id": "<string>",
"language": "english",
"speed": 1,
"base64": false,
"temp": false,
"webhook": "<string>",
"track_id": 123
}
'{
"generationTime": 123,
"id": 123,
"output": [
"<string>"
],
"proxy_links": [
"<string>"
],
"future_links": [
"<string>"
],
"links": [
"<string>"
],
"meta": {},
"eta": 123,
"message": "<string>",
"tip": "<string>",
"fetch_result": "<string>",
"audio_time": 123
}Request
Make aPOST request to below endpoint and pass the required parameters as a request body.
init_audio is required for voice cloning. You can also pass voice_id to select a voice from the available voice list.--request POST 'https://modelslab.com/api/v6/voice/text_to_audio' \
Body
{
"key": "your_api_key",
"prompt":"Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.",
"init_audio":"https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav",
"voice_id": "your_voice_id",
"language":"english",
"webhook": null,
"track_id": null
}
Body
API key for authentication
Text prompt describing audio to be generated
Valid URL pointing to audio file for voice cloning (4-30 seconds)
ID of voice from available list Find Voice IDs Here
Language for the voice
arabic, assamese, bengali, brazilian portuguese, chinese, czech, danish, dutch, english, finnish, french, german, greek, gujarati, hebrew, hindi, hungarian, indonesian, italian, japanese, kannada, korean, maithili, malay, malayalam, marathi, min nan chinese, nepali, odia, persian, polish, punjabi, russian, sindhi, sinhala, slovak, spanish, swahili, swedish, tamil, telugu, thai, turkish, ukrainian, urdu, vietnamese, welsh, yue chinese Playback speed of generated audio
Whether input audio is in base64 format
Use temporary links valid for 24 hours
URL to receive POST notification upon completion
ID for webhook identification
Response
Text to audio response
Status of the voice generation
success, processing, error Time taken to generate the audio in seconds
Unique identifier for the voice generation
Array of generated audio URLs
Array of proxy audio URLs
Array of future audio URLs for queued requests
Array of audio URLs (voice cover response)
Metadata about the audio generation including all parameters used
Estimated time for completion in seconds (processing status)
Status message or additional information
Additional information or tips for the user
URL to fetch the result when processing
Duration of the generated audio in seconds
Was this page helpful?

