Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/elevenlabs-hello-world

@0d57af8
Run it yourself

Generate your first ElevenLabs text-to-speech audio file. Use when starting a new ElevenLabs integration, testing your setup, or learning basic TTS API patterns before wiring voice into a real app. Trigger with "elevenlabs hello world", "elevenlabs example", "elevenlabs quick start", "first elevenlabs TTS", "text to speech demo".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/elevenlabs-hello-world

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesimplementation.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

ElevenLabs Hello World — Full Implementation

Deep walkthrough for every generation path: the SDK (TypeScript and Python), the raw REST API via cURL, and low-latency streaming. Each block is standalone — copy the one that matches your stack.

Step 1: Text-to-Speech with the SDK

TypeScript (recommended):

import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { createWriteStream } from "fs";
import { Readable } from "stream";
import { pipeline } from "stream/promises";

const client = new ElevenLabsClient();

async function generateSpeech() {
  // Use a pre-made voice — "Rachel" is a default voice available on all accounts
  // Find voice IDs via: GET /v1/voices
  const audio = await client.textToSpeech.convert("21m00Tcm4TlvDq8ikWAM", {
    text: "Hello! This is your first ElevenLabs text-to-speech generation.",
    model_id: "eleven_multilingual_v2",  // Best quality, 29 languages
    voice_settings: {
      stability: 0.5,           // 0-1: lower = more expressive
      similarity_boost: 0.75,   // 0-1: higher = closer to original voice
      style: 0.0,               // 0-1: higher = more dramatic (costs more latency)
      speed: 1.0,               // 0.7-1.2: speech speed multiplier
    },
  });

  // audio is a ReadableStream — pipe to file
  await pipeline(
    Readable.fromWeb(audio as any),
    createWriteStream("output.mp3")
  );

  console.log("Audio saved to output.mp3");
}

generateSpeech().catch(console.error);

Python:

from elevenlabs.client import ElevenLabsClient

client = ElevenLabsClient()

audio = client.text_to_speech.convert(
    voice_id="21m00Tcm4TlvDq8ikWAM",  # Rachel
    text="Hello! This is your first ElevenLabs text-to-speech generation.",
    model_id="eleven_multilingual_v2",
    voice_settings={
        "stability": 0.5,
        "similarity_boost": 0.75,
        "style": 0.0,
    },
)

with open("output.mp3", "wb") as f:
    for chunk in audio:
        f.write(chunk)

print("Audio saved to output.mp3")

Step 2: Using cURL (Raw REST API)

curl -X POST "https://api.elevenlabs.io/v1/text-to-speech/21m00Tcm4TlvDq8ikWAM" \
  -H "xi-api-key: ${ELEVENLABS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello from the ElevenLabs API!",
    "model_id": "eleven_multilingual_v2",
    "voice_settings": {
      "stability": 0.5,
      "similarity_boost": 0.75
    }
  }' \
  --output output.mp3

Step 3: Streaming TTS (Low Latency)

For real-time playback, use the streaming endpoint:

async function streamSpeech() {
  const audioStream = await client.textToSpeech.stream("21m00Tcm4TlvDq8ikWAM", {
    text: "This audio is streamed in real-time for low-latency playback.",
    model_id: "eleven_flash_v2_5",  // Optimized for streaming (~75ms latency)
    output_format: "mp3_22050_32",  // codec_sampleRate_bitrate
  });

  // Stream chunks arrive as they're generated
  const writer = createWriteStream("streamed.mp3");
  for await (const chunk of audioStream) {
    writer.write(chunk);
  }
  writer.end();
  console.log("Streamed audio saved to streamed.mp3");
}

Available Models

Model ID Quality Latency Languages Cost (credits/char)
eleven_v3 Highest expressiveness Medium 70+ 1.0
eleven_multilingual_v2 High quality, emotional Medium 29 1.0
eleven_flash_v2_5 Good, ultra-fast ~75ms 32 0.5
eleven_turbo_v2_5 Good, fast Low 32 0.5
eleven_monolingual_v1 English only Low 1 0.5

Common Default Voice IDs

Voice ID Style
Rachel 21m00Tcm4TlvDq8ikWAM Calm, narration
Domi AZnzlk1XvdvUeBnXmlld Strong, assertive
Bella EXAVITQu4vr4xnSDxMaL Soft, warm
Antoni ErXwobaYiN019PkySvjV Well-rounded, male
Josh TxGEqnHWrfWFTfGW9XjX Deep, narrative

Output Formats

Specified as codec_sampleRate_bitrate:

  • mp3_44100_128 (default, high quality)
  • mp3_22050_32 (smaller file, streaming)
  • pcm_16000 (raw PCM for processing)
  • pcm_44100 (high-quality raw)
  • ulaw_8000 (telephony)

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides a standard 'Hello World' implementation for generating audio via the ElevenLabs Text-to-Speech API. It includes examples for TypeScript, Python, and cURL. The skill follows security best practices by using environment variables for API keys and utilizing official SDKs. No malicious patterns were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files Runs commands
version
1.6.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "voice",
  "ai",
  "elevenlabs",
  "tts",
  "audio"
]
All 4 allowed tools
ReadWriteBash(npm:*)Bash(node:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/elevenlabs-hello-world