How to Get an ElevenLabs API Key: A Step-by-Step Guide
On this page
This guide shows you how to get an ElevenLabs API key. You'll create an ElevenLabs account, generate your key, and make your first API call, plus a free alternative for adding ElevenLabs models to your web app.
Prerequisites
- An email, GitHub, or Google account for signing up
- Basic familiarity with code (we'll show simple JavaScript examples)
Step 1: Create Your ElevenLabs Account
Go to elevenlabs.io/app/api. You'll see a login or sign-up page — create your account using your Google account, GitHub, or email.
Once you've signed up, you'll land on the dashboard.
Step 2: Generate Your API Key
Find the API Keys menu in the sidebar and navigate to the API keys page.
Click + Create Key to generate a new API key. You can set a descriptive name for your key and adjust restrictions and permissions as needed.
Important: Copy the key immediately after creation. ElevenLabs only shows it once. If you lose it, you'll need to generate a new one.
Store it somewhere safe — a password manager, an .env file, or your platform's secrets manager. Never commit API keys to a public repository.
Step 3: Make Your First API Call
Install the ElevenLabs SDK:
npm install @elevenlabs/elevenlabs-js
Then make a text-to-speech request:
import { ElevenLabsClient } from '@elevenlabs/elevenlabs-js';
const client = new ElevenLabsClient({ apiKey: 'your_api_key' });
// Get raw response with headers
const { data, rawResponse } = await client.textToSpeech
.convert('voice_id', {
text: 'Hello, world!',
modelId: 'eleven_multilingual_v2',
})
.withRawResponse();
// Access character cost from headers
const charCost = rawResponse.headers.get('x-character-count');
const requestId = rawResponse.headers.get('request-id');
const audioData = data;
If you get an audio file back, everything is working. For the full set of endpoints and parameters, see ElevenLabs' official API docs.
Can You Use the ElevenLabs API for Free?
Creating an API key is free, but using it requires paying per character (or running down a subscription's bundled credits). ElevenLabs bills text to speech by the character, and the rest of its catalog by audio duration.
ElevenLabs has a free plan that includes 10,000 credits a month, which covers roughly 10 minutes of Multilingual text to speech, and gives access to most API endpoints. The free plan has no commercial license, so it suits prototyping and testing rather than production. Commercial use starts at the Starter tier ($6/month).
Puter.js offers a different model. With its User-Pays model, you can add ElevenLabs models to your app for free: each user covers their own AI usage through their own Puter account, so your cost stays at $0 regardless of how many users you have, with no API key and no backend.
Add ElevenLabs models with the browser script tag:
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.txt2speech("Explain quantum computing in simple terms", {
provider: "elevenlabs",
model: "eleven_multilingual_v2"
}).then(audio => {
document.body.appendChild(audio);
audio.play();
});
</script>
or the npm package:
import { puter } from '@heyputer/puter.js';
const audio = await puter.ai.txt2speech("Explain quantum computing in simple terms", {
provider: "elevenlabs",
model: "eleven_multilingual_v2"
});
audio.play();
This fits front-end apps where your users sign into Puter: usage is tied to their accounts, and Puter.js runs in the browser, so it does not replace a server-side key for a backend you control. For a backend, see the pricing below.
How Much Does the ElevenLabs API Cost?
ElevenLabs bills text to speech per character. The high-quality Multilingual v2/v3 model is $0.10 per 1,000 characters, and the faster Flash/Turbo model is $0.05 per 1,000 characters, the cheapest way to generate speech on the platform. The rest of the catalog (speech to text, dubbing, music, voice changer) is priced by audio duration, per minute or per hour.
For the full breakdown, see our ElevenLabs API pricing guide.
Why Isn't My Key Working?
Most first-call failures trace back to a few errors:
- 401, invalid_api_key: the key is wrong, was revoked, or picked up a stray space or newline when copied. Regenerate it and paste again.
- 401, missing_api_key: no key reached the request, usually a missing
xi-api-keyheader or an unset environment variable. Confirm the key is being sent. - 402, insufficient_credits: the account is out of credits. Top up or upgrade your plan, then retry.
- 403, model_access_denied: your plan does not include the model you requested. Switch to a model your tier allows or upgrade.
- 429, rate_limit_exceeded: requests are going out faster than your tier allows. Add retries with exponential backoff, or move up a plan.
- 429, concurrent_limit_exceeded: too many requests are running at once for your tier. Queue them or raise the concurrency limit on a higher plan.
Most of these come back to billing and plan limits, so check those first. For the full list of status and error codes, see ElevenLabs' error codes reference.
Conclusion
To get an ElevenLabs API key: sign up at elevenlabs.io, then go to API Keys in the sidebar and click + Create Key. From there you can make your first API call, or skip the key entirely and add ElevenLabs models to a web app for free with Puter.js.
Related
- How to Get an OpenAI API Key
- How to Get an Anthropic (Claude) API Key
- How to Get a Gemini API Key
- How to Get a Grok (xAI) API Key
- How to Get a DeepSeek API Key
- How to Get a Mistral API Key
- How to Get a MiniMax API Key
- How to Get a Moonshot AI (Kimi) API Key
- How to Get a Qwen API Key
- How to Get a Z.AI (GLM) API Key
- How to Get an OpenRouter API Key
- How to Get a Together AI API Key
- How to Get a FLUX (Black Forest Labs) API Key
- How to Get a Stability AI (Stable Diffusion) API Key
- How to Get a Kling API Key
- How to Get a Leonardo.Ai API Key
- How to Get a Cohere API Key
- ElevenLabs API Pricing
- Free, Unlimited ElevenLabs API
- Free, Unlimited Text-to-Speech API
- Free, Unlimited OpenAI API
- Free, Unlimited Claude API
Ship a Full-Stack App with One Prompt
Build an AI chat app using Puter.js
Coding manually? see the guide