Upload voice sample for cloning
May 15, 2025
Table of contents
This endpoint uploads an audio sample for voice cloning, which can then be used in the POST music/song endpoint to generate vocals with your cloned voice.
POST raw content using Make.com and similar nocode tools.
https://api.useapi.net/v1/tempolor/music/cloned-voices/?…
Request Headers
Authorization: Bearer {API token}
Content-Type: {audio content-type}
API token
is required, see Setup useapi.net for details.Content-Type
is required, select from the table below:
Content-Type | File Extension |
---|---|
audio/mp4 | m4a |
audio/x-m4a | m4a |
audio/mpeg | mp3 |
audio/wav | wav |
audio/wave | wav |
audio/flac | flac |
audio/x-flac | flac |
Query Parameters
-
user_id
is optional when only one account configured. However, if you have multiple accounts configured, this parameter becomes required. -
name
is required. Specify a name for your cloned voice.
Responses
-
The cloned voice is immediately available to use in POST music/song by providing the returned
clonedVoiceItemId
.{ "result": true, "itemId": "abcdef123456789", "clonedVoiceItemId": "user:12345-tempolor:user_id-voice:abcdef123456789" }
-
The voice cloning process is still in progress. Check back later using GET music/cloned-voices to see if the voice is ready.
{ "itemId": "abcdef123456789", "clonedVoiceItemId": "user:12345-tempolor:user_id-voice:abcdef123456789", "message": "Voice cloning is still processing after 120 seconds. Please check back later." }
-
{ "error": "Empty file received", "code": 400 }
-
{ "error": "Unauthorized", "code": 401 }
Model
{ // TypeScript, all fields are optional
result: boolean
itemId: string
clonedVoiceItemId: string
message: string
error: string
code: number
}
Examples
-
curl "https://api.useapi.net/v1/tempolor/music/cloned-voices/?name=my-custom-voice&user_id=<user_id>" \ -H "Authorization: Bearer …" \ -H "Content-Type: audio/mpeg" \ --data-binary @/path/to/your/voice-sample.mp3
-
const token = "API token"; const user_id = "Previously configured account"; const name = "Your voice name"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/cloned-voices/?name=${name}&user_id=${user_id}`; let blob; /* // Example 1: Fetch audio from URL const audioUrl = "https://example.com/audio-samples/voice-sample.mp3"; const responseAudio = await fetch(audioUrl); blob = await responseAudio.blob(); */ /* // Example 2: Load audio from local file (Node.js) const fs = require('fs'); const audioFileName = "./voice-sample.mp3"; blob = new Blob([fs.readFileSync(audioFileName)]); */ /* // Example 3: Load from input file html element // <input id="audio-file" type="file"> const audioFile = document.getElementById(`audio-file`); if (audioFile.files[0]) blob = audioFile.files[0]; */ const response = await fetch(apiUrl, { method: "POST", headers: { "Authorization": `Bearer ${token}`, "Content-Type": "audio/mpeg" // Adjust based on your file type }, body: blob }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" user_id = "Previously configured account" name = "Your voice name" apiUrl = f"https://api.useapi.net/v1/tempolor/music/cloned-voices/?name={name}&user_id={user_id}" headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'audio/mpeg' # Adjust based on your file type } # # Example 1: Fetch audio from URL # audio_url = "https://example.com/audio-samples/voice-sample.mp3" # response_audio = requests.get(audio_url) # file_content = response_audio.content # # Example 2: Load audio from local file audio_file_path = "./voice-sample.mp3" with open(audio_file_path, 'rb') as audio_file: file_content = audio_file.read() response = requests.post(apiUrl, headers=headers, data=file_content) print(response, response.json())