Skip to main content
POST
CosyVoice One-shot Voice Clone + TTS

Authorizations

Authorization
string
header
required

Modellix API Key. Format: Bearer <your_api_key>

Body

application/json

One-shot voice clone + TTS request. Required: model, url, text. The cloned voice is temporary and is not returned.

model
enum<string>
required

Target CosyVoice v3.5 TTS model used for synthesis after cloning.

Available options:
cosyvoice-v3.5-plus,
cosyvoice-v3.5-flash
url
string
required

Publicly accessible reference audio URL for cloning.

Required string length: 1 - 2048
Example:

"https://example.com/reference.wav"

text
string
required

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 - 20000
Example:

"There is a large garden behind my house."

language_hint
enum<string>
default:zh

Language hint for both cloning and synthesis. Default zh.

Available options:
zh,
en,
fr,
de,
ja,
ko,
ru,
pt,
th,
id,
vi
Example:

"en"

max_prompt_audio_length
number
default:10

Max reference audio duration in seconds used for cloning (3.0–30.0). Default 10.0.

Required range: 3 <= x <= 30
Example:

10

enable_preprocess
boolean
default:false

Enable noise reduction and audio enhancement before cloning. Default false.

Example:

false

format
enum<string>
default:mp3

Output audio encoding format. Default mp3.

Available options:
mp3,
pcm,
wav,
opus
Example:

"mp3"

sample_rate
enum<integer>
default:22050

Output sample rate in Hz. Default 22050.

Available options:
8000,
16000,
22050,
24000,
44100,
48000
Example:

24000

volume
integer
default:50

Output volume. Default 50. Range 0–100.

Required range: 0 <= x <= 100
Example:

50

rate
number
default:1

Speech rate multiplier. Default 1.0. Range 0.5–2.0.

Required range: 0.5 <= x <= 2
Example:

1

pitch
number
default:1

Pitch multiplier. Default 1.0. Range 0.5–2.0.

Required range: 0.5 <= x <= 2
Example:

1

bit_rate
integer

Audio bit rate in kbps. Optional. Range 6–510. Only supported when format is opus; do not send for mp3, pcm, or wav.

Required range: 6 <= x <= 510
Example:

32

instruction
string

Optional speaking-style instruction. Weighted length ≤100 (CJK ideographs count as 2).

Example:

"Speak in a friendly customer-service tone."

seed
integer
default:0

Random seed. Default 0. Range 0–65535.

Required range: 0 <= x <= 65535
Example:

0

enable_ssml
boolean
default:false

Whether to parse text as SSML. Default false. When true, text must follow Alibaba CosyVoice SSML rules.

Example:

false

hot_fix
object

Text hot-fix before synthesis. Optional object with pronunciation (custom pinyin) and replace (text substitution) arrays, per Alibaba CosyVoice HTTP API.

Example:

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.

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required

Task submission details. Poll GET /api/v1/tasks/{task_id} until status is success; audio appears in result.resources.