Library
Voice AI · Chapter 2 of 10
Chapter 02

Setting Up ElevenLabs
Like a Professional

Account, dashboard, voices, cloning, API keys, billing and your first working call to the API — in Postman, Python, JavaScript and cURL.

ElevenLabsSetupAPIVoice CloningPostman
A Handbook For Builders
Setting Up ElevenLabs
Like a Professional
Chapter 02
The Claude Code Handbook

Every professional voice engineer has the same first day: an empty ElevenLabs dashboard, a blinking cursor, and a vague idea of what "voice settings" even mean. This chapter turns that empty dashboard into a fully configured production workspace — accounts, cloned voices, API keys stored safely, and four different ways to call the API. By the end you will have generated your first synthetic voice from Postman, Python, JavaScript, and a single cURL line.

Section 1

1. Create Your ElevenLabs Account

  1. Go to elevenlabs.io and click Sign up (top right).
  2. Use a real work email — you will attach billing to it later.
  3. Verify the email link, choose a strong password, enable 2FA in Profile → Security.
  4. Pick the Free plan to start. You get 10,000 characters/month — enough for the whole chapter.
Claude Code — Terminal
Screenshot placeholder
ElevenLabs signup page with the email field focused and the free-plan card highlighted.
Figure — ElevenLabs signup page with the email field focused and the free-plan card highlighted.
Section 2

2. The Dashboard — a Tour

The left rail is the whole product in miniature. Top to bottom: Home, Voices,Speech, Dubbing, Projects, Sound Effects, Conversational AI, and Usage. For voice automation work you will live in Voices,Speech and Conversational AI.

Claude Code — Terminal
Screenshot placeholder
ElevenLabs dashboard with the left navigation expanded and Voices highlighted.
Figure — ElevenLabs dashboard with the left navigation expanded and Voices highlighted.
Section 3

3. Projects — Long-Form Studio

Projects is ElevenLabs' long-form editor: paste a book chapter, assign voices per paragraph, regenerate line-by-line, and export a stitched WAV/MP3. Perfect for audiobooks and podcasts. For real-time voice agents we won't use Projects — we'll call the API directly. Know it exists.

Claude Code — Terminal
Screenshot placeholder
Projects editor showing a paragraph highlighted with a per-line voice dropdown.
Figure — Projects editor showing a paragraph highlighted with a per-line voice dropdown.
Section 4

4. The Voice Library

Two libraries: Default (11 pro voices shipped by ElevenLabs — Rachel, Adam, Antoni, Bella, etc.) and Community (thousands of voices contributed by users). Each voice has a Voice ID — a 20-character string you will paste into your code.

Claude Code — Terminal
Screenshot placeholder
Voice Library grid with default voices, filters for language and gender, and a copy-ID button.
Figure — Voice Library grid with default voices, filters for language and gender, and a copy-ID button.
Section 5

5. Voice Cloning — the Two Tiers

  • Instant Voice Clone (IVC) — 1 minute of audio, ready in 30 seconds, 90% quality.
  • Professional Voice Clone (PVC) — 30+ minutes of studio audio, trained overnight, 99% quality.

6. Instant Voice Clone (IVC)

  1. Record 1–3 minutes of clean audio in WAV or MP3 (16kHz+ mono).
  2. Voices → Add a new voice → Instant Voice Clone.
  3. Upload up to 25 files, name the voice, tick the consent box.
  4. Click Create voice. Wait ~30 seconds. Play the preview.
Claude Code — Terminal
Screenshot placeholder
Instant Voice Clone modal with three WAV files uploaded and the consent checkbox ticked.
Figure — Instant Voice Clone modal with three WAV files uploaded and the consent checkbox ticked.

7. Professional Voice Clone (PVC)

PVC is the model you use when the voice IS the product — an audiobook narrator, a branded IVR persona. Requirements: 30 minutes to 3 hours of clean studio audio, one speaker, one mic, one room. Training takes 4–8 hours. Only available on paid plans.

Claude Code — Terminal
Screenshot placeholder
PVC upload wizard showing an upload progress bar for 47 studio files.
Figure — PVC upload wizard showing an upload progress bar for 47 studio files.
Section 8

8. API Keys — Store Them Right

  1. Profile (top-right avatar) → API Keys → Create API Key.
  2. Name it after the project: helpdesk-prod, helpdesk-dev.
  3. Copy once — you cannot view it again. Paste into a .env file, never into code.
  4. Add .env to .gitignore. If you ever push a key: rotate immediately.
bashclaude-code
# .env
ELEVENLABS_API_KEY=sk_1234...abcd
ELEVENLABS_VOICE_ID=EXAVITQu4vr4xnSDxMaL
Claude Code — Terminal
Screenshot placeholder
API Keys page with one active key named helpdesk-prod and its last-used timestamp.
Figure — API Keys page with one active key named helpdesk-prod and its last-used timestamp.
Section 9

9. Billing & Pricing (at a glance)

  • Free — 10k chars/month, 3 custom voices, non-commercial.
  • Starter $5/mo — 30k chars, IVC, commercial license.
  • Creator $22/mo — 100k chars, PVC, 192 kbps audio.
  • Pro $99/mo — 500k chars, 44.1 kHz WAV, usage analytics.
  • Scale / Business — custom, priority latency, dedicated support.
Section 10

10. Generate Your First Voice (in the UI)

  1. Speech → Text to Speech.
  2. Voice: Rachel. Model: eleven_multilingual_v2.
  3. Paste: "Hello. My name is Nova. Welcome to voice automation."
  4. Click Generate. Preview. Download the MP3.
Claude Code — Terminal
Screenshot placeholder
Speech studio with Rachel selected, the greeting text pasted, and a waveform of the generated audio.
Figure — Speech studio with Rachel selected, the greeting text pasted, and a waveform of the generated audio.
Section 11

11. Voice Settings — What Each Slider Does

  • Stability (0–1) — low = expressive/variable, high = monotone/consistent. Start at 0.5.
  • Similarity Boost (0–1) — how tightly to match the original voice. Start at 0.75.
  • Style Exaggeration (0–1) — pushes the voice's characteristic style. Start at 0.0; raise for characters.
  • Speaker Boost — a toggle that sharpens speaker identity. Leave on.
Claude Code — Terminal
Screenshot placeholder
Voice settings drawer with the four sliders and the golden defaults applied.
Figure — Voice settings drawer with the four sliders and the golden defaults applied.
Section 12

12. Voice IDs — the 20 Characters That Matter

Every voice has a stable ID. Memorize a few, copy the rest from the library.

tsclaude-code
export const VOICES = {
  Rachel:  "21m00Tcm4TlvDq8ikWAM",
  Adam:    "pNInz6obpgDQGcFmaJgB",
  Bella:   "EXAVITQu4vr4xnSDxMaL",
  Antoni:  "ErXwobaYiN019PkySvjV",
  Domi:    "AZnzlk1XvdvUeBnXmlld",
} as const;
Section 13

13. API Testing — the Endpoint

The one endpoint you will hit most is:

httpclaude-code
POST https://api.elevenlabs.io/v1/text-to-speech/{voice_id}
Headers:
  xi-api-key: <YOUR_KEY>
  Content-Type: application/json
Body:
  {
    "text": "Hello world",
    "model_id": "eleven_multilingual_v2",
    "voice_settings": { "stability": 0.5, "similarity_boost": 0.75 }
  }
Response: audio/mpeg binary stream
Section 14

14. Using Postman

  1. New request → POST → paste the URL, replace {voice_id} with Rachel's ID.
  2. Headers: add xi-api-key = your key.
  3. Body → raw → JSON: paste the JSON above.
  4. Click Send and Download → save as hello.mp3. Play it.
Claude Code — Terminal
Screenshot placeholder
Postman with the request built, a 200 OK response, and the Send-and-Download button highlighted.
Figure — Postman with the request built, a 200 OK response, and the Send-and-Download button highlighted.
Section 15

15. Using Python

pythonclaude-code
# pip install requests python-dotenv
import os, requests
from dotenv import load_dotenv
load_dotenv()

KEY = os.environ["ELEVENLABS_API_KEY"]
VOICE = "21m00Tcm4TlvDq8ikWAM"   # Rachel

r = requests.post(
    f"https://api.elevenlabs.io/v1/text-to-speech/{VOICE}",
    headers={"xi-api-key": KEY, "Content-Type": "application/json"},
    json={
        "text": "Hello from Python.",
        "model_id": "eleven_multilingual_v2",
        "voice_settings": {"stability": 0.5, "similarity_boost": 0.75},
    },
    timeout=30,
)
r.raise_for_status()
open("hello.mp3", "wb").write(r.content)
print("wrote", len(r.content), "bytes")
Section 16

16. Using JavaScript (Node)

tsclaude-code
// npm i node-fetch dotenv
import "dotenv/config";
import { writeFileSync } from "node:fs";

const KEY = process.env.ELEVENLABS_API_KEY!;
const VOICE = "21m00Tcm4TlvDq8ikWAM";

const res = await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${VOICE}`, {
  method: "POST",
  headers: { "xi-api-key": KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    text: "Hello from JavaScript.",
    model_id: "eleven_multilingual_v2",
    voice_settings: { stability: 0.5, similarity_boost: 0.75 },
  }),
});
if (!res.ok) throw new Error(await res.text());
writeFileSync("hello.mp3", Buffer.from(await res.arrayBuffer()));
console.log("done");
Section 17

17. Using cURL (one liner)

bashclaude-code
curl -X POST "https://api.elevenlabs.io/v1/text-to-speech/21m00Tcm4TlvDq8ikWAM" \
  -H "xi-api-key: $ELEVENLABS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"text":"Hello from cURL","model_id":"eleven_multilingual_v2"}' \
  --output hello.mp3
Claude Code — Terminal
Screenshot placeholder
Terminal after the cURL call — a 200 status line, then 'hello.mp3' appearing in ls output.
Figure — Terminal after the cURL call — a 200 status line, then 'hello.mp3' appearing in ls output.
Section 18

18. Downloading Audio — Formats

  • mp3_44100_128 — default, 44.1 kHz, 128 kbps — good for most cases.
  • mp3_22050_32 — smaller, telephony grade.
  • pcm_16000 — raw PCM, feed into Twilio / DSP.
  • ulaw_8000 — μ-law 8 kHz, real phone lines.

Set with the output_format query param: ?output_format=pcm_16000.

Section 19

19. Best Settings by Use Case

tsclaude-code
// Copy-paste presets
export const PRESETS = {
  narration:    { stability: 0.55, similarity_boost: 0.80, style: 0.0 },
  conversation: { stability: 0.35, similarity_boost: 0.80, style: 0.15 },
  ivr:          { stability: 0.75, similarity_boost: 0.85, style: 0.0 },
  character:    { stability: 0.25, similarity_boost: 0.75, style: 0.6 },
};
Section 20

20. Troubleshooting

  • 401 Unauthorized → wrong or rotated API key. Regenerate; update .env.
  • 422 Unprocessable → text too long (max 5000 chars per request) or invalid voice_id.
  • 429 Rate Limit → your plan's concurrency exceeded. Back off 1s and retry.
  • Robotic output → stability too high. Drop to 0.35.
  • Muffled clone → training audio had noise. Re-upload denoised WAV.