Qwen-Audio 3.1 TTS Plus API 调用参考
可用自然语言指挥的富表现力旁白与品牌声音
用一个 PopNow API 密钥,就能在自己的代码里调用 Qwen-Audio 3.1 TTS Plus。下面列出要填的调用名、这个型号接受的每个输入字段、每次请求花多少美元(USD),以及一段可以直接粘进终端运行的请求。
参数说明直接取自型号的输入 schema,暂时只有英文。
一览
- 出品方
- Alibaba
- 产出
- 音频
- 起价
- $0.0285 USD 每 1000 字符
价格以 USD 显示,从你的 PopNow 余额扣款。任务受理时预留可能的最高费用,完成后按实际用量结算并释放余款;失败任务不收费。运行前可调用 POST /api/v1/jobs/quote 获取准确报价。
文字转语音
alibaba/qwen-audio-3.1-tts-plus/text-to-speech
价格
| 选项 | USD |
|---|---|
默认 | $0.0285 每 1000 字符 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
text必填 | string | — | 最多 10000 个字符 | The words to speak. Billed per 1,000 characters. Turn on enable_ssml to use SSML tags. |
voice_id可选 | string | longanhuan_v3.1 | longanhuan_v3.1, longanlingxin_v3.1, xunanchuan_v3.1, longanfengyue_v3.1 | Preset voice for this model. |
instructions可选 | string | — | 最多 1000 个字符 | How to read the text: emotion, tone, persona, pace or dialect. Not spoken and not billed. |
language可选 | string | auto | auto, zh, en, ja, ko, fr, de, pt, it, vi, id | Reading language hint, or auto to detect it from the text. |
speed可选 | number | 1 | 0.5 到 2 | Speaking speed from 0.5 to 2. |
pitch可选 | number | 1 | 0.5 到 2 | Pitch from 0.5 to 2. |
volume可选 | integer | 50 | 0 到 100 | Output volume from 0 to 100. |
output_format可选 | string | mp3 | mp3, wav, pcm, opus | Audio encoding. pcm is raw 16-bit audio without a file header. |
sample_rate可选 | integer | 24000 | 8000, 12000, 16000, 22050, 24000, 44100, 48000 | Sample rate in Hz. |
bitrate可选 | integer | — | 32000, 64000, 96000, 128000, 192000, 256000 | Opus bit rate in bits per second. Only applies to opus. |
enable_ssml可选 | boolean | false | — | Read text as SSML markup. |
seed可选 | integer | — | 0 到 65535 | Random seed for controlled comparisons. |
请求示例
这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 POPNOW_API_KEY。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-audio-3.1-tts-plus/text-to-speech",
"input": {
"text": "Hi there! This voice was created with the PopNow API in just a few seconds."
}
}'响应里会立刻带回 taskId。之后用 GET /api/v1/jobs/recordInfo 取结果,或者在请求里加上 callBackUrl 等通知。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
