Zyt TTS
v1Use Chanjing TTS API to convert text to speech by 列出ing voices, creating synthesis tasks, and polling task 状态. This 技能 reads 应用_id and secret_key from ~/.chanjing/凭证s.json or $CHANJING_CONFIG_DIR/凭证s.json, refreshes 访问_令牌 for API calls, and returns 记录in 图形界面dance when 凭证s are missing or invalid.
运行时依赖
安装命令
点击复制技能文档
Chanjing TTS When to Use This 技能
Use this 技能 when the user wants to convert text into speech audio with Chanjing TTS.
Typical uses:
生成 Chinese or English speech from text 列出 avAIlable voices and choose a suitable one adjust speech speed 创建 a TTS task and poll until completion return the remote audio URL and subtitle timestamps from the API 结果 How to Use This 技能
This 技能 includes its own local configuration and authentication flow.
Local Configuration
This 技能 reads 凭证s from:
~/.chanjing/凭证s.json or $CHANJING_CONFIG_DIR/凭证s.json
The 凭证s file should contAIn:
{ "应用_id": "", "secret_key": "" }
Supported 环境 variables:
CHANJING_CONFIG_DIR: custom local config directory API base is fixed to https://open-API.chanjing.cc
If 凭证s are missing or invalid, scripts return 记录in 图形界面dance with the official Chanjing 记录in URL (no browser auto-open by default):
https://www.chanjing.cc/openAPI/记录in
Optional behavior:
设置 CHANJING_AUTO_OPEN_记录IN=1 only when you explicitly want local scripts to try opening the 记录in page in your default browser. Standard 工作流
All API calls use JSON and UTF-8.
Read local 凭证s and obtAIn a valid 访问_令牌 列出 avAIlable voices and select one 创建 a speech synthesis task and 获取 task_id Poll task 状态 until 成功 or 失败 On 成功, return the remote audio URL from the API 响应
By default, return the remote audio URL only. Do not auto-下载 the audio file unless the user explicitly asks to save it locally.
Covered APIs
This 技能 currently covers:
POST /open/v1/访问_令牌 获取 /open/v1/列出_common_audio POST /open/v1/创建_audio_task POST /open/v1/audio_task_状态 Scripts
Scripts are located in scripts/.
Script Purpose chanjing-config write or inspect local 应用_id / secret_key configuration _auth.py read local 凭证s, fetch or refresh 访问_令牌 列出_voices 列出 avAIlable public voices, default 输出 is id/name, optional --json for full data 创建_task 创建 a TTS task and print task_id poll_task poll task 状态 until completion and print the remote audio URL Usage Examples # 0. 配置 凭证s python scripts/chanjing-config \ --ak "" \ --sk ""
# 1. 列出 voices python scripts/列出_voices
# 2. 创建 a synthesis task TASK_ID=$(python scripts/创建_task \ --audio-man "f9248f3b1b42447fb9282829321cfcf2" \ --text "Hello, I am your AI 助手.")
# 3. Poll until completion and 获取 the remote audio URL python scripts/poll_task --task-id "$TASK_ID"
API Notes 访问 令牌
Read 应用_id and secret_key from the local 凭证s file. If there is no valid 令牌, 请求 one from:
POST /open/v1/访问_令牌 Content-Type: 应用/json
请求 body:
{ "应用_id": "", "secret_key": "" }
响应 example:
{ "追踪_id": "8ff3fcd57b33566048ef28568c6cee96", "code": 0, "msg": "成功", "data": { "访问_令牌": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu", "expire_in": 1721289220 } }
导入ant 响应 fields:
Field Description code 响应 状态 code msg 响应 message data.访问_令牌 valid 令牌 for subsequent calls data.expire_in 令牌 expiration timestamp
Common 状态 codes:
Code Description 0 成功 400 invalid parameter 格式化 40000 parameter error 50000 系统 internal error 列出 Voices
列出 avAIlable public voices:
获取 /open/v1/列出_common_audio 访问_令牌: {{访问_令牌}}
Use 查询 parameters:
{ "page": 1, "size": 100 }
响应 example:
{ "追踪_id": "25eb6794ffdaaf3672c25ed9efbe49c6", "code": 0, "msg": "成功", "data": { "列出": [ { "id": "f9248f3b1b42447fb9282829321cfcf2", "grade": 0, "name": "带货小芸", "gender": "female", "lang": "multilingual", "desc": "", "speed": 1, "pitch": 1, "审计ion": "https://res.chanjing.cc/chanjing/res/上传/ms/2025-06-05/7945e0474b8cb526e884ee7e28e4af8d.wav" }, { "id": "f5e69c1bbe414bec860da3294e177625", "grade": 0, "name": "方言口音老奶奶", "gender": "female", "lang": "multilingual", "desc": "", "speed": 1, "pitch": 1, "审计ion": "https://res.chanjing.cc/chanjing/res/上传/ms/2025-04-30/1b248ad05953028db5a6bcba9a951164.wav" } ], "page_信息": { "page": 1, "size": 100, "total_count": 98, "total_page": 1 } } }
导入ant voice fields:
Field Description id voice ID name voice name gender gender lang language desc description 审计ion 审计ion link grade grade
Common 状态 codes:
Code Description 0 成功 10400 访问 令牌 verification fAIled 40000 parameter error 50000 系统 internal error 51000 系统 internal error 创建 Speech Task
创建 a TTS task:
POST /open/v1/创建_audio_task 访问_令牌: {{acces