[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77W954T35HE2PB17FT9BYT2":3,"skill-same:01M77W954T35HE2PB17FT9BYT2":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":36,"ownerHtmlUrl":37,"ownerBlogUrl":6,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M77W954T35HE2PB17FT9BYT2","text-to-speech",null,"Generate speech audio from text using HeyGen's Starfish TTS model. Use when: (1) Generating standalone speech audio files from text, (2) Converting text to speech with voice selection and speed control, (3) Creating audio for voiceovers, narration, or podcasts, (4) Working with HeyGen's \u002Fv3\u002Fvoices endpoints, (5) Listing available TTS voices by language or gender.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ft\u002Ftext-to-speech-heygen\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: text-to-speech\ndescription: |\n  Generate speech audio from text using HeyGen's Starfish TTS model. Use when: (1) Generating standalone speech audio files from text, (2) Converting text to speech with voice selection and speed control, (3) Creating audio for voiceovers, narration, or podcasts, (4) Working with HeyGen's \u002Fv3\u002Fvoices endpoints, (5) Listing available TTS voices by language or gender.\nallowed-tools: mcp__heygen__*\nmetadata:\n  openclaw:\n    requires:\n      env:\n        - HEYGEN_API_KEY\n    primaryEnv: HEYGEN_API_KEY\n---\n\n# Text-to-Speech (HeyGen Starfish)\n\nGenerate speech audio files from text using HeyGen's in-house Starfish TTS model via the v3 API. This skill is for standalone audio generation — separate from video creation.\n\n## Authentication\n\nAll requests require the `X-Api-Key` header. Set the `HEYGEN_API_KEY` environment variable.\n\n```bash\ncurl -X GET \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices?engine=starfish\" \\\n  -H \"X-Api-Key: $HEYGEN_API_KEY\"\n```\n\n## Tool Selection\n\nIf HeyGen MCP tools are available (`mcp__heygen__*`), **prefer them** over direct HTTP API calls.\n\n| Task | MCP Tool | Fallback (Direct API) |\n|------|----------|----------------------|\n| List TTS voices | `mcp__heygen__list_audio_voices` | `GET \u002Fv3\u002Fvoices?engine=starfish` |\n| Generate speech audio | `mcp__heygen__text_to_speech` | `POST \u002Fv3\u002Fvoices\u002Fspeech` |\n\n## Default Workflow\n\n1. List voices with `mcp__heygen__list_audio_voices` (or `GET \u002Fv3\u002Fvoices?engine=starfish`)\n2. Pick a voice matching desired language, gender, and features\n3. Call `mcp__heygen__text_to_speech` (or `POST \u002Fv3\u002Fvoices\u002Fspeech`) with text and voice_id\n4. Use the returned `audio_url` to download or play the audio\n\n## List TTS Voices\n\nRetrieve voices compatible with the Starfish TTS model.\n\n> **Note:** This uses the unified `GET \u002Fv3\u002Fvoices` endpoint with the `engine=starfish` filter to return only TTS-compatible voices. Not all video voices support Starfish TTS. The response is paginated — use `next_token` to fetch additional pages.\n\n### Query Parameters\n\n| Param | Type | Description |\n|-------|------|-------------|\n| `engine` | string | Filter by engine (use `starfish` for TTS voices) |\n| `type` | string | `public` or `private` |\n| `language` | string | Filter by language |\n| `gender` | string | Filter by gender |\n| `limit` | integer | Results per page, 1-100 |\n| `token` | string | Pagination cursor from `next_token` |\n\n### curl\n\n```bash\ncurl -X GET \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices?engine=starfish\" \\\n  -H \"X-Api-Key: $HEYGEN_API_KEY\"\n```\n\n### TypeScript\n\n```typescript\ninterface AudioVoiceItem {\n  voice_id: string;\n  name: string;\n  language: string;\n  gender: \"female\" | \"male\" | \"unknown\";\n  preview_audio_url: string | null;\n  support_pause: boolean;\n  support_locale: boolean;\n  type: string;\n}\n\ninterface TTSVoicesResponse {\n  error: null | string;\n  data: AudioVoiceItem[];\n  has_more: boolean;\n  next_token: string | null;\n}\n\nasync function listTTSVoices(): Promise\u003CAudioVoiceItem[]> {\n  const allVoices: AudioVoiceItem[] = [];\n  let token: string | null = null;\n\n  do {\n    const url = new URL(\"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\");\n    url.searchParams.set(\"engine\", \"starfish\");\n    if (token) url.searchParams.set(\"token\", token);\n\n    const response = await fetch(url.toString(), {\n      headers: { \"X-Api-Key\": process.env.HEYGEN_API_KEY! },\n    });\n\n    const json: TTSVoicesResponse = await response.json();\n\n    if (json.error) {\n      throw new Error(json.error);\n    }\n\n    allVoices.push(...json.data);\n    token = json.next_token;\n  } while (token);\n\n  return allVoices;\n}\n```\n\n### Python\n\n```python\nimport requests\nimport os\n\ndef list_tts_voices() -> list:\n    all_voices = []\n    token = None\n\n    while True:\n        params = {\"engine\": \"starfish\"}\n        if token:\n            params[\"token\"] = token\n\n        response = requests.get(\n            \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\",\n            headers={\"X-Api-Key\": os.environ[\"HEYGEN_API_KEY\"]},\n            params=params,\n        )\n\n        data = response.json()\n        if data.get(\"error\"):\n            raise Exception(data[\"error\"])\n\n        all_voices.extend(data[\"data\"])\n\n        if not data.get(\"has_more\"):\n            break\n        token = data.get(\"next_token\")\n\n    return all_voices\n```\n\n### Response Format\n\n```json\n{\n  \"error\": null,\n  \"data\": [\n    {\n      \"voice_id\": \"f38a635bee7a4d1f9b0a654a31d050d2\",\n      \"name\": \"Chill Brian\",\n      \"language\": \"English\",\n      \"gender\": \"male\",\n      \"preview_audio_url\": \"https:\u002F\u002Fresource.heygen.ai\u002Ftext_to_speech\u002FWpSDQvmLGXEqXZVZQiVeg6.mp3\",\n      \"support_pause\": true,\n      \"support_locale\": false,\n      \"type\": \"public\"\n    }\n  ],\n  \"has_more\": false,\n  \"next_token\": null\n}\n```\n\n## Generate Speech Audio\n\nConvert text to speech audio using a specified voice.\n\n### Endpoint\n\n`POST https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech`\n\n### Request Fields\n\n| Field | Type | Req | Description |\n|-------|------|:---:|-------------|\n| `text` | string | Y | Text content to convert (1-5000 characters) |\n| `voice_id` | string | Y | Voice ID from `GET \u002Fv3\u002Fvoices?engine=starfish` |\n| `input_type` | string | | `\"text\"` (default) or `\"ssml\"` for full SSML markup |\n| `speed` | number | | Speech speed, 0.5-2.0 (default: 1.0) |\n| `language` | string | | Base language code (e.g., `\"en\"`, `\"pt\"`). Auto-detected if omitted |\n| `locale` | string | | BCP-47 locale for multilingual voices (e.g., `\"en-US\"`, `\"pt-BR\"`) |\n\n### curl\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech\" \\\n  -H \"X-Api-Key: $HEYGEN_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"text\": \"Hello! Welcome to our product demo.\",\n    \"voice_id\": \"YOUR_VOICE_ID\",\n    \"speed\": 1.0\n  }'\n```\n\n### TypeScript\n\n```typescript\ninterface TTSRequest {\n  text: string;\n  voice_id: string;\n  input_type?: \"text\" | \"ssml\";\n  speed?: number;\n  language?: string;\n  locale?: string;\n}\n\ninterface WordTimestamp {\n  word: string;\n  start: number;\n  end: number;\n}\n\ninterface TTSResponse {\n  error: null | string;\n  data: {\n    audio_url: string;\n    duration: number;\n    request_id?: string;\n    word_timestamps?: WordTimestamp[];\n  };\n}\n\nasync function textToSpeech(request: TTSRequest): Promise\u003CTTSResponse[\"data\"]> {\n  const response = await fetch(\n    \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech\",\n    {\n      method: \"POST\",\n      headers: {\n        \"X-Api-Key\": process.env.HEYGEN_API_KEY!,\n        \"Content-Type\": \"application\u002Fjson\",\n      },\n      body: JSON.stringify(request),\n    }\n  );\n\n  const json: TTSResponse = await response.json();\n\n  if (json.error) {\n    throw new Error(json.error);\n  }\n\n  return json.data;\n}\n```\n\n### Python\n\n```python\nimport requests\nimport os\n\ndef text_to_speech(\n    text: str,\n    voice_id: str,\n    input_type: str = \"text\",\n    speed: float = 1.0,\n    language: str | None = None,\n    locale: str | None = None,\n) -> dict:\n    payload = {\n        \"text\": text,\n        \"voice_id\": voice_id,\n        \"speed\": speed,\n    }\n\n    if input_type != \"text\":\n        payload[\"input_type\"] = input_type\n\n    if language:\n        payload[\"language\"] = language\n\n    if locale:\n        payload[\"locale\"] = locale\n\n    response = requests.post(\n        \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech\",\n        headers={\n            \"X-Api-Key\": os.environ[\"HEYGEN_API_KEY\"],\n            \"Content-Type\": \"application\u002Fjson\",\n        },\n        json=payload,\n    )\n\n    data = response.json()\n    if data.get(\"error\"):\n        raise Exception(data[\"error\"])\n\n    return data[\"data\"]\n```\n\n### Response Format\n\n```json\n{\n  \"error\": null,\n  \"data\": {\n    \"audio_url\": \"https:\u002F\u002Fresource2.heygen.ai\u002Ftext_to_speech\u002F...\u002Fid=365d46bb.wav\",\n    \"duration\": 5.526,\n    \"request_id\": \"p38QJ52hfgNlsYKZZmd9\",\n    \"word_timestamps\": [\n      { \"word\": \"\u003Cstart>\", \"start\": 0.0, \"end\": 0.0 },\n      { \"word\": \"Hey\", \"start\": 0.079, \"end\": 0.219 },\n      { \"word\": \"there,\", \"start\": 0.239, \"end\": 0.459 },\n      { \"word\": \"\u003Cend>\", \"start\": 5.526, \"end\": 5.526 }\n    ]\n  }\n}\n```\n\n## Usage Examples\n\n### Basic TTS\n\n```typescript\nconst result = await textToSpeech({\n  text: \"Welcome to our quarterly earnings call.\",\n  voice_id: \"YOUR_VOICE_ID\",\n});\n\nconsole.log(`Audio URL: ${result.audio_url}`);\nconsole.log(`Duration: ${result.duration}s`);\n```\n\n### With Speed Adjustment\n\n```typescript\nconst result = await textToSpeech({\n  text: \"We're thrilled to announce our newest feature!\",\n  voice_id: \"YOUR_VOICE_ID\",\n  speed: 1.1,\n});\n```\n\n### With Language and Locale for Multilingual Voices\n\n```typescript\nconst result = await textToSpeech({\n  text: \"Bem-vindo ao nosso produto.\",\n  voice_id: \"MULTILINGUAL_VOICE_ID\",\n  language: \"pt\",\n  locale: \"pt-BR\",\n});\n```\n\n### With SSML Input\n\n```typescript\nconst result = await textToSpeech({\n  text: '\u003Cspeak>Hello \u003Cbreak time=\"1s\"\u002F> and welcome!\u003C\u002Fspeak>',\n  voice_id: \"YOUR_VOICE_ID\",\n  input_type: \"ssml\",\n});\n```\n\n### Find a Voice and Generate Audio\n\n```typescript\nasync function generateSpeech(text: string, language: string): Promise\u003Cstring> {\n  const voices = await listTTSVoices();\n  const voice = voices.find(\n    (v) => v.language.toLowerCase().includes(language.toLowerCase())\n  );\n\n  if (!voice) {\n    throw new Error(`No TTS voice found for language: ${language}`);\n  }\n\n  const result = await textToSpeech({\n    text,\n    voice_id: voice.voice_id,\n  });\n\n  return result.audio_url;\n}\n\nconst audioUrl = await generateSpeech(\"Hello and welcome!\", \"english\");\n```\n\n## Pauses with Break Tags\n\nUse SSML-style break tags in your text for pauses:\n\n```\nword \u003Cbreak time=\"1s\"\u002F> word\n```\n\nRules:\n- Use seconds with `s` suffix: `\u003Cbreak time=\"1.5s\"\u002F>`\n- Must have spaces before and after the tag\n- Self-closing tag format\n\nWith v3, you can also use `input_type: \"ssml\"` for full SSML support, allowing richer markup beyond just break tags:\n\n```json\n{\n  \"text\": \"\u003Cspeak>Welcome! \u003Cbreak time=\\\"1s\\\"\u002F> Let's get started.\u003C\u002Fspeak>\",\n  \"voice_id\": \"YOUR_VOICE_ID\",\n  \"input_type\": \"ssml\"\n}\n```\n\n## Best Practices\n\n1. **Use `GET \u002Fv3\u002Fvoices?engine=starfish`** to find compatible voices — the unified `\u002Fv3\u002Fvoices` endpoint serves all voice types, so the `engine=starfish` filter is essential for TTS\n2. **Check `support_locale`** before setting a `locale` — only multilingual voices support locale selection\n3. **Keep speed between 0.8-1.2** for natural-sounding output\n4. **Preview voices** using the `preview_audio_url` before generating (may be null for some voices)\n5. **Use `word_timestamps`** in the response for caption syncing or timed text overlays\n6. **Use SSML break tags** in your text for pauses: `word \u003Cbreak time=\"1s\"\u002F> word`\n7. **Use `input_type: \"ssml\"`** when you need full SSML markup control beyond simple break tags\n8. **Paginate voice listing** — the v3 endpoint returns paginated results; use `has_more` and `next_token` to fetch all voices\n","# Text-to-Speech (HeyGen Starfish)\n\nGenerate speech audio files from text using HeyGen's in-house Starfish TTS model via the v3 API. This skill is for standalone audio generation — separate from video creation.\n\n## Authentication\n\nAll requests require the `X-Api-Key` header. Set the `HEYGEN_API_KEY` environment variable.\n\n```bash\ncurl -X GET \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices?engine=starfish\" \\\n  -H \"X-Api-Key: $HEYGEN_API_KEY\"\n```\n\n## Tool Selection\n\nIf HeyGen MCP tools are available (`mcp__heygen__*`), **prefer them** over direct HTTP API calls.\n\n| Task | MCP Tool | Fallback (Direct API) |\n|------|----------|----------------------|\n| List TTS voices | `mcp__heygen__list_audio_voices` | `GET \u002Fv3\u002Fvoices?engine=starfish` |\n| Generate speech audio | `mcp__heygen__text_to_speech` | `POST \u002Fv3\u002Fvoices\u002Fspeech` |\n\n## Default Workflow\n\n1. List voices with `mcp__heygen__list_audio_voices` (or `GET \u002Fv3\u002Fvoices?engine=starfish`)\n2. Pick a voice matching desired language, gender, and features\n3. Call `mcp__heygen__text_to_speech` (or `POST \u002Fv3\u002Fvoices\u002Fspeech`) with text and voice_id\n4. Use the returned `audio_url` to download or play the audio\n\n## List TTS Voices\n\nRetrieve voices compatible with the Starfish TTS model.\n\n> **Note:** This uses the unified `GET \u002Fv3\u002Fvoices` endpoint with the `engine=starfish` filter to return only TTS-compatible voices. Not all video voices support Starfish TTS. The response is paginated — use `next_token` to fetch additional pages.\n\n### Query Parameters\n\n| Param | Type | Description |\n|-------|------|-------------|\n| `engine` | string | Filter by engine (use `starfish` for TTS voices) |\n| `type` | string | `public` or `private` |\n| `language` | string | Filter by language |\n| `gender` | string | Filter by gender |\n| `limit` | integer | Results per page, 1-100 |\n| `token` | string | Pagination cursor from `next_token` |\n\n### curl\n\n```bash\ncurl -X GET \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices?engine=starfish\" \\\n  -H \"X-Api-Key: $HEYGEN_API_KEY\"\n```\n\n### TypeScript\n\n```typescript\ninterface AudioVoiceItem {\n  voice_id: string;\n  name: string;\n  language: string;\n  gender: \"female\" | \"male\" | \"unknown\";\n  preview_audio_url: string | null;\n  support_pause: boolean;\n  support_locale: boolean;\n  type: string;\n}\n\ninterface TTSVoicesResponse {\n  error: null | string;\n  data: AudioVoiceItem[];\n  has_more: boolean;\n  next_token: string | null;\n}\n\nasync function listTTSVoices(): Promise\u003CAudioVoiceItem[]> {\n  const allVoices: AudioVoiceItem[] = [];\n  let token: string | null = null;\n\n  do {\n    const url = new URL(\"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\");\n    url.searchParams.set(\"engine\", \"starfish\");\n    if (token) url.searchParams.set(\"token\", token);\n\n    const response = await fetch(url.toString(), {\n      headers: { \"X-Api-Key\": process.env.HEYGEN_API_KEY! },\n    });\n\n    const json: TTSVoicesResponse = await response.json();\n\n    if (json.error) {\n      throw new Error(json.error);\n    }\n\n    allVoices.push(...json.data);\n    token = json.next_token;\n  } while (token);\n\n  return allVoices;\n}\n```\n\n### Python\n\n```python\nimport requests\nimport os\n\ndef list_tts_voices() -> list:\n    all_voices = []\n    token = None\n\n    while True:\n        params = {\"engine\": \"starfish\"}\n        if token:\n            params[\"token\"] = token\n\n        response = requests.get(\n            \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\",\n            headers={\"X-Api-Key\": os.environ[\"HEYGEN_API_KEY\"]},\n            params=params,\n        )\n\n        data = response.json()\n        if data.get(\"error\"):\n            raise Exception(data[\"error\"])\n\n        all_voices.extend(data[\"data\"])\n\n        if not data.get(\"has_more\"):\n            break\n        token = data.get(\"next_token\")\n\n    return all_voices\n```\n\n### Response Format\n\n```json\n{\n  \"error\": null,\n  \"data\": [\n    {\n      \"voice_id\": \"f38a635bee7a4d1f9b0a654a31d050d2\",\n      \"name\": \"Chill Brian\",\n      \"language\": \"English\",\n      \"gender\": \"male\",\n      \"preview_audio_url\": \"https:\u002F\u002Fresource.heygen.ai\u002Ftext_to_speech\u002FWpSDQvmLGXEqXZVZQiVeg6.mp3\",\n      \"support_pause\": true,\n      \"support_locale\": false,\n      \"type\": \"public\"\n    }\n  ],\n  \"has_more\": false,\n  \"next_token\": null\n}\n```\n\n## Generate Speech Audio\n\nConvert text to speech audio using a specified voice.\n\n### Endpoint\n\n`POST https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech`\n\n### Request Fields\n\n| Field | Type | Req | Description |\n|-------|------|:---:|-------------|\n| `text` | string | Y | Text content to convert (1-5000 characters) |\n| `voice_id` | string | Y | Voice ID from `GET \u002Fv3\u002Fvoices?engine=starfish` |\n| `input_type` | string | | `\"text\"` (default) or `\"ssml\"` for full SSML markup |\n| `speed` | number | | Speech speed, 0.5-2.0 (default: 1.0) |\n| `language` | string | | Base language code (e.g., `\"en\"`, `\"pt\"`). Auto-detected if omitted |\n| `locale` | string | | BCP-47 locale for multilingual voices (e.g., `\"en-US\"`, `\"pt-BR\"`) |\n\n### curl\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech\" \\\n  -H \"X-Api-Key: $HEYGEN_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"text\": \"Hello! Welcome to our product demo.\",\n    \"voice_id\": \"YOUR_VOICE_ID\",\n    \"speed\": 1.0\n  }'\n```\n\n### TypeScript\n\n```typescript\ninterface TTSRequest {\n  text: string;\n  voice_id: string;\n  input_type?: \"text\" | \"ssml\";\n  speed?: number;\n  language?: string;\n  locale?: string;\n}\n\ninterface WordTimestamp {\n  word: string;\n  start: number;\n  end: number;\n}\n\ninterface TTSResponse {\n  error: null | string;\n  data: {\n    audio_url: string;\n    duration: number;\n    request_id?: string;\n    word_timestamps?: WordTimestamp[];\n  };\n}\n\nasync function textToSpeech(request: TTSRequest): Promise\u003CTTSResponse[\"data\"]> {\n  const response = await fetch(\n    \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech\",\n    {\n      method: \"POST\",\n      headers: {\n        \"X-Api-Key\": process.env.HEYGEN_API_KEY!,\n        \"Content-Type\": \"application\u002Fjson\",\n      },\n      body: JSON.stringify(request),\n    }\n  );\n\n  const json: TTSResponse = await response.json();\n\n  if (json.error) {\n    throw new Error(json.error);\n  }\n\n  return json.data;\n}\n```\n\n### Python\n\n```python\nimport requests\nimport os\n\ndef text_to_speech(\n    text: str,\n    voice_id: str,\n    input_type: str = \"text\",\n    speed: float = 1.0,\n    language: str | None = None,\n    locale: str | None = None,\n) -> dict:\n    payload = {\n        \"text\": text,\n        \"voice_id\": voice_id,\n        \"speed\": speed,\n    }\n\n    if input_type != \"text\":\n        payload[\"input_type\"] = input_type\n\n    if language:\n        payload[\"language\"] = language\n\n    if locale:\n        payload[\"locale\"] = locale\n\n    response = requests.post(\n        \"https:\u002F\u002Fapi.heygen.com\u002Fv3\u002Fvoices\u002Fspeech\",\n        headers={\n            \"X-Api-Key\": os.environ[\"HEYGEN_API_KEY\"],\n            \"Content-Type\": \"application\u002Fjson\",\n        },\n        json=payload,\n    )\n\n    data = response.json()\n    if data.get(\"error\"):\n        raise Exception(data[\"error\"])\n\n    return data[\"data\"]\n```\n\n### Response Format\n\n```json\n{\n  \"error\": null,\n  \"data\": {\n    \"audio_url\": \"https:\u002F\u002Fresource2.heygen.ai\u002Ftext_to_speech\u002F...\u002Fid=365d46bb.wav\",\n    \"duration\": 5.526,\n    \"request_id\": \"p38QJ52hfgNlsYKZZmd9\",\n    \"word_timestamps\": [\n      { \"word\": \"\u003Cstart>\", \"start\": 0.0, \"end\": 0.0 },\n      { \"word\": \"Hey\", \"start\": 0.079, \"end\": 0.219 },\n      { \"word\": \"there,\", \"start\": 0.239, \"end\": 0.459 },\n      { \"word\": \"\u003Cend>\", \"start\": 5.526, \"end\": 5.526 }\n    ]\n  }\n}\n```\n\n## Usage Examples\n\n### Basic TTS\n\n```typescript\nconst result = await textToSpeech({\n  text: \"Welcome to our quarterly earnings call.\",\n  voice_id: \"YOUR_VOICE_ID\",\n});\n\nconsole.log(`Audio URL: ${result.audio_url}`);\nconsole.log(`Duration: ${result.duration}s`);\n```\n\n### With Speed Adjustment\n\n```typescript\nconst result = await textToSpeech({\n  text: \"We're thrilled to announce our newest feature!\",\n  voice_id: \"YOUR_VOICE_ID\",\n  speed: 1.1,\n});\n```\n\n### With Language and Locale for Multilingual Voices\n\n```typescript\nconst result = await textToSpeech({\n  text: \"Bem-vindo ao nosso produto.\",\n  voice_id: \"MULTILINGUAL_VOICE_ID\",\n  language: \"pt\",\n  locale: \"pt-BR\",\n});\n```\n\n### With SSML Input\n\n```typescript\nconst result = await textToSpeech({\n  text: '\u003Cspeak>Hello \u003Cbreak time=\"1s\"\u002F> and welcome!\u003C\u002Fspeak>',\n  voice_id: \"YOUR_VOICE_ID\",\n  input_type: \"ssml\",\n});\n```\n\n### Find a Voice and Generate Audio\n\n```typescript\nasync function generateSpeech(text: string, language: string): Promise\u003Cstring> {\n  const voices = await listTTSVoices();\n  const voice = voices.find(\n    (v) => v.language.toLowerCase().includes(language.toLowerCase())\n  );\n\n  if (!voice) {\n    throw new Error(`No TTS voice found for language: ${language}`);\n  }\n\n  const result = await textToSpeech({\n    text,\n    voice_id: voice.voice_id,\n  });\n\n  return result.audio_url;\n}\n\nconst audioUrl = await generateSpeech(\"Hello and welcome!\", \"english\");\n```\n\n## Pauses with Break Tags\n\nUse SSML-style break tags in your text for pauses:\n\n```\nword \u003Cbreak time=\"1s\"\u002F> word\n```\n\nRules:\n- Use seconds with `s` suffix: `\u003Cbreak time=\"1.5s\"\u002F>`\n- Must have spaces before and after the tag\n- Self-closing tag format\n\nWith v3, you can also use `input_type: \"ssml\"` for full SSML support, allowing richer markup beyond just break tags:\n\n```json\n{\n  \"text\": \"\u003Cspeak>Welcome! \u003Cbreak time=\\\"1s\\\"\u002F> Let's get started.\u003C\u002Fspeak>\",\n  \"voice_id\": \"YOUR_VOICE_ID\",\n  \"input_type\": \"ssml\"\n}\n```\n\n## Best Practices\n\n1. **Use `GET \u002Fv3\u002Fvoices?engine=starfish`** to find compatible voices — the unified `\u002Fv3\u002Fvoices` endpoint serves all voice types, so the `engine=starfish` filter is essential for TTS\n2. **Check `support_locale`** before setting a `locale` — only multilingual voices support locale selection\n3. **Keep speed between 0.8-1.2** for natural-sounding output\n4. **Preview voices** using the `preview_audio_url` before generating (may be null for some voices)\n5. **Use `word_timestamps`** in the response for caption syncing or timed text overlays\n6. **Use SSML break tags** in your text for pauses: `word \u003Cbreak time=\"1s\"\u002F> word`\n7. **Use `input_type: \"ssml\"`** when you need full SSML markup control beyond simple break tags\n8. **Paginate voice listing** — the v3 endpoint returns paginated results; use `has_more` and `next_token` to fetch all voices\n",{"name":5,"metadata":24,"description":29,"allowed-tools":30},{"openclaw":25},{"requires":26,"primaryEnv":28},{"env":27},[28],"HEYGEN_API_KEY","Generate speech audio from text using HeyGen's Starfish TTS model. Use when: (1) Generating standalone speech audio files from text, (2) Converting text to speech with voice selection and speed control, (3) Creating audio for voiceovers, narration, or podcasts, (4) Working with HeyGen's \u002Fv3\u002Fvoices endpoints, (5) Listing available TTS voices by language or gender.\n","mcp__heygen__*","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Ft\u002Ftext-to-speech-heygen",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill text-to-speech",{"tool":46,"command":47},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill text-to-speech",{"tool":49,"command":50},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill text-to-speech","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ft\u002Ftext-to-speech-heygen\u002FSKILL.md",true,[],[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]