$npx -y skills add cinience/alicloud-skills --skill aliyun-cosyvoice-voice-designUse when designing custom voices with Alibaba Cloud Model Studio CosyVoice customization models, especially cosyvoice-v3.5-plus or cosyvoice-v3.5-flash, from a voice prompt plus preview text before using the returned voice_id in TTS.
| 1 | Category: provider |
| 2 | |
| 3 | # Model Studio CosyVoice Voice Design |
| 4 | |
| 5 | Use the CosyVoice voice enrollment API to create designed voices from a natural-language voice description. |
| 6 | |
| 7 | ## Critical model names |
| 8 | |
| 9 | Use `model="voice-enrollment"` and one of these `target_model` values: |
| 10 | - `cosyvoice-v3.5-plus` |
| 11 | - `cosyvoice-v3.5-flash` |
| 12 | - `cosyvoice-v3-plus` |
| 13 | - `cosyvoice-v3-flash` |
| 14 | |
| 15 | Recommended default in this repo: |
| 16 | - `target_model="cosyvoice-v3.5-plus"` |
| 17 | |
| 18 | ## Region and compatibility |
| 19 | |
| 20 | - `cosyvoice-v3.5-plus` and `cosyvoice-v3.5-flash` are available only in China mainland deployment mode (Beijing endpoint). |
| 21 | - In international deployment mode (Singapore endpoint), `cosyvoice-v3-plus` and `cosyvoice-v3-flash` do not support voice clone/design. |
| 22 | - The `target_model` must match the later speech synthesis model. |
| 23 | |
| 24 | ## Endpoint |
| 25 | |
| 26 | - Domestic: `https://dashscope.aliyuncs.com/api/v1/services/audio/tts/customization` |
| 27 | - International: `https://dashscope-intl.aliyuncs.com/api/v1/services/audio/tts/customization` |
| 28 | |
| 29 | ## Prerequisites |
| 30 | |
| 31 | - Set `DASHSCOPE_API_KEY` in your environment, or add `dashscope_api_key` to `~/.alibabacloud/credentials`. |
| 32 | |
| 33 | ## Normalized interface (cosyvoice.voice_design) |
| 34 | |
| 35 | ### Request |
| 36 | - `model` (string, optional): fixed to `voice-enrollment` |
| 37 | - `target_model` (string, optional): default `cosyvoice-v3.5-plus` |
| 38 | - `prefix` (string, required): letters/digits only, max 10 chars |
| 39 | - `voice_prompt` (string, required): max 500 chars, Chinese or English only |
| 40 | - `preview_text` (string, required): max 200 chars, Chinese or English |
| 41 | - `language_hints` (array[string], optional): `zh` or `en`, and should match `preview_text` |
| 42 | - `sample_rate` (int, optional): e.g. `24000` |
| 43 | - `response_format` (string, optional): e.g. `wav` |
| 44 | |
| 45 | ### Response |
| 46 | - `voice_id` (string) |
| 47 | - `request_id` (string) |
| 48 | - `status` (string, optional) |
| 49 | |
| 50 | ## Operational guidance |
| 51 | |
| 52 | - Keep `voice_prompt` concrete: timbre, age range, pace, emotion, articulation, and scenario. |
| 53 | - If `language_hints` is used, it should match the language of `preview_text`. |
| 54 | - Designed voice names include a `-vd-` marker in the generated backend naming convention. |
| 55 | |
| 56 | ## Local helper script |
| 57 | |
| 58 | Prepare a normalized request JSON: |
| 59 | |
| 60 | ```bash |
| 61 | python skills/ai/audio/aliyun-cosyvoice-voice-design/scripts/prepare_cosyvoice_design_request.py \ |
| 62 | --target-model cosyvoice-v3.5-plus \ |
| 63 | --prefix announcer \ |
| 64 | --voice-prompt "沉稳的中年男性播音员,低沉有磁性,语速平稳,吐字清晰。" \ |
| 65 | --preview-text "各位听众朋友,大家好,欢迎收听晚间新闻。" \ |
| 66 | --language-hint zh |
| 67 | ``` |
| 68 | |
| 69 | ## Validation |
| 70 | |
| 71 | ```bash |
| 72 | mkdir -p output/aliyun-cosyvoice-voice-design |
| 73 | for f in skills/ai/audio/aliyun-cosyvoice-voice-design/scripts/*.py; do |
| 74 | python3 -m py_compile "$f" |
| 75 | done |
| 76 | echo "py_compile_ok" > output/aliyun-cosyvoice-voice-design/validate.txt |
| 77 | ``` |
| 78 | |
| 79 | Pass criteria: command exits 0 and `output/aliyun-cosyvoice-voice-design/validate.txt` is generated. |
| 80 | |
| 81 | ## Output And Evidence |
| 82 | |
| 83 | - Save artifacts, command outputs, and API response summaries under `output/aliyun-cosyvoice-voice-design/`. |
| 84 | - Include `target_model`, `prefix`, `voice_prompt`, and `preview_text` in the evidence file. |
| 85 | |
| 86 | ## References |
| 87 | |
| 88 | - `references/api_reference.md` |
| 89 | - `references/sources.md` |