Quickstart
Start generating your first text-to-speech using Python and ElevenLabs API
The ElevenLabs API provides a simple interface to state-of-the-art audio models and features. Follow this guide to learn how to create lifelike speech, generate and modify voices, produce immersive sound effects, isolate background noise from audio, and seamlessly dub audio/videos.
Create and export an API key
Create an API key in the dashboard here, which you’ll use to securely access the API. Store the key in a safe location, like a .zshrc
file or another text file on your computer. Once you’ve generated an API key, export it as an environment variable in your terminal.
macOS/Linux
Windows
Make your first API request
With your ElevenLabs API key exported as an environment variable, you’re ready to make your first API request. You can either use the REST API directly with the HTTP client of your choice, or use one of our official SDKs as shown below.
Javascript
Python
To use the ElevenLabs API in server-side JavaScript environments like Node.js, Deno, or Bun, you can use the official ElevenLabs SDK for TypeScript and JavaScript. Get started by installing the SDK using npm or your preferred package manager:
With the ElevenLabs SDK installed, create a file called example.mjs
and copy one of the following examples into it:
Text to Speech
Voice Changer
Text to Sound Effects
Audio Isolation
Text to Voice
Dubbing
Execute the code with node example.mjs
(or the equivalent command for Deno or Bun). In a few seconds, you should hear the audio play through your speaker.