Xpersona
C

Coze Tts

CLAWHUB · Unverified

Text-to-Speech (TTS) using Coze API. Convert text to natural-sounding speech audio files. Supports multiple voices and output formats (mp3, ogg_opus, wav, pcm). Skill: Coze Tts Owner: franklu0819-lang Summary: Text-to-Speech (TTS) using Coze API. Convert text to natural-sounding speech audio files. Supports multiple voices and output formats (mp3, ogg_opus, wav, pcm). Tags: audio:1.0.2, coze:1.0.2, latest:1.0.3, speech:1.0.2, tts:1.0.2, voice:1.0.2 Version history: v1.0.3 | 2026-03-25T15:42:22.129Z | user 默认音色改为 6 v1.0.2 | 2026-03-25T01:19:39.470Z | user 修复脚本语法错误,添加API参考文档 v

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s178vhkrfj7fyecavdqnte98p583hvqc:coze-tts
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-franklu0819-lang-coze-tts/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

20,232 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: coze-tts
description: Text-to-Speech (TTS) using Coze API. Convert text to natural-sounding speech audio files. Supports multiple voices and output formats (mp3, ogg_opus, wav, pcm).
metadata:
  {
    "openclaw":
      {
        "requires": { "bins": ["jq"], "env": ["COZE_API_KEY"] },
      },
  }
---

# Coze Text-to-Speech (TTS)

Convert text to natural-sounding speech using Coze API.

## Setup

**1. Get your API Key:**
Get a key from [Coze Platform](https://www.coze.cn/)

**2. Set it in your environment:**
```bash
export COZE_API_KEY="your-key-here"
```

## Supported Output Formats

- **MP3** - Default format, widely compatible
- **OGG_OPUS** - Optimized for streaming and messaging
- **WAV** - Uncompressed audio
- **PCM** - Raw audio data

## Usage

### Basic TTS

Convert text to speech with default settings:

```bash
bash scripts/text_to_speech.sh "你好,这是测试语音"
```

### Save to Specific File

```bash
bash scripts/text_to_speech.sh "你好世界" -o output.mp3
```

### Use Different Voice

```bash
bash scripts/text_to_speech.sh "你好" -v 2
```

### Change Output Format

```bash
bash scripts/text_to_speech.sh "你好" -f ogg_opus
```

### Full Options

```bash
bash scripts/text_to_speech.sh "要转换的文本" -o output.mp3 -v 1 -f mp3
```

**Parameters:**
- `text` (required): Text to convert to speech
- `-o, --output` (optional): Output file path (default: auto-generated)
- `-v, --voice` (optional): Voice ID (default: 1)
- `-f, --format` (optional): Output format - mp3/ogg_opus/wav/pcm (default: mp3)

## Output

The script saves the audio file and outputs:
- File path
- File size
- Audio duration (if ffprobe is available)

Example output:
```
✓ Audio saved: coze_tts_20260324_235030_a1b2c3d4.mp3
  Size: 25.3 KB
  Duration: ~3 seconds
```

## Workflow Examples

### Generate Notification Audio

```bash
bash scripts/text_to_speech.sh "您有一条新消息" -o notification.mp3
```

### Create Voice Greeting

```bash
bash scripts/text_to_speech.sh "欢迎使用 Coze 语音服务" -v 2 -o greeting.mp3
```

### Generate OGG for Messaging

```bash
bash scripts/text_to_speech.sh "你好" -f ogg_opus -o message.ogg
```

### Batch Generate

```bash
for text in "你好" "谢谢" "再见"; do
    bash scripts/text_to_speech.sh "$text" -o "${text}.mp3"
done
```

## Integration with Other Skills

Combine with `coze-asr` for voice conversation:

```bash
# 1. User speaks -> ASR converts to text
bash coze-asr/scripts/speech_to_text.sh input.ogg

# 2. Process text with AI...

# 3. AI response -> TTS converts to speech
bash coze-tts/scripts/text_to_speech.sh "AI的回复" -o response.mp3
```

## Troubleshooting

**Authentication Error:**
- Check COZE_API_KEY is set correctly
- Verify API key has TTS permissions

**Invalid Voice ID:**
- Voice ID should be a number (int64 format)
- Try voice_id: 1 as default

**File Not Created:**
- Check write permissions in output directory
- Ensure sufficient disk space

## Limitations

- Text length limits apply (check Coze documentation)
- Rate limits may apply based on your plan
- Some voices m

_meta.json

{
  "ownerId": "kn784af36jyc12gczmcr7fq0a981dbhr",
  "slug": "coze-tts",
  "version": "1.0.3",
  "publishedAt": 1774453342129
}

references/coze_tts_api.md

# Coze TTS API 参考文档

## 接口信息

- **接口地址**: `POST https://api.coze.cn/v1/audio/speech`
- **认证方式**: Bearer Token (`Authorization: Bearer {COZE_API_KEY}`)
- **Content-Type**: `application/json`

## 请求参数

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| input | string | 是 | 要转换为语音的文本内容 |
| voice_id | int64 | 否 | 音色ID,默认为1 |
| response_format | string | 否 | 输出格式:mp3/ogg_opus/wav/pcm,默认为mp3 |
| speed | float | 否 | 语速,范围0.5-2.0,默认为1.0 |

## 响应

成功时返回音频文件二进制数据。

错误时返回JSON格式错误信息。

## 错误码

| 错误码 | 说明 |
|--------|------|
| 400 | 请求参数错误 |
| 401 | 认证失败,API Key无效 |
| 429 | 请求频率超限 |
| 500 | 服务器内部错误 |

## 音色列表

| voice_id | 音色名称 | 描述 |
|----------|----------|------|
| 1 | 默认音色 | 标准女声 |
| 2 | 男声 | 标准男声 |

> 注:具体可用音色请参考 Coze 官方文档

## 输出格式说明

| 格式 | 说明 | 适用场景 |
|------|------|----------|
| mp3 | 压缩音频格式 | 通用播放 |
| ogg_opus | Ogg封装的Opus编码 | 即时通讯 |
| wav | 无损音频格式 | 高质量需求 |
| pcm | 原始音频数据 | 专业音频处理 |

## 使用限制

- 文本长度限制:单次请求文本长度有限制
- 频率限制:根据账号等级有不同限制
- 并发限制:注意并发请求数量

## 官方文档

https://www.coze.cn/docs/developer_guides/audio_speech

skill-card.md

## Description:

Text-to-Speech (TTS) using Coze API. Convert text to natural-sounding speech audio files. Supports multiple voices and output formats (mp3, ogg_opus, wav, pcm).

This skill is ready for commercial/non-commercial use.

## Publisher:

[franklu0819-lang](https://clawhub.ai/user/franklu0819-lang)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agents use this skill to send text to Coze's TTS API and save generated speech as MP3, OGG Opus, WAV, or PCM audio files.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: User text is sent to Coze for text-to-speech processing.

Mitigation: Do not submit secrets, regulated data, or text that should not leave the local environment.

Risk: The Coze API key and submitted text may be visible to local process monitoring while the request runs.

Mitigation: Use a narrowly scoped API key and run the skill only on trusted systems.

Risk: Generated audio files are written to local paths chosen by defaults or user options.

Mitigation: Run from a trusted private directory and provide explicit output paths when file placement matters.

## Reference(s):

- [Coze TTS API reference](artifact/references/coze_tts_api.md)
- [Coze audio speech developer guide](https://www.coze.cn/docs/developer_guides/audio_speech)
- [Coze Platform](https://www.coze.cn/)
- [ClawHub skill page](https://clawhub.ai/franklu0819-lang/skills/coze-tts)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, files, guidance]

**Output Format:** [Markdown guidance with bash command examples; generated files are audio in mp3, ogg_opus, wav, or pcm format.]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires jq and COZE_API_KEY; ffprobe is optional for duration reporting.]

## Skill Version(s):

1.0.3 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Coze Tts and adjacent AI workflows.