HERMES + ELEVENLABS

在 Hermes Agent 中使用 ElevenLabs。

ElevenLabs 通过 RunAPI 提供六个音频端点——亚秒级延迟的 turbo-v2.5 TTS、覆盖 29 种语言的 multilingual-v2、用于多说话人对话的 dialogue-v3、音效、语音转文本转录以及人声分离。Hermes Agent 通过 custom:runapi 提供商,使用一个 API 密钥调用它们。

一个 API 密钥 · 文本转语音端点 · 按字符计费
使用 RunAPI 通过 ElevenLabs 文本转语音生成语音音频。

要求:
- 从 RUNAPI_API_KEY 读取 API 密钥。
- 使用 custom:runapi 提供商,base_url 为 https://runapi.ai/v1。
- 调用 POST https://runapi.ai/api/v1/elevenlabs/text_to_speech
- 将 model 设为 "text-to-speech-turbo-v2.5"。
- 将 text 设为你想要朗读的内容。
- 可选地将 voice 设为特定的 ElevenLabs voice ID。
- 可选地将 speed 设在 0.7 到 1.2 之间。
- 该任务为异步任务。轮询返回的 task_id 直到 status 为 "completed"。
- 完成后,从响应 output 中读取音频 URL。
curl -X POST https://runapi.ai/api/v1/elevenlabs/text_to_speech \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-to-speech-turbo-v2.5",
    "text": "Welcome to RunAPI. This audio was generated by ElevenLabs turbo v2.5.",
    "speed": 1.0,
    "stability": 0.5,
    "similarity_boost": 0.75
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "text-to-speech-turbo-v2.5"
}
复制 curl 命令进行测试 elevenlabs
工作原理

三步在 Hermes Agent 中使用 ElevenLabs

1

Configure RunAPI

Set RUNAPI_API_KEY in the environment where Hermes Agent runs. If you already added RunAPI as a custom:runapi provider, the same key and base_url handle all ElevenLabs endpoints — TTS, STT, dialogue, sound effects, and audio isolation.

export RUNAPI_API_KEY=runapi_xxx
2

Call text_to_speech

Send a POST to the text_to_speech endpoint with model set to text-to-speech-turbo-v2.5, the text you want spoken, and optional voice, speed, and stability parameters. Hermes Agent routes the request through the custom:runapi provider. For multilingual output, use text-to-speech-multilingual-v2 with a voice and language_code.

POST /api/v1/elevenlabs/text_to_speech
3

Poll for the result

The endpoint returns a task_id immediately. Poll the task status endpoint until the status is completed, then read the output audio URL from the response.

GET /api/v1/elevenlabs/text_to_speech/tsk_abc123
参数

ElevenLabs text_to_speech API 参数

参数 类型 说明
model string Required. text-to-speech-turbo-v2.5 (low latency) or text-to-speech-multilingual-v2 (29 languages).
text string Required. The text to convert to speech. Max 5000 characters.
voice string ElevenLabs voice ID. Required for multilingual-v2. Turbo-v2.5 uses a default voice if omitted.
speed float Optional. Playback speed multiplier. Range 0.7 to 1.2.
stability float Optional. Voice consistency. Range 0.0 to 1.0. Lower values add expressiveness.
similarity_boost float Optional. Voice similarity enforcement. Range 0.0 to 1.0.
style float Optional. Style exaggeration. Range 0.0 to 1.0.
language_code string Optional. Target language for multilingual-v2, e.g. en, es, ja.
callback_url string Optional. Webhook URL that receives a POST when the task completes.

Hermes Agent 上的 ElevenLabs 是什么?

ElevenLabs 是领先的文本转语音 API,Hermes Agent 通过 custom:runapi provider 调用它,用于语音生成、转录和音频处理。在 Hermes 中的核心优势是串联——生成语音后,将音频 URL 传给 InfiniteTalk 制作说话头像,或传给视频模型完成完整视听内容,全部在单次 agent 运行中完成。

ElevenLabs 使用场景

对话式 AI 语音助手

通过 turbo-v2.5 的亚秒级延迟生成自然语音,构建会说话的语音 agent,适用于客服机器人、交互式助手或电话端界面。

YouTube 内容旁白

以一致的角色声音为 YouTube 视频制作配音,在整个系列中调节稳定性保持旁白一致,调节风格夸张度控制情感范围。

文字转说话视频流水线

在 Hermes Agent 工作流中将 ElevenLabs TTS 与 InfiniteTalk 或其他视频模型串联,在单次自动化运行中完成从文字到带说话头像旁白视频的全流程。

常见问题

ElevenLabs + Hermes Agent 常见问题

Hermes Agent 通用配置

尚未配置?请从 Hermes Agent 的 RunAPI 配置指南开始。

Hermes Agent 配置指南 →

ElevenLabs 模型目录

查看所有 ElevenLabs 版本、定价和 API 文档。

ElevenLabs 模型 →

立即在 Hermes Agent 中试用 ElevenLabs。

免费获取 RunAPI 密钥,配置 custom:runapi 提供商,使用 ElevenLabs 生成语音音频——六个端点、一个 API 密钥、按字符计费。