| name | elevenlabs-hello-world |
| description | 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".
|
| allowed-tools | Read, Write, Bash(npm:*), Bash(node:*) |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","voice","ai","elevenlabs","tts","audio"] |
| compatibility | Designed for Claude Code |
ElevenLabs Hello World
Overview
Generate speech from text using the ElevenLabs TTS API. This skill covers the
core POST /v1/text-to-speech/<voice-id> endpoint with real voice IDs, model
selection, and audio output. Start from the minimal SDK call below, then drill
into the full implementation for the cURL,
streaming, and multi-language paths.
Prerequisites
- Completed the
elevenlabs-install-auth setup skill so the SDK is installed.
- A valid API key exported as
ELEVENLABS_API_KEY in your shell environment.
- Node 20+ (for the TypeScript SDK path) or Python 3.9+ (for the Python path).
Instructions
The whole workflow is one API call: pick a voice ID, pick a model, send text,
write the returned audio stream to a file. The minimal TypeScript path:
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { createWriteStream } from "fs";
import { Readable } from "stream";
import { pipeline } from "stream/promises";
const client = new ElevenLabsClient();
const audio = await client.textToSpeech.convert("21m00Tcm4TlvDq8ikWAM", {
text: "Hello! This is your first ElevenLabs text-to-speech generation.",
model_id: "eleven_multilingual_v2",
});
await pipeline(Readable.fromWeb(audio as any), createWriteStream());