Skip to content

Create a cloned voice

Clone a voice of your own from a recording: MiniMax Speech 2.8 voice cloning, or Doubao Voice Cloning 2.0 (`seed-icl-2.0`).

POST/v1/voice_clone

MiniMax and Doubao share this path; HopBase routes by the request body and the key's group. The two request bodies and responses differ, so pick a series below. If you use both, use a separate key for each.

MiniMax Speech 2.8: Pass the file_id from step 1 and a voice_id you choose; then put the voice_id in voice on /v1/audio/speech or voice_setting.voice_id on /v1/t2a_v2 to synthesize. Add text and model to get a preview clip: demo_audio is a download link on api.hop-base.com, valid for 24 hours; it is empty without text. Uploading and cloning are free. The clone fee is charged once, with the voice's first successful synthesis (the usage record details show an extra voice_clone_activation item); the preview is billed only as speech characters and does not count as first use. Prices are on the pricing page. a successful clone automatically deletes the source audio and the example audio, so upload again to clone again; a failed clone keeps the files so you can retry with other parameters. A voice not used for synthesis within 7 days of cloning is deleted automatically, and no clone fee is charged.

Doubao Voice Cloning 2.0: the body must include "model": "seed-icl-2.0"; send the recording as base64 in audio, and you get back a voice_id starting with hbv_. To synthesize, set model to seed-icl-2.0 and voice to that ID on /v1/audio/speech. During the beta each account can keep at most 1 cloned voice; to switch voices, delete it first or retrain it by passing its voice_id. When cloned-voice capacity is full, the request returns 503 voice_capacity_full. Billing: the demo_text preview is billed at ¥3 per 10,000 characters, the same as synthesis; cloning itself is free, and there is currently no cloning fee; failed requests are not billed. See Doubao voice cloning.

Voices from both belong only to your account (on an enterprise account, shared by the member keys under the owner); other accounts cannot use them even if they know the voice_id.

Headers

Authorization:requiredstring

Bearer sk-…: an API key created in the console under API keys; its group must include the requested model

Body parametersJSON

Family
Model docs
First get a file_id with Upload voice clone audio, then pass a voice_id you choose. Uploading and cloning are free; the clone fee is charged once, with the voice's first successful synthesis.
file_id:requiredinteger

File ID returned by the step 1 upload with purpose=voice_clone; single-use

Range≥ 1

voice_id:requiredstring

A voice name you choose, unique within your account: letters, digits, - and _, starting with a letter and not ending with - or _

Length8–256 chars

clone_prompt:optionalobject

Example clip

text:optionalstring

Preview text; when set, a preview clip is returned, billed as speech characters (does not count as first use)

Length≤ 1000 chars

model:optionalstring

Required when text is set

Valuesspeech-2.8-hdspeech-2.8-turbo

language_boost:optionalstring

Same as the native endpoint

ValuesautoChineseChinese,YueEnglishArabicRussianSpanishFrenchPortugueseGermanTurkishDutchUkrainianVietnameseIndonesianJapaneseItalianKoreanThaiPolishRomanianGreekCzechFinnishHindiBulgarianDanishHebrewMalayPersianSlovakSwedishCroatianFilipinoHungarianNorwegianSlovenianCatalanNynorskTamilAfrikaans

text_validation:optionalstring

Expected transcript; checked against the source audio with speech recognition

Length≤ 200 chars

accuracy:optionalnumber

Pass threshold for text_validation; official default 0.7

Range0–1

need_noise_reduction:optionalboolean

Noise reduction

Defaultfalse

need_volume_normalization:optionalboolean

Volume normalization

Defaultfalse

aigc_watermark:optionalboolean

AIGC watermark

Defaultfalse

Returns

200Clone succeeded

Family
input_sensitive:optionalboolean

Whether the input triggered sensitive content

input_sensitive_type:optionalinteger

Sensitive content type

demo_audio:optionalstring

Preview audio download link, valid for 24 hours; empty string without text

extra_info:optionalobject

Returned only with a preview

base_resp:requiredobject

{"status_code": 0, "status_msg": "success"} on success; errors do not come here but as a non-200 status code with an error object

Errors

400MiniMax: file_id already used or expired, invalid or taken voice_id, audio duration out of range, text_validation check failed, text too long, text without model, unknown fields, etc. Doubao: voice_limit_reached (a cloned voice already exists), audio_text_mismatch (recording and text do not match), invalid_audio (recording rejected), no_trainings_left (no trainings left), unknown_voice (the voice_id to retrain does not exist); parameter errors such as a missing model, invalid audio or a demo_text of the wrong length carry no code
401Missing, invalid or expired API key (missing_api_key / invalid_api_key / api_key_expired)
402Balance, or key / member / department quota, exhausted (insufficient_quota)
404The model is not in this key's group (model_not_found), or the path does not belong to the group (route_not_found)
409Doubao: voice_clone_in_progress, another clone or delete request from the same account has not finished; send again after it finishes
413Body over the limit: 64 KiB for MiniMax (request body is too large), 16 MiB for Doubao
503Retry later: MiniMax voice cloning is temporarily unavailable, voice registry is temporarily unavailable; please retry; Doubao voice_capacity_full (cloned-voice capacity is temporarily full), voice_unavailable, voice_registry_unavailable

Related