CosyVoice Clone
curl --request POST \
--url https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'cosyvoice-v3.5-plus',
url: 'https://example.com/reference.wav',
text: 'There is a large garden behind my house.'
})
};
fetch('https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone"
payload = {
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone"
payload := strings.NewReader("{\n \"model\": \"cosyvoice-v3.5-plus\",\n \"url\": \"https://example.com/reference.wav\",\n \"text\": \"There is a large garden behind my house.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"cosyvoice-v3.5-plus\",\n \"url\": \"https://example.com/reference.wav\",\n \"text\": \"There is a large garden behind my house.\"\n}")
.asString();const url = 'https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'cosyvoice-v3.5-plus',
url: 'https://example.com/reference.wav',
text: 'There is a large garden behind my house.'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'cosyvoice-v3.5-plus',
'url' => 'https://example.com/reference.wav',
'text' => 'There is a large garden behind my house.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"cosyvoice-v3.5-plus\",\n \"url\": \"https://example.com/reference.wav\",\n \"text\": \"There is a large garden behind my house.\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
}'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-cosyvoice-clone-001",
"model_id": "alibaba/cosyvoice-clone",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-cosyvoice-clone-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: model is required"
}{
"code": 400,
"message": "Invalid parameters: model is required"
}{
"code": 400,
"message": "Invalid parameters: model is required"
}{
"code": 400,
"message": "Invalid parameters: model is required"
}CosyVoice Clone
Alibaba’s voice-clone model for speaking new text in the voice of a short reference clip. It covers Chinese, English, Japanese, Korean, and several other languages.
POST
/
alibaba
/
cosyvoice-clone
CosyVoice Clone
curl --request POST \
--url https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'cosyvoice-v3.5-plus',
url: 'https://example.com/reference.wav',
text: 'There is a large garden behind my house.'
})
};
fetch('https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone"
payload = {
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone"
payload := strings.NewReader("{\n \"model\": \"cosyvoice-v3.5-plus\",\n \"url\": \"https://example.com/reference.wav\",\n \"text\": \"There is a large garden behind my house.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"cosyvoice-v3.5-plus\",\n \"url\": \"https://example.com/reference.wav\",\n \"text\": \"There is a large garden behind my house.\"\n}")
.asString();const url = 'https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'cosyvoice-v3.5-plus',
url: 'https://example.com/reference.wav',
text: 'There is a large garden behind my house.'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'cosyvoice-v3.5-plus',
'url' => 'https://example.com/reference.wav',
'text' => 'There is a large garden behind my house.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"cosyvoice-v3.5-plus\",\n \"url\": \"https://example.com/reference.wav\",\n \"text\": \"There is a large garden behind my house.\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.modellix.ai/api/v1/alibaba/cosyvoice-clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"model": "cosyvoice-v3.5-plus",
"url": "https://example.com/reference.wav",
"text": "There is a large garden behind my house."
}'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-cosyvoice-clone-001",
"model_id": "alibaba/cosyvoice-clone",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-cosyvoice-clone-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: model is required"
}{
"code": 400,
"message": "Invalid parameters: model is required"
}{
"code": 400,
"message": "Invalid parameters: model is required"
}{
"code": 400,
"message": "Invalid parameters: model is required"
}Body
application/json
One-shot voice clone + TTS request. Required: model, url, text. The cloned voice is temporary and is not returned.
Text to synthesize with the temporarily cloned voice. Required. Max 20,000 Unicode characters. Supports plain text and SSML (set enable_ssml to true).
Required string length:
1 - 20000Example:
"There is a large garden behind my house."
Response
Task submitted successfully. Poll GET /api/v1/tasks/{task_id} until the task completes; synthesized audio is returned on the task result.
Response object for asynchronous task submission.