You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 5, 2026. It is now read-only.
nothing else. it builds on top of built-in node modules.
How to use
Create a new project
Use npm install @arellak/elevenlabs-wrapper to install the package
// import ElevenLabs WrapperimportElevenLabsfrom"@arellak/elevenlabs-wrapper";// Create a new instance of ElevenLabsconstelevenLabs=newElevenLabs({apiKey: "YOUR_API_KEY",outputFolder: "./output"});
Constructor Options
Option
Type
Description
default
notes
apiKey
string
Your ElevenLabs API Key
undefined
-
outputFolder
string
folder where files will be saved
./output
created automatically if it doesn't exist
Methods
// Converts text to speech, saves the file to the output folder and returns the relative path to the file.// Output file is in the following format: TTS_date-time.mp3// Returns an object with the following structure: { code: CODE, message: "STATUS_MESSAGE" }awaitelevenLabs.tts(text,voiceId,optionalPath="",modelId="eleven_multilingual_v2",voiceSettings={stability: 0.5,similarity_boost: 0.75},params={output_format: "mp3_44100_128",optimize_streaming_latency: 0});
0 (default) = No optimization.
1 = Some optimization.
2 = More optimization.
3 = Max optimization.
4 = Max optimizations & text normalizer off.
// Returns the remaining letters you have left for the monthawaitelevenLabs.getRemainingLetters();// Returns all the available modelsawaitelevenLabs.getModels();// Returns all the available voicesawaitelevenLabs.getVoices();// Returns all the voices you created yourselfawaitelevenLabs.getCustomVoices();// Returns the IDs and names of the voices you created yourself// Example: { name:"My Voice", id:"123456789" }awaitelevenLabs.getCustomVoiceIds();// Returns default settings for voicesawaitelevenLabs.getDefaultVoiceSettings();// Returns settings for a specific voiceawaitelevenLabs.getVoiceSettings(voiceId);// Returns a given voiceawaiteleveawaitnLabs.getVoice(voiceId);// Returns the sample names and IDs for a given voice// Example: { name:"My Sample", sampleId:"123456789" }awaitelevenLabs.getSampleIds(voiceId);// Downloads audio for a given sample from a given voice// Saves it to the output folder specified in the constructor and returns the relative path to the file.// Output file is in the following format: SAMPLE_date-time.mp3// Optional Path is the same as in the tts method.// Returns an object with the following structure: { code: CODE, message: "STATUS_MESSAGE" }awaitelevenLabs.getAudioFromSample(voiceId,sampleId,optionalPath="");// Returns the history for the given AccountawaitelevenLabs.getHistory();// Returns the data for the given historyItemIdawaitelevenLabs.getHistoryItem(historyItemId);// Downloads the audio for the given historyItemId// Saves it to the output folder specified in the constructor and returns the relative path to the file.// Output file is in the following format: HISTORY_date-time.mp3// Optional Path is the same as in the tts method.// Returns an object with the following structure: { code: CODE, message: "STATUS_MESSAGE" }awaitelevenLabs.getAudioFromHistoryItem(historyItemId,optionalPath="");// Download an array of history items// Saves them to the output folder specified in the constructor and returns an array of relative paths to the files.// Optional Path is the same as in the tts method.// Output files are in the following format: HISTORY_date-time.zipawaitelevenLabs.downloadHistoryItems(historyItemIds,optionalPath="");// Returns information about the user's accountawaitelevenLabs.getUserInfo();// Returns the user's subscription informationawaitelevenLabs.getUserSubscriptionInfo();awaitelevenLabs.getProjects();awaitelevenLabs.getProjectById("ID");// Additional parameters:// acxVolumeNormalization = false, author = "", fromDocument = "", fromUrl = "", isbnNumber = "", qualityPreset = "standard", title = ""awaitelevenLabs.addProject("DEFAULT_MODEL_ID","DEFAULT_PARAGRAPH_VOICE_ID","DEFAULT_TITLE_VOICE_ID","NAME","PRONOUNCIATION_DICTIONARY_LOCATORS");awaitelevenLabs.deleteProject("PROJECT_ID");awaitelevenLabs.convertProject("PROJECT_ID");awaitelevenLabs.getProjectSnapshots("PROJECT_ID");awaitelevenLabs.streamProjectAudio("PROJECT_ID","PROJECT_SNAPSHOT_ID");awaitelevenLabs.getChapters("PROJECT_ID");awaitelevenLabs.getChapterById("PROJECT_ID","CHAPTER_ID");awaitelevenLabs.deleteChapter("PROJECT_ID","CHAPTER_ID");awaitelevenLabs.convertChapter("PROJECT_ID","CHAPTER_ID");awaitelevenLabs.getChapterSnapshots("PROJECT_ID","CHAPTER_ID");awaitelevenLabs.streamChapterAudio("PROJECT_ID","CHAPTER_ID","CHAPTER_SNAPSHOT_ID");
// Edit voice settings for a given voiceawaitelevenLabs.editVoiceSettings(voiceId,voiceSettings);
// Add a new voice with the given name, description, file paths and labels// Returns the voice idawaitelevenLabs.addVoice(name,filePaths,optionalSettings);
// Edit the voice with a given name and voice id// include the optional settings you want to change// returns status code if it was successfulawaitelevenLabs.editVoice(name,voiceId,optionalSettings);
After registering an account and having a paid subscription, you can create your own custom voice on the website.
If you don't want to use a custom voice, you can use the default voices. You can find the IDs for the default voices by using the ElevenLabs.getVoices() method.
If you want to use a custom voice, you can use the ElevenLabs.getCustomVoiceIds() method to get the IDs for your custom voices.
Something doesn't work. What should I do?
Check if you have the latest version of the package installed.
Did you follow all the steps at the beginning of this Readme?
Did you enter your API Key correctly?
Did you enter the correct voice ID?
If you did all the above and you are sure it's a problem with the package, please contact me on Discord, via E-Mail or create an issue.
If you think it's a problem with ElevenLabs, please contact them directly since I'm not affiliated with them.