Skip to content

Commit 1531123

Browse files
xuruiraysteipete
andcommitted
feat(tts): add BytePlus Seed Speech provider
Add Volcengine/BytePlus Seed Speech as a bundled TTS provider with current API-key auth, legacy AppID/token fallback, native Ogg/Opus voice-note output, and MP3 audio-file output. Co-authored-by: Peter Steinberger <[email protected]>
1 parent b1b29a8 commit 1531123

10 files changed

Lines changed: 937 additions & 16 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Docs: https://docs.openclaw.ai
5555
- Providers/ElevenLabs: include `eleven_v3` in the bundled TTS model catalog so model selection surfaces can offer ElevenLabs v3. (#68321) Thanks @itsuzef.
5656
- Providers/Local CLI TTS: add a bundled local command speech provider with file/stdout input, voice-note Opus conversion, and telephony PCM output. (#56239) Thanks @solar2ain.
5757
- Providers/Inworld: add Inworld as a bundled speech provider with streaming TTS synthesis, voice listing, voice-note output, and PCM telephony output. (#55972) Thanks @cshape.
58+
- Providers/Volcengine: add Volcengine/BytePlus Seed Speech as a bundled TTS provider with API-key auth, native Ogg/Opus voice-note output, and MP3 audio-file output. (#55641) Thanks @xuruiray.
5859
- Android/Talk Mode: expose Talk Mode in the Voice tab with runtime-owned voice capture modes and microphone foreground-service escalation. Thanks @alex-latitude.
5960
- Providers/LiteLLM: register `litellm` as an image-generation provider so `image_generate model=litellm/...` calls and `agents.defaults.imageGenerationModel.fallbacks` entries resolve through the LiteLLM proxy. Thanks @zqchris.
6061
- Codex harness: require Codex app-server `0.125.0` or newer and cover native MCP `PreToolUse`, `PostToolUse`, and `PermissionRequest` payloads through the OpenClaw hook relay.

‎docs/.i18n/glossary.zh-CN.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@
111111
"source": "BytePlus (International)",
112112
"target": "BytePlus(国际版)"
113113
},
114+
{
115+
"source": "Volcengine TTS HTTP API",
116+
"target": "Volcengine TTS HTTP API"
117+
},
114118
{
115119
"source": "Amazon Bedrock Mantle",
116120
"target": "Amazon Bedrock Mantle"

‎docs/providers/volcengine.md‎

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
summary: "Volcano Engine setup (Doubao models, general + coding endpoints)"
2+
summary: "Volcano Engine setup (Doubao models, coding endpoints, and Seed Speech TTS)"
33
title: "Volcengine (Doubao)"
44
read_when:
55
- You want to use Volcano Engine or Doubao models with OpenClaw
66
- You need the Volcengine API key setup
7+
- You want to use Volcengine Speech text-to-speech
78
---
89

910
The Volcengine provider gives access to Doubao models and third-party models
1011
hosted on Volcano Engine, with separate endpoints for general and coding
11-
workloads.
12+
workloads. The same bundled plugin can also register Volcengine Speech as a TTS
13+
provider.
1214

13-
| Detail | Value |
14-
| --------- | --------------------------------------------------- |
15-
| Providers | `volcengine` (general) + `volcengine-plan` (coding) |
16-
| Auth | `VOLCANO_ENGINE_API_KEY` |
17-
| API | OpenAI-compatible |
15+
| Detail | Value |
16+
| ---------- | ---------------------------------------------------------- |
17+
| Providers | `volcengine` (general + TTS) + `volcengine-plan` (coding) |
18+
| Model auth | `VOLCANO_ENGINE_API_KEY` |
19+
| TTS auth | `VOLCENGINE_TTS_API_KEY` or `BYTEPLUS_SEED_SPEECH_API_KEY` |
20+
| API | OpenAI-compatible models, BytePlus Seed Speech TTS |
1821

1922
## Getting started
2023

@@ -95,6 +98,59 @@ Both providers are configured from a single API key. Setup registers both automa
9598
</Tab>
9699
</Tabs>
97100

101+
## Text-to-speech
102+
103+
Volcengine TTS uses the BytePlus Seed Speech HTTP API and is configured
104+
separately from the OpenAI-compatible Doubao model API key. In the BytePlus
105+
console, open Seed Speech > Settings > API Keys and copy the API key, then set:
106+
107+
```bash
108+
export VOLCENGINE_TTS_API_KEY="byteplus_seed_speech_api_key"
109+
export VOLCENGINE_TTS_RESOURCE_ID="seed-tts-1.0"
110+
```
111+
112+
Then enable it in `openclaw.json`:
113+
114+
```json5
115+
{
116+
messages: {
117+
tts: {
118+
auto: "always",
119+
provider: "volcengine",
120+
providers: {
121+
volcengine: {
122+
apiKey: "byteplus_seed_speech_api_key",
123+
voice: "en_female_anna_mars_bigtts",
124+
speedRatio: 1.0,
125+
},
126+
},
127+
},
128+
},
129+
}
130+
```
131+
132+
For voice-note targets, OpenClaw asks Volcengine for provider-native
133+
`ogg_opus`. For normal audio attachments, it asks for `mp3`. Provider aliases
134+
`bytedance` and `doubao` also resolve to the same speech provider.
135+
136+
The default resource id is `seed-tts-1.0` because that is what BytePlus grants
137+
to newly created Seed Speech API keys in the default project. If your project
138+
has TTS 2.0 entitlement, set `VOLCENGINE_TTS_RESOURCE_ID=seed-tts-2.0`.
139+
140+
<Warning>
141+
`VOLCANO_ENGINE_API_KEY` is for the ModelArk/Doubao model endpoints and is not a
142+
Seed Speech API key. TTS needs a Seed Speech API key from the BytePlus Speech
143+
Console, or a legacy Speech Console AppID/token pair.
144+
</Warning>
145+
146+
Legacy AppID/token auth remains supported for older Speech Console applications:
147+
148+
```bash
149+
export VOLCENGINE_TTS_APPID="speech_app_id"
150+
export VOLCENGINE_TTS_TOKEN="speech_access_token"
151+
export VOLCENGINE_TTS_CLUSTER="volcano_tts"
152+
```
153+
98154
## Advanced configuration
99155

100156
<AccordionGroup>
@@ -112,8 +168,10 @@ Both providers are configured from a single API key. Setup registers both automa
112168
</Accordion>
113169

114170
<Accordion title="Environment variables for daemon processes">
115-
If the Gateway runs as a daemon (launchd/systemd), make sure
116-
`VOLCANO_ENGINE_API_KEY` is available to that process (for example, in
171+
If the Gateway runs as a daemon (launchd/systemd), make sure model and TTS
172+
env vars such as `VOLCANO_ENGINE_API_KEY`, `VOLCENGINE_TTS_API_KEY`,
173+
`BYTEPLUS_SEED_SPEECH_API_KEY`, `VOLCENGINE_TTS_APPID`, and
174+
`VOLCENGINE_TTS_TOKEN` are available to that process (for example, in
117175
`~/.openclaw/.env` or via `env.shellEnv`).
118176
</Accordion>
119177
</AccordionGroup>

‎docs/tools/tts.md‎

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ read_when:
77
title: "Text-to-speech"
88
---
99

10-
OpenClaw can convert outbound replies into audio using ElevenLabs, Google Gemini, Gradium, Inworld, Local CLI, Microsoft, MiniMax, OpenAI, Vydra, xAI, or Xiaomi MiMo.
10+
OpenClaw can convert outbound replies into audio using ElevenLabs, Google Gemini, Gradium, Inworld, Local CLI, Microsoft, MiniMax, OpenAI, Volcengine, Vydra, xAI, or Xiaomi MiMo.
1111
It works anywhere OpenClaw can send audio.
1212

1313
## Supported services
@@ -20,6 +20,7 @@ It works anywhere OpenClaw can send audio.
2020
- **Microsoft** (primary or fallback provider; current bundled implementation uses `node-edge-tts`)
2121
- **MiniMax** (primary or fallback provider; uses the T2A v2 API)
2222
- **OpenAI** (primary or fallback provider; also used for summaries)
23+
- **Volcengine** (primary or fallback provider; uses the BytePlus Seed Speech HTTP API)
2324
- **Vydra** (primary or fallback provider; shared image, video, and speech provider)
2425
- **xAI** (primary or fallback provider; uses the xAI TTS API)
2526
- **Xiaomi MiMo** (primary or fallback provider; uses MiMo TTS through Xiaomi chat completions)
@@ -39,7 +40,7 @@ or ElevenLabs.
3940

4041
## Optional keys
4142

42-
If you want ElevenLabs, Google Gemini, Gradium, Inworld, MiniMax, OpenAI, Vydra, xAI, or Xiaomi MiMo:
43+
If you want ElevenLabs, Google Gemini, Gradium, Inworld, MiniMax, OpenAI, Volcengine, Vydra, xAI, or Xiaomi MiMo:
4344

4445
- `ELEVENLABS_API_KEY` (or `XI_API_KEY`)
4546
- `GEMINI_API_KEY` (or `GOOGLE_API_KEY`)
@@ -49,6 +50,9 @@ If you want ElevenLabs, Google Gemini, Gradium, Inworld, MiniMax, OpenAI, Vydra,
4950
`MINIMAX_OAUTH_TOKEN`, `MINIMAX_CODE_PLAN_KEY`, or
5051
`MINIMAX_CODING_API_KEY`
5152
- `OPENAI_API_KEY`
53+
- `VOLCENGINE_TTS_API_KEY` (or `BYTEPLUS_SEED_SPEECH_API_KEY`);
54+
legacy AppID/token auth also accepts `VOLCENGINE_TTS_APPID` and
55+
`VOLCENGINE_TTS_TOKEN`
5256
- `VYDRA_API_KEY`
5357
- `XAI_API_KEY`
5458
- `XIAOMI_API_KEY`
@@ -68,6 +72,7 @@ so that provider must also be authenticated if you enable summaries.
6872
- [Gradium](/providers/gradium)
6973
- [Inworld TTS API](https://docs.inworld.ai/tts/tts)
7074
- [MiniMax T2A v2 API](https://platform.minimaxi.com/document/T2A%20V2)
75+
- [Volcengine TTS HTTP API](/providers/volcengine#text-to-speech)
7176
- [Xiaomi MiMo speech synthesis](/providers/xiaomi#text-to-speech)
7277
- [node-edge-tts](https://github.com/SchneeHertz/node-edge-tts)
7378
- [Microsoft Speech output formats](https://learn.microsoft.com/azure/ai-services/speech-service/rest-text-to-speech#audio-outputs)
@@ -249,6 +254,35 @@ encoding, so do not pass a raw bearer token and do not Base64-encode it
249254
yourself. The key falls back to the `INWORLD_API_KEY` env var. See
250255
[Inworld provider](/providers/inworld) for full setup.
251256

257+
### Volcengine primary
258+
259+
```json5
260+
{
261+
messages: {
262+
tts: {
263+
auto: "always",
264+
provider: "volcengine",
265+
providers: {
266+
volcengine: {
267+
apiKey: "byteplus_seed_speech_api_key",
268+
resourceId: "seed-tts-1.0",
269+
voice: "en_female_anna_mars_bigtts",
270+
speedRatio: 1.0,
271+
},
272+
},
273+
},
274+
},
275+
}
276+
```
277+
278+
Volcengine TTS uses the BytePlus Seed Speech API key from the Speech Console,
279+
not the OpenAI-compatible `VOLCANO_ENGINE_API_KEY` used for Doubao model
280+
providers. Resolution order is `messages.tts.providers.volcengine.apiKey` ->
281+
`VOLCENGINE_TTS_API_KEY` -> `BYTEPLUS_SEED_SPEECH_API_KEY`. Legacy AppID/token
282+
auth still works through `messages.tts.providers.volcengine.appId` / `token` or
283+
`VOLCENGINE_TTS_APPID` / `VOLCENGINE_TTS_TOKEN`. Voice-note targets request
284+
provider-native `ogg_opus`; normal audio-file targets request `mp3`.
285+
252286
### xAI primary
253287

254288
```json5
@@ -447,7 +481,7 @@ Then run:
447481
- `tagged` only sends audio when the reply includes `[[tts:key=value]]` directives or a `[[tts:text]]...[[/tts:text]]` block.
448482
- `enabled`: legacy toggle (doctor migrates this to `auto`).
449483
- `mode`: `"final"` (default) or `"all"` (includes tool/block replies).
450-
- `provider`: speech provider id such as `"elevenlabs"`, `"google"`, `"gradium"`, `"inworld"`, `"microsoft"`, `"minimax"`, `"openai"`, `"vydra"`, `"xai"`, or `"xiaomi"` (fallback is automatic).
484+
- `provider`: speech provider id such as `"elevenlabs"`, `"google"`, `"gradium"`, `"inworld"`, `"microsoft"`, `"minimax"`, `"openai"`, `"volcengine"`, `"vydra"`, `"xai"`, or `"xiaomi"` (fallback is automatic).
451485
- If `provider` is **unset**, OpenClaw uses the first configured speech provider in registry auto-select order.
452486
- Legacy `provider: "edge"` config is repaired by `openclaw doctor --fix` and
453487
rewritten to `provider: "microsoft"`.
@@ -461,7 +495,7 @@ Then run:
461495
- `maxTextLength`: hard cap for TTS input (chars). `/tts audio` fails if exceeded.
462496
- `timeoutMs`: request timeout (ms).
463497
- `prefsPath`: override the local prefs JSON path (provider/limit/summary).
464-
- `apiKey` values fall back to env vars (`ELEVENLABS_API_KEY`/`XI_API_KEY`, `GEMINI_API_KEY`/`GOOGLE_API_KEY`, `GRADIUM_API_KEY`, `INWORLD_API_KEY`, `MINIMAX_API_KEY`, `OPENAI_API_KEY`, `VYDRA_API_KEY`, `XAI_API_KEY`, `XIAOMI_API_KEY`).
498+
- `apiKey` values fall back to env vars (`ELEVENLABS_API_KEY`/`XI_API_KEY`, `GEMINI_API_KEY`/`GOOGLE_API_KEY`, `GRADIUM_API_KEY`, `INWORLD_API_KEY`, `MINIMAX_API_KEY`, `OPENAI_API_KEY`, `VYDRA_API_KEY`, `XAI_API_KEY`, `XIAOMI_API_KEY`). Volcengine uses `appId`/`token` instead.
465499
- `providers.elevenlabs.baseUrl`: override ElevenLabs API base URL.
466500
- `providers.openai.baseUrl`: override the OpenAI TTS endpoint.
467501
- Resolution order: `messages.tts.providers.openai.baseUrl` -> `OPENAI_TTS_BASE_URL` -> `https://api.openai.com/v1`
@@ -497,6 +531,21 @@ Then run:
497531
- If `messages.tts.providers.google.apiKey` is omitted, TTS can reuse `models.providers.google.apiKey` before env fallback.
498532
- `providers.gradium.baseUrl`: override Gradium API base URL (default `https://api.gradium.ai`).
499533
- `providers.gradium.voiceId`: Gradium voice identifier (default Emma, `YTpq7expH9539ERJ`).
534+
- `providers.volcengine.apiKey`: BytePlus Seed Speech API key (env:
535+
`VOLCENGINE_TTS_API_KEY` or `BYTEPLUS_SEED_SPEECH_API_KEY`).
536+
- `providers.volcengine.resourceId`: BytePlus Seed Speech resource id (default
537+
`seed-tts-1.0`, env: `VOLCENGINE_TTS_RESOURCE_ID`; use `seed-tts-2.0` when
538+
your BytePlus project has TTS 2.0 entitlement).
539+
- `providers.volcengine.appKey`: BytePlus Seed Speech app key header (default
540+
`aGjiRDfUWi`, env: `VOLCENGINE_TTS_APP_KEY`).
541+
- `providers.volcengine.baseUrl`: override the Seed Speech TTS HTTP endpoint
542+
(env: `VOLCENGINE_TTS_BASE_URL`).
543+
- `providers.volcengine.appId`: legacy Volcengine Speech Console application id (env: `VOLCENGINE_TTS_APPID`).
544+
- `providers.volcengine.token`: legacy Volcengine Speech Console access token (env: `VOLCENGINE_TTS_TOKEN`).
545+
- `providers.volcengine.cluster`: legacy Volcengine TTS cluster (default `volcano_tts`, env: `VOLCENGINE_TTS_CLUSTER`).
546+
- `providers.volcengine.voice`: voice type (default `en_female_anna_mars_bigtts`, env: `VOLCENGINE_TTS_VOICE`).
547+
- `providers.volcengine.speedRatio`: provider-native speed ratio.
548+
- `providers.volcengine.emotion`: provider-native emotion tag.
500549
- `providers.xai.apiKey`: xAI TTS API key (env: `XAI_API_KEY`).
501550
- `providers.xai.baseUrl`: override the xAI TTS base URL (default `https://api.x.ai/v1`, env: `XAI_BASE_URL`).
502551
- `providers.xai.voiceId`: xAI voice id (default `eve`; current live voices: `ara`, `eve`, `leo`, `rex`, `sal`, `una`).
@@ -550,12 +599,13 @@ Here you go.
550599

551600
Available directive keys (when enabled):
552601

553-
- `provider` (registered speech provider id, for example `openai`, `elevenlabs`, `google`, `gradium`, `minimax`, `microsoft`, `vydra`, `xai`, or `xiaomi`; requires `allowProvider: true`)
554-
- `voice` (OpenAI, Gradium, or Xiaomi voice), `voiceName` / `voice_name` / `google_voice` (Google voice), or `voiceId` (ElevenLabs / Gradium / MiniMax / xAI)
602+
- `provider` (registered speech provider id, for example `openai`, `elevenlabs`, `google`, `gradium`, `minimax`, `microsoft`, `volcengine`, `vydra`, `xai`, or `xiaomi`; requires `allowProvider: true`)
603+
- `voice` (OpenAI, Gradium, Volcengine, or Xiaomi voice), `voiceName` / `voice_name` / `google_voice` (Google voice), or `voiceId` (ElevenLabs / Gradium / MiniMax / xAI)
555604
- `model` (OpenAI TTS model, ElevenLabs model id, MiniMax model, or Xiaomi MiMo TTS model) or `google_model` (Google TTS model)
556605
- `stability`, `similarityBoost`, `style`, `speed`, `useSpeakerBoost`
557606
- `vol` / `volume` (MiniMax volume, 0-10)
558607
- `pitch` (MiniMax integer pitch, -12 to 12; fractional values are truncated before the MiniMax request)
608+
- `emotion` (Volcengine emotion tag)
559609
- `applyTextNormalization` (`auto|on|off`)
560610
- `languageCode` (ISO 639-1)
561611
- `seed`

‎extensions/volcengine/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-aut
33
import { ensureModelAllowlistEntry } from "openclaw/plugin-sdk/provider-onboard";
44
import { DOUBAO_CODING_MODEL_CATALOG, DOUBAO_MODEL_CATALOG } from "./models.js";
55
import { buildDoubaoCodingProvider, buildDoubaoProvider } from "./provider-catalog.js";
6+
import { buildVolcengineSpeechProvider } from "./speech-provider.js";
67

78
const PROVIDER_ID = "volcengine";
89
const VOLCENGINE_DEFAULT_MODEL_REF = "volcengine-plan/ark-code-latest";
@@ -78,5 +79,6 @@ export default definePluginEntry({
7879
return [...volcengineModels, ...volcenginePlanModels];
7980
},
8081
});
82+
api.registerSpeechProvider(buildVolcengineSpeechProvider());
8183
},
8284
});

‎extensions/volcengine/openclaw.plugin.json‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
"providerDiscoveryEntry": "./provider-discovery.ts",
55
"providers": ["volcengine", "volcengine-plan"],
66
"providerAuthEnvVars": {
7-
"volcengine": ["VOLCANO_ENGINE_API_KEY"]
7+
"volcengine": ["VOLCANO_ENGINE_API_KEY"],
8+
"volcengine-tts": [
9+
"VOLCENGINE_TTS_API_KEY",
10+
"BYTEPLUS_SEED_SPEECH_API_KEY",
11+
"VOLCENGINE_TTS_APPID",
12+
"VOLCENGINE_TTS_TOKEN"
13+
]
814
},
915
"providerAuthAliases": {
1016
"volcengine-plan": "volcengine"
@@ -28,5 +34,8 @@
2834
"type": "object",
2935
"additionalProperties": false,
3036
"properties": {}
37+
},
38+
"contracts": {
39+
"speechProviders": ["volcengine"]
3140
}
3241
}

0 commit comments

Comments
 (0)