Seed Speech 2.0 API 调用参考
41 种音色,以自然语言设置语气
用一个 PopNow API 密钥,就能在自己的代码里调用 Seed Speech 2.0。下面列出要填的调用名、这个型号接受的每个输入字段、每次请求花多少美元(USD),以及一段可以直接粘进终端运行的请求。
参数说明直接取自型号的输入 schema,暂时只有英文。
一览
- 出品方
- ByteDance
- 产出
- 音频
- 起价
- $0.072 USD 每 1000 字符
价格以 USD 显示,从你的 PopNow 余额扣款。任务受理时预留可能的最高费用,完成后按实际用量结算并释放余款;失败任务不收费。运行前可调用 POST /api/v1/jobs/quote 获取准确报价。
文字转语音
bytedance/seed-speech-2.0/text-to-speech
价格
| 选项 | USD |
|---|---|
默认 | $0.072 每 1000 字符 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
text必填 | string | — | 最多 5000 个字符 | The words to be spoken, exactly as written. Billed per 1,000 characters. |
voice_id可选 | string | stokie_en | vivi_mixed_en_zh_ja_es_id, mindy_en_es_id_pt_zh, stokie_en, dacey_en, tim_en, kian_en_zh, cedric_en_zh, sophie_en_zh, jean_en_zh, magnus_en_zh, mabel_en_zh, nadia_en_zh, opal_en_zh, pearl_en_zh, … (+27) | Preset voice. The suffix shows the languages it is built for. |
instructions可选 | string | — | 最多 1000 个字符 | How to read the text: tone, emotion, pace or volume. Not spoken and not billed. |
speed可选 | number | 1 | 0.5 到 2 | Speaking rate; 1 is the voice's normal pace. |
pitch可选 | integer | 0 | -12 到 12 | Pitch shift in semitones; 0 keeps the voice's own pitch. |
volume可选 | number | 1 | 0.5 到 2 | Loudness multiplier; 1 is the normal level. |
language可选 | string | — | zh, en, ja, es-mx, id, pt-br, ko, it, de, fr | Forces the reading language. Leave empty to detect it from the text. |
output_format可选 | string | mp3 | mp3, opus | File format of the result; opus is an Ogg Opus file. |
sample_rate可选 | integer | — | 8000, 16000, 22050, 24000, 32000, 44100, 48000 | Sample rate in Hz. The model uses 24000 when omitted. |
请求示例
这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 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": "bytedance/seed-speech-2.0/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"
