agentleFS
elevenlabselevenlabs/skills/text-to-speech/SKILL.md

text-to-speech

Skill527 starsChanged 14 days agoMITView on GitHub

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.

  • Reads credentials

We split this skill into the rules it gives an agent

7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use say to play text immediately with the default voice and eleven_v3 model:

    line 53
  2. Distinctive:

    Use the API command when you need to set request parameters directly:

    line 65
  3. Distinctive:

    Use pre-made voices or create custom voices in the dashboard.

    line 91
  4. Very specific:

    Use language_code with models that support language enforcement to guide pronunciation and text normalization.

    line 131
  5. Very specific:

    Use audio_effects to process the generated audio with a filter preset, perceived distance, a reverb environment, a looped background noise …

    line 161
  6. Distinctive:

    When generating long audio in multiple requests, the audio can have pops, unnatural pauses, or tone shifts at the boundaries.

    line 197
  7. Very specific:

    Use the stream method to receive audio chunks as they're generated:

    line 237

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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, before writing any code: if ELEVENLABS_API_KEY isn't set for this project, run npx -y @elevenlabs/cli@latest onboard init from the app's folder first and follow what it prints: it signs the user in and stores a key for the project, so nobody copies one by hand. Otherwise see the Installation Guide. For JavaScript, use @elevenlabs/* packages only.

Quick Start

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

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:

elevenlabs say "Hello!"

Pipe text into say when another command produces the input:

echo "The build finished successfully." | elevenlabs say

Use the API command when you need to set request parameters directly:

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 IDLanguagesLatencyBest For
eleven_v490+StandardDefault. Highest quality, emotional range, audio tags, voice cloning accuracy
eleven_v4_turbo90+~100msReal-time v4 quality for agents and interactive apps (via Text to Dialogue WebSocket)
eleven_flash_v2_532~75msLowest latency, lowest cost, stream-input WebSocket
eleven_flash_v2English~75msEnglish-only, lowest latency
eleven_multilingual_v229StandardPrevious generation; most stable on very long-form generations
eleven_v370+StandardPrevious 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)
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.
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.

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...")
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"
)

Audio Effects

Use audio_effects to process the generated audio with a filter preset, perceived distance, a reverb environment, a looped background noise bed, and stereo panning. Effects do not change the cost of a request.

FieldRangeDescription
filter_preset_idCatalog IDFilter that colors the voice, such as phone or old_radio
distance0-1 (default 0)How far the speaker sounds from the microphone
environment_idCatalog IDReverb environment, such as small_room or hall
send_level0-1 (default 1)How much of the voice feeds the reverb; 0 turns reverb off
background_noise_idCatalog IDBackground noise looped under the voice, such as cafe or keyboard
pan-1 to 1 (default 0)Stereo position of the voice, from hard left to hard right

List valid filter preset, environment, and background noise IDs with the catalog endpoint (GET /v1/audio-effects/catalog):

from elevenlabs import EffectsSpecInput

catalog = client.audio_effects.get_catalog()
for environment in catalog.environments:
    print(f"{environment.environment_id}: {environment.name}")

audio = client.text_to_speech.convert(
    text="Welcome to the concert hall.",
    voice_id="JBFqnCBsd6RMkjVDRZzb",
    model_id="eleven_v4",
    audio_effects=EffectsSpecInput(
        environment_id="hall",
        distance=0.3,
        pan=-0.5,
    )
)

Reverb and non-zero pan produce stereo audio and are rejected for ulaw_*, alaw_*, and pcm_* output formats. Unknown effect IDs return a 404 error.

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:

# 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

FormatDescription
mp3_44100_128MP3 44.1kHz 128kbps (default) - compressed, good for web/apps
mp3_44100_192MP3 44.1kHz 192kbps (Creator+) - higher quality compressed
mp3_44100_64MP3 44.1kHz 64kbps - lower quality, smaller files
mp3_22050_32MP3 22.05kHz 32kbps - smallest MP3 files
pcm_16000Raw PCM 16kHz - use for real-time processing
pcm_22050Raw PCM 22.05kHz
pcm_24000Raw PCM 24kHz - good balance for streaming
pcm_44100Raw PCM 44.1kHz (Pro+) - CD quality
pcm_48000Raw PCM 48kHz (Pro+) - highest quality
ulaw_8000μ-law 8kHz - standard for phone systems (Twilio, telephony)
alaw_8000A-law 8kHz - telephony (alternative to μ-law)
opus_48000_64Opus 48kHz 64kbps - efficient streaming codec
wav_44100WAV 44.1kHz - uncompressed with headers

Streaming

Use the stream method to receive audio chunks as they're generated:

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.

Error Handling

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):

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
  • Streaming Audio
  • Voice Settings

Download now (ZIP)

  • Other versions20 projects use a version of this.

    Word for word · 1

    1. RobStrayer/voice-agent-skills★ 1100% same

    Edited · 5

    1. tadaspetra/loop★ 29674% same
    2. dmccreary/claude-skills★ 11173% same
    3. dmccreary/ibook-skills★ 11173% same
    4. MoizIbnYousaf/marketing-cli★ 3362% same
    5. elevenlabs/plugin★ 399% same

    Wrote their own version · 14

    1. calesthio/OpenMontage★ 74ksame name
    2. wlzh/skills★ 694same name
    3. sarvamai/skills★ 72same name
    4. awesome-genmedia/skills★ 36same name
    5. deepgram/skills★ 26same name
    6. LinHao-city/StoryMind★ 10same name
    7. claude-world/claude-agent★ 5same name
    8. eins78/agent-skills★ 2same name
    9. pjmuller/skills★ 2same name
    10. valtterimelkko/agent-workflow-skills★ 2same name

    4 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use manimce-best-practices, visual-style and 3 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • adithya-s-kSkill

      manimce-best-practices

      Trigger when: (1) User mentions "manim" or "Manim Community" or "ManimCE", (2) Code contains `from manim import *`, (3) User runs `manim` CLI commands, (4) Working with Scene, MathTex, Create(), or ManimCE-specific classes.

      Also in 3 projects that use this

    • MoizIbnYousafSkill

      visual-style

      Build a persistent visual brand identity for image generation. Defines how the brand looks visually — aesthetic, lighting, composition, mood — and writes it to brand/creative-kit.md so /image-gen and other creative skills produce consistent on-brand visuals. Three modes: Extract (from website/URL), Build (interview), Reference (mood board/examples). Use when starting any project that needs images, when the user says "visual style", "brand aesthetic", "image style", "visual identity", "how should our images look", "build visual brand", "define our look", or when /image-gen outputs feel generic because no visual style exists yet.

      Also in 3 projects that use this

    • AnthropicSkill

      data-visualization

      Create effective data visualizations with Python (matplotlib, seaborn, plotly). Use when building charts, choosing the right chart type for a dataset, creating publication-quality figures, or applying design principles like accessibility and color theory.

      Also in 3 projects that use this

    • VercelSkill

      remotion-best-practices

      Best practices for Remotion - Video creation in React

      Also in 4 projects that use this

    • VercelSkill

      web-design-guidelines

      Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

      Also in 3 projects that use this

  • In this repository12 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.