ElevenLabs v4 API 调用参考
ElevenLabs v4 语音,21 种音色、90 多种语言,单次最多 10,000 个字符
用一个 PopNow API 密钥,就能在自己的代码里调用 ElevenLabs v4。下面列出要填的调用名、这个型号接受的每个输入字段、每次请求花多少美元(USD),以及一段可以直接粘进终端运行的请求。
参数说明直接取自型号的输入 schema,暂时只有英文。
一览
- 出品方
- ElevenLabs
- 产出
- 音频
- 起价
- $0.096 USD 每 1000 字符
- 一般耗时
- 约 7 秒
价格以 USD 显示,从你的 PopNow 余额扣款。任务受理时预留可能的最高费用,完成后按实际用量结算并释放余款;失败任务不收费。运行前可调用 POST /api/v1/jobs/quote 获取准确报价。
文字转语音
elevenlabs/v4/text-to-speech
价格
| 选项 | USD |
|---|---|
默认 | $0.096 每 1000 字符 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
text必填 | string | — | 最多 10000 个字符 | The words to speak. Audio tags such as [whispers] or [sighs] are performed, not read. Billed per 1,000 characters. Up to 10,000 characters; about 3,000 or fewer keeps a long read from being cut off. |
voice_id可选 | string | Roger | Adam, Alice, Bella, Bill, Brian, Callum, Charlie, Chris, Daniel, Eric, George, Harry, Jessica, Laura, … (+7) | Preset voice. |
language可选 | string | auto | auto, af, am, ar, hy, as, ast, az, be, bn, bs, bg, my, yue, … (+78) | Language to enforce, as an ISO code, or auto to detect it from the text. |
stability可选 | number | 0.5 | 0 到 1 | How steady the delivery is, 0 to 1. Lower is more expressive and more variable. |
similarity_boost可选 | number | 0.75 | 0 到 1 | How closely the speech follows the selected voice, 0 to 1. |
output_format可选 | string | mp3_44100_128 | mp3_44100_128, mp3_44100_64, mp3_22050_32, opus_48000_128, pcm_24000, pcm_16000, wav_44100, ulaw_8000, alaw_8000 | Audio container, sample rate and bitrate. pcm is raw audio without a file header. |
text_normalization_mode可选 | string | auto | auto, on, off | Whether numbers, dates and abbreviations are spelled out before reading. |
clone_strength可选 | number | — | 0 到 1 | Strength of a professional voice clone, 0 to 1. Has no effect on preset voices. |
seed可选 | integer | — | 0 到 4294967295 | Random seed for controlled comparisons. |
请求示例
这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 POPNOW_API_KEY。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "elevenlabs/v4/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"
