text-to-speech
This skill converts text to speech using ElevenLabs API, supporting 90+ languages and multiple models optimized for quality or latency.
Identity proven by GitHub's verified organisation badge (elevenlabs)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- MIT (permissive)
- Pin
- 1d08a4apinned Oct 9, 2026
- Context cost
- about 2,100 tokenswhen the skill loads
- GitHub stars
- 482on elevenlabs/skills
- Scripts
- None found
What it does
“Convert text to speech using ElevenLabs voice AI. Use when generating audio from text, creating voiceovers, building voice apps, or synthesizing speech in 90+ languages.”
Generated summary from the skill's own text
This skill converts text to speech using ElevenLabs API, supporting 90+ languages and multiple models optimized for quality or latency. It provides voice synthesis in Python, JavaScript, and CLI, with options for voice customization, streaming output, and various audio formats including MP3, PCM, Opus, and formats for telephony systems.
When to use it
- Building voice applications or interactive agents requiring speech synthesis
- Generating audio content, voiceovers, or narration in multiple languages
- Creating real-time voice interactions with low-latency requirements
- Synthesizing speech for accessibility, dialogue systems, or phone integrations
When not to
- Offline operation or environments without internet access to ElevenLabs service
- Projects requiring voice cloning without API access to custom voice creation tools
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add elevenlabs/skills --skill text-to-speechInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install elevenlabs/skills text-to-speech@1d08a4a250cff67cc8056ec31587c031ecb06d2fInstalls the commit we checked (1d08a4a).
Copy by hand
Download the folder at 1d08a4a and put it in .claude/skills/text-to-speech for Claude Code and in .agents/skills/text-to-speech for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "text-to-speech" by ElevenLabs. Source, pinned to commit 1d08a4a250cff67cc8056ec31587c031ecb06d2f: https://github.com/elevenlabs/skills/tree/1d08a4a250cff67cc8056ec31587c031ecb06d2f/text-to-speech 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/text-to-speech/ for Claude Code and .agents/skills/text-to-speech/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/elevenlabs/text-to-speech
SKILL.md at the pin
---
name: text-to-speech
description: Convert text to speech using ElevenLabs voice AI. Use when generating audio from text, creating voiceovers, building voice apps, or synthesizing speech in 90+ languages.
license: MIT
compatibility: Requires internet access and an ElevenLabs API key (ELEVENLABS_API_KEY).
metadata: {"openclaw": {"requires": {"env": ["ELEVENLABS_API_KEY"]}, "primaryEnv": "ELEVENLABS_API_KEY"}}
---
# ElevenLabs Text-to-Speech
Generate natural speech from text - supports 90+ languages, multiple models for quality vs latency tradeoffs. Examples default to `eleven_v4`, the latest and highest-quality model.
> **Setup:** See [Installation Guide](references/installation.md). For JavaScript, use `@elevenlabs/*` packages only.
## Quick Start
### Python
```python
from elevenlabs import ElevenLabs
client = ElevenLabs()
audio = client.text_to_speech.convert(
text="Hello, welcome to ElevenLabs!",
voice_id="JBFqnCBsd6RMkjVDRZzb", # George
model_id="eleven_v4"
)
with open("output.mp3", "wb") as f:
for chunk in audio:
f.write(chunk)
```
### JavaScript
```javascript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { createWriteStream } from "fs";
import { Readable } from "stream";
const client = new ElevenLabsClient();
const audio = await client.textToSpeech.convert("JBFqnCBsd6RMkjVDRZzb", {
text: "Hello, welcome to ElevenLabs!",
modelId: "eleven_v4",
});
// convert() returns a web ReadableStream — bridge it to a Node stream to write to disk
Readable.fromWeb(audio).pipe(createWriteStream("output.mp3"));
```
### CLI
Use `say` to play text immediately with the default voice and `eleven_v3` model:
```bash
elevenlabs say "Hello!"
```
Pipe text into `say` when another command produces the input:
```bash
echo "The build finished successfully." | elevenlabs say
```
Use the API command when you need to set request parameters directly:
```bash
elevenlabs text-to-speech convert --voice-id JBFqnCBsd6RMkjVDRZzb \
--text "Hello!" --model-id eleven_v4 --output output.mp3
```
The CLI reads `ELEVENLABS_API_KEY` from the environment automatically.
## Models
| Model ID | Languages | Latency | Best For |
|----------|-----------|---------|----------|
| `eleven_v4` | 90+ | Standard | **Default.** Highest quality, emotional range, audio tags, voice cloning accuracy |
| `eleven_v4_turbo` | 90+ | ~100ms | Real-time v4 quality for agents and interactive apps (via [Text to Dialogue WebSocket](references/streaming.md#eleven-v4-turbo-websocket)) |
| `eleven_flash_v2_5` | 32 | ~75ms | Lowest latency, lowest cost, `stream-input` WebSocket |
| `eleven_flash_v2` | English | ~75ms | English-only, lowest latency |
| `eleven_multilingual_v2` | 29 | Standard | Previous generation; most stable on very long-form generations |
| `eleven_v3` | 70+ | Standard | Previous generation expressive model |
`eleven_turbo_v2_5` and `eleven_turbo_v2` are superseded by the Flash models (same output, lower latency) — use `eleven_flash_v2_5` / `eleven_flash_v2` instead.
**Eleven v4 notes:** supports only `stability` and `similarity_boost` voice settings (no `style` or `speed`), does not support SSML, and is not available on the `stream-input` TTS WebSocket. Direct delivery with audio tags such as `[whispers]`, `[laughs]`, `[sarcastic]`.
## Voice IDs
Use pre-made voices or create custom voices in the dashboard.
**Popular voices:**
- `JBFqnCBsd6RMkjVDRZzb` - George (male, narrative)
- `EXAVITQu4vr4xnSDxMaL` - Sarah (female, soft)
- `onwK4e9ZLuTAKqWW03F9` - Daniel (male, authoritative)
- `XB0fDUnXU5powFXDhCwa` - Charlotte (female, conversational)
```python
voices = client.voices.get_all()
for voice in voices.voices:
print(f"{voice.voice_id}: {voice.name}")
```
## Voice Settings
Fine-tune how the voice sounds:
- **Stability**: How consistent the voice stays. Lower values = more emotional range and variation, but can sound unstable. Higher = steady, predictable delivery.
- **Similarity boost**: How closely to match the original voice sample. Higher values sound more like the original but may amplify audio artifacts.
- **Style**: Exaggerates the voice's unique style characteristics (v2/v3 models; not supported on Eleven v4).
- **Speed**: Speech speed multiplier (v2/v3 models; not supported on Eleven v4).
- **Speaker boost**: Post-processing that enhances clarity and voice similarity.
```python
from elevenlabs import VoiceSettings
audio = client.text_to_speech.convert(
text="Customize my voice settings.",
voice_id="JBFqnCBsd6RMkjVDRZzb",
model_id="eleven_v4",
voice_settings=VoiceSettings(
stability=0.5, # Lower = more expressive, higher = more consistent
similarity_boost=0.75, # Higher = closer to the reference voice
)
)
```
## Language Selection
Use `language_code` with models that support language enforcement to guide pronunciation and text normalization. Unsupported language codes are ignored, and `language_code` is not supported on `eleven_multilingual_v2`.
```python
audio = client.text_to_speech.convert(
text="Bonjour, comment allez-vous?",
voice_id="JBFqnCBsd6RMkjVDRZzb",
model_id="eleven_v4",
language_code="fr" # ISO 639-1 code
)
```
## Text Normalization
Controls how numbers, dates, and abbreviations are converted to spoken words. For example, "01/15/2026" becomes "January fifteenth, twenty twenty-six":
- `"auto"` (default): Model decides based on context
- `"on"`: Always normalize (use when you want natural speech)
- `"off"`: Speak literally (use when you want "zero one slash one five...")
```python
audio = client.text_to_speech.convert(
text="Call 1-800-555-0123 on 01/15/2026",
voice_id="JBFqnCBsd6RMkjVDRZzb",
model_id="eleven_v4",
apply_text_normalization="on"
)
```
## Request Stitching
When generating long audio in multiple requests, the audio can have pops, unnatural pauses, or tone shifts at the boundaries. Request stitching solves this by letting each request know what comes before/after it:
```python
# First request
audio1 = client.text_to_speech.convert(
text="This is the first part.",
voice_id="JBFqnCBsd6RMkjVDRZzb",
model_id="eleven_v4",
next_text="And this continues the story."
)
# Second request using previous context
audio2 = client.text_to_speech.convert(
text="And this continues the story.",
voice_id="JBFqnCBsd6RMkjVDRZzb",
model_id="eleven_v4",
previous_text="This is the first part."
)
```
## Output Formats
| Format | Description |
|--------|-------------|
| `mp3_44100_128` | MP3 44.1kHz 128kbps (default) - compressed, good for web/apps |
| `mp3_44100_192` | MP3 44.1kHz 192kbps (Creator+) - higher quality compressed |
| `mp3_44100_64` | MP3 44.1kHz 64kbps - lower quality, smaller files |
| `mp3_22050_32` | MP3 22.05kHz 32kbps - smallest MP3 files |
| `pcm_16000` | Raw PCM 16kHz - use for real-time processing |
| `pcm_22050` | Raw PCM 22.05kHz |
| `pcm_24000` | Raw PCM 24kHz - good balance for streaming |
| `pcm_44100` | Raw PCM 44.1kHz (Pro+) - CD quality |
| `pcm_48000` | Raw PCM 48kHz (Pro+) - highest quality |
| `ulaw_8000` | μ-law 8kHz - standard for phone systems (Twilio, telephony) |
| `alaw_8000` | A-law 8kHz - telephony (alternative to μ-law) |
| `opus_48000_64` | Opus 48kHz 64kbps - efficient streaming codec |
| `wav_44100` | WAV 44.1kHz - uncompressed with headers |
## Streaming
Use the `stream` method to receive audio chunks as they're generated:
```python
audio_stream = client.text_to_speech.stream(
text="This text will be streamed as audio.",
voice_id="JBFqnCBsd6RMkjVDRZzb",
model_id="eleven_v4"
)
for chunk in audio_stream:
play_audio(chunk)
```
For real-time apps where latency matters most, use `eleven_v4_turbo` (~100ms) over the Text to Dialogue WebSocket, or `eleven_flash_v2_5` (~75ms) over HTTP streaming or the `stream-input` WebSocket. See [references/streaming.md](references/streaming.md).
## Error Handling
```python
try:
audio = client.text_to_speech.convert(
text="Generate speech",
voice_id="invalid-voice-id",
model_id="eleven_v4"
)
except Exception as e:
print(f"API error: {e}")
```
Common errors:
- **401**: Invalid API key
- **422**: Invalid parameters (check voice_id, model_id)
- **429**: Rate limit exceeded
## Tracking Costs
Monitor character usage via response headers (`x-character-count`, `request-id`):
```python
response = client.text_to_speech.convert.with_raw_response(
text="Hello!", voice_id="JBFqnCBsd6RMkjVDRZzb", model_id="eleven_v4"
)
audio = response.parse()
print(f"Characters used: {response.headers.get('x-character-count')}")
```
## References
- [Installation Guide](references/installation.md)
- [Streaming Audio](references/streaming.md)
- [Voice Settings](references/voice-settings.md)
From elevenlabs/skills at 1d08a4a, shown as plain text under its license: MIT (permissive). The license text is in text-to-speech/SKILL.md.
View SKILL.md on GitHub at 1d08a4aFiles
- SKILL.md8.8 KB · d2bd023ee5bb
- references/
- installation.md2.7 KB · 16be286684b4
- streaming.md13 KB · 226a078a275b
- voice-settings.md3.7 KB · cc0d3cc89a15
4 files, 28 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 1d08a4aAlso in
The same SKILL.md content appears in these places too. We list it once and credit the oldest public source.
More from ElevenLabs
agents
Build voice AI agents with natural conversation capabilities using ElevenLabs platform.
Contains scripts
Claude Code, Codex, Cursor +3 · about 6.4K tokens · pinned 6 days ago
dubbing
This skill dubs audio and video into other languages using ElevenLabs' Dubbing API, preserving original speakers' voices.
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.1K tokens · pinned 6 days ago
music
This skill generates music from text prompts using the ElevenLabs Music API, supporting instrumental tracks, songs with lyrics, and fine-grained control…
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.3K tokens · pinned 6 days ago
setup-api-key
This skill guides users through obtaining and configuring an ElevenLabs API key for text-to-speech integrations.
Claude Code, Codex, Cursor +4 · about 840 tokens · pinned 6 days ago
sound-effects
This skill generates sound effects from text descriptions using ElevenLabs API, supporting various audio formats, custom durations up to 30 seconds, looping…
Contains scripts
Claude Code, Codex, Cursor +3 · about 830 tokens · pinned 6 days ago
speech-engine
This skill integrates ElevenLabs Speech Engine to add real-time voice conversations to custom agent runtimes.
Claude Code, Codex, Cursor +4 · about 2.4K tokens · pinned 6 days ago
Related in Media and creative
speech-to-text
Transcribe audio and video files to text using ElevenLabs Scribe v2, supporting 90+ languages, speaker identification, and word-level timestamps.
by ElevenLabsOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 2.4K tokens · pinned 6 days ago
voice-changer
Converts the voice in an audio recording to a different target voice using ElevenLabs Speech-to-Speech API, preserving emotion, timing, and delivery.
by ElevenLabsOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 2.7K tokens · pinned 6 days ago
voice-isolator
This skill removes background noise and isolates vocals or speech from audio files using the ElevenLabs Voice Isolator API.
by ElevenLabsOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 770 tokens · pinned 6 days ago
creative-studio
This skill enables agents to generate and edit media including voiceovers, images, videos, music, and transcriptions through the ElevenLabs MCP server.
by ElevenLabsOfficial publisher
Claude Code, Codex, Cursor +4 · about 740 tokens · pinned 6 days ago
all-images-ai-automation
This skill automates All Images AI operations by discovering and executing tools through Composio's All Images AI toolkit via Rube MCP.
by ComposioOfficial publisher
Agents not labelled yet · about 710 tokens · pinned 6 days ago
remotion-best-practices
This skill routes the agent through Remotion's specialized knowledge bases for video creation, editing, and deployment.
by RemotionOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 920 tokens · pinned 6 days ago