跳轉到主要內容

Documentation Index

Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt

Use this file to discover all available pages before exploring further.

Gradium 是 OpenClaw 內建的文字轉語音提供者。此 Plugin 可產生一般音訊回覆(WAV)、相容語音訊息的 Opus 輸出,以及用於電話介面的 8 kHz u-law 音訊。
屬性
提供者 IDgradium
驗證GRADIUM_API_KEY 或 config apiKey
基底 URLhttps://api.gradium.ai(預設)
預設語音Emma (YTpq7expH9539ERJ)

設定

建立 Gradium API 金鑰,然後透過環境變數或 config 金鑰將它提供給 OpenClaw。
export GRADIUM_API_KEY="gsk_..."
此 Plugin 會先檢查已解析的 apiKey,再回退使用 GRADIUM_API_KEY 環境變數。

Config

{
  messages: {
    tts: {
      auto: "always",
      provider: "gradium",
      providers: {
        gradium: {
          voiceId: "YTpq7expH9539ERJ",
          // apiKey: "${GRADIUM_API_KEY}",
          // baseUrl: "https://api.gradium.ai",
        },
      },
    },
  },
}
金鑰類型說明
messages.tts.providers.gradium.apiKeystring已解析的 API 金鑰。支援 ${ENV} 與 secret refs。
messages.tts.providers.gradium.baseUrlstring覆寫 API 來源。會移除結尾斜線。預設為 https://api.gradium.ai
messages.tts.providers.gradium.voiceIdstring沒有 directive 覆寫時使用的預設語音 ID。
輸出的音訊格式會由 runtime 根據目標介面自動選取,無法從 openclaw.json 設定。請參閱下方的輸出

語音

名稱語音 ID
EmmaYTpq7expH9539ERJ
KentLFZvm12tW_z0xfGo
TiffanyEu9iL_CYe8N-Gkx_
Christina2H4HY2CBNyJHBCrP
SydneyjtEKaLYNn6iif5PR
JohnKWJiFWu2O9nMPYcR
Arthur3jUdJyOi9pgbxBTK
預設語音:Emma。

每則訊息的語音覆寫

當使用中的語音政策允許語音覆寫時,你可以使用 directive token 在行內切換語音。以下全部都會解析為相同的 voiceId 覆寫:
/voice:LFZvm12tW_z0xfGo
/voice_id:LFZvm12tW_z0xfGo
/voiceid:LFZvm12tW_z0xfGo
/gradium_voice:LFZvm12tW_z0xfGo
/gradiumvoice:LFZvm12tW_z0xfGo
如果語音政策停用語音覆寫,directive 會被消耗但會被忽略。

輸出

runtime 會從目標介面選擇輸出格式。此提供者目前不會合成其他格式。
目標格式副檔名取樣率語音相容旗標
標準音訊wav.wav提供者
語音訊息opus.opus提供者
電話ulaw_8000n/a8 kHzn/a

自動選取順序

在已設定的 TTS 提供者中,Gradium 的自動選取順序為 30。若要了解在未固定 messages.tts.provider 時 OpenClaw 如何選擇使用中的提供者,請參閱文字轉語音

相關