OpenAI TTS (curl)
Generate speech from text via OpenAI's /v1/audio/speech endpoint.
Quick start
CODEBLOCK0
Defaults:
- - Model:
tts-1 (fast) or tts-1-hd (quality) - Voice:
alloy (neutral), also: echo, fable, onyx, nova, INLINECODE8 - Format: INLINECODE9
Voices
| Voice | Description |
|---|
| alloy | Neutral, balanced |
| echo |
Male, warm |
| fable | British, expressive |
| onyx | Deep, authoritative |
| nova | Female, friendly |
| shimmer | Female, soft |
Flags
CODEBLOCK1
Options:
- -
--voice <name>: alloy|echo|fable|onyx|nova|shimmer (default: alloy) - INLINECODE11 : tts-1|tts-1-hd (default: tts-1)
- INLINECODE12 : mp3|opus|aac|flac|wav|pcm (default: mp3)
- INLINECODE13 : 0.25-4.0 (default: 1.0)
- INLINECODE14 : output file (default: stdout or auto-named)
API key
Set OPENAI_API_KEY, or configure in ~/.clawdbot/clawdbot.json:
CODEBLOCK2
Pricing
- - tts-1: ~$0.015 per 1K characters
- tts-1-hd: ~$0.030 per 1K characters
Very affordable for short responses!
OpenAI TTS (curl)
通过OpenAI的/v1/audio/speech端点将文本合成为语音。
快速开始
bash
{baseDir}/scripts/speak.sh 你好,世界!
{baseDir}/scripts/speak.sh 你好,世界! --out /tmp/hello.mp3
默认设置:
- - 模型:tts-1(快速)或 tts-1-hd(高质量)
- 音色:alloy(中性),其他可选:echo、fable、onyx、nova、shimmer
- 格式:mp3
音色
男声,温暖 |
| fable | 英式,富有表现力 |
| onyx | 深沉,权威 |
| nova | 女声,友好 |
| shimmer | 女声,柔和 |
参数
bash
{baseDir}/scripts/speak.sh 文本 --voice nova --model tts-1-hd --out speech.mp3
{baseDir}/scripts/speak.sh 文本 --format opus --speed 1.2
选项:
- - --voice <名称>:alloy|echo|fable|onyx|nova|shimmer(默认:alloy)
- --model <名称>:tts-1|tts-1-hd(默认:tts-1)
- --format <格式>:mp3|opus|aac|flac|wav|pcm(默认:mp3)
- --speed <数值>:0.25-4.0(默认:1.0)
- --out <路径>:输出文件(默认:标准输出或自动命名)
API密钥
设置 OPENAIAPIKEY,或在 ~/.clawdbot/clawdbot.json 中配置:
json5
{
skills: {
entries: {
openai-tts: {
apiKey: sk-...
}
}
}
}
定价
- - tts-1:约每1000字符$0.015
- tts-1-hd:约每1000字符$0.030
对于简短回复来说非常实惠!