{"id":17886638,"url":"https://github.com/arellak/elevenlabs-wrapper","last_synced_at":"2025-03-22T14:31:41.778Z","repository":{"id":195961422,"uuid":"694184240","full_name":"arellak/elevenlabs-wrapper","owner":"arellak","description":"NodeJS wrapper for the ElevenLabs API","archived":false,"fork":false,"pushed_at":"2023-11-30T15:19:06.000Z","size":89,"stargazers_count":4,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T22:34:51.534Z","etag":null,"topics":["ai","api","eleven-labs","elevenlabs","hacktoberfest","nodejs","speech","text","to","voice","wrapper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arellak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-20T13:47:25.000Z","updated_at":"2024-01-16T08:36:55.000Z","dependencies_parsed_at":"2024-10-28T13:22:35.695Z","dependency_job_id":"7584cba2-2301-497f-afb6-677186f52da6","html_url":"https://github.com/arellak/elevenlabs-wrapper","commit_stats":null,"previous_names":["arellak/elevenlabs-wrapper"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arellak%2Felevenlabs-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arellak%2Felevenlabs-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arellak%2Felevenlabs-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arellak%2Felevenlabs-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arellak","download_url":"https://codeload.github.com/arellak/elevenlabs-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244972157,"owners_count":20540932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","eleven-labs","elevenlabs","hacktoberfest","nodejs","speech","text","to","voice","wrapper"],"created_at":"2024-10-28T13:08:39.990Z","updated_at":"2025-03-22T14:31:41.524Z","avatar_url":"https://github.com/arellak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ElevenLabs API Wrapper\n\u003ch2 align=\"center\"\u003e\nWrapper for the ElevenLabs API\n\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/github/contributors/arellak/elevenlabs-wrapper\" /\u003e\n\u003cimg src=\"https://img.shields.io/github/issues/arellak/elevenlabs-wrapper\" /\u003e\n\u003cimg src=\"https://img.shields.io/github/issues-pr/arellak/elevenlabs-wrapper\" /\u003e\n\u003cimg src=\"https://img.shields.io/github/stars/arellak/elevenlabs-wrapper\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nCheck out the \u003ca href=\"https://www.npmjs.com/package/@arellak/elevenlabs-wrapper\"\u003enpm\u003c/a\u003e page!\n\u003c/p\u003e\n\n## Requirements\n- [Node.js](https://nodejs.org/en/)\n- [ElevenLabs Account](https://elevenlabs.io/)\n- nothing else. it builds on top of built-in node modules.\n\n## How to use\n1. Create a new project\n2. Use `npm install @arellak/elevenlabs-wrapper` to install the package\n\n```js\n// import ElevenLabs Wrapper\nimport ElevenLabs from \"@arellak/elevenlabs-wrapper\";\n\n// Create a new instance of ElevenLabs\nconst elevenLabs = new ElevenLabs(\n    {\n        apiKey: \"YOUR_API_KEY\",\n        outputFolder: \"./output\"\n    }\n);\n```\n## Constructor Options\u003cbr\u003e\n| Option | Type | Description | default | notes |\n| --- | --- | --- | --- | --- |\n| apiKey | string | Your ElevenLabs API Key | undefined | - |\n| outputFolder | string | folder where files will be saved | ./output | created automatically if it doesn't exist |\n\u003cbr\u003e\n\n## Methods\n```js\n// Converts text to speech, saves the file to the output folder and returns the relative path to the file.\n// Output file is in the following format: TTS_date-time.mp3\n// Returns an object with the following structure: { code: CODE, message: \"STATUS_MESSAGE\" }\nawait elevenLabs.tts(\n    text,\n    voiceId,\n    optionalPath = \"\",\n    modelId = \"eleven_multilingual_v2\",\n    voiceSettings = {\n        stability: 0.5,\n        similarity_boost: 0.75\n    },\n    params = {\n        output_format: \"mp3_44100_128\",\n        optimize_streaming_latency: 0\n    }\n);\n```\n| Option | Type | Description | default | notes |\n| --- | --- | --- | --- | --- |\n| text | string | text to be converted to speech | undefined | - |\n| voiceId | string | voice id to be used | undefined | - |\n| optionalPath | string | optional path to save the file to | \"\" | - |\n| modelId | string | model id to be used | eleven_multilingual_v2 | [eleven_monolingual_v1, eleven_multilingual_v2] |\n| voiceSettings | object | voice settings | {stability: 0.5, similarity_boost: 0.75} | {stability, similarity_boost, style, use_speaker_boost} |\n| params | object | additional params | {output_format: \"mp3_44100_128\", optimize_streaming_latency: 0} | - |\n\u003cbr\u003e\n### Streaming Latencies\n\n0 (default) = No optimization.\u003cbr\u003e\n1 = Some optimization.\u003cbr\u003e\n2 = More optimization.\u003cbr\u003e\n3 = Max optimization.\u003cbr\u003e\n4 = Max optimizations \u0026 text normalizer off.\n\u003chr\u003e\n\n```js\n// Returns the remaining letters you have left for the month\nawait elevenLabs.getRemainingLetters();\n\n// Returns all the available models\nawait elevenLabs.getModels();\n\n// Returns all the available voices\nawait elevenLabs.getVoices();\n\n// Returns all the voices you created yourself\nawait elevenLabs.getCustomVoices();\n\n// Returns the IDs and names of the voices you created yourself\n// Example: { name:\"My Voice\", id:\"123456789\" }\nawait elevenLabs.getCustomVoiceIds();\n\n// Returns default settings for voices\nawait elevenLabs.getDefaultVoiceSettings();\n\n// Returns settings for a specific voice\nawait elevenLabs.getVoiceSettings(voiceId);\n\n// Returns a given voice\nawait eleveawait nLabs.getVoice(voiceId);\n\n// Returns the sample names and IDs for a given voice\n// Example: { name:\"My Sample\", sampleId:\"123456789\" }\nawait elevenLabs.getSampleIds(voiceId);\n\n// Downloads audio for a given sample from a given voice\n// Saves it to the output folder specified in the constructor and returns the relative path to the file.\n// Output file is in the following format: SAMPLE_date-time.mp3\n// Optional Path is the same as in the tts method.\n// Returns an object with the following structure: { code: CODE, message: \"STATUS_MESSAGE\" }\nawait elevenLabs.getAudioFromSample(voiceId, sampleId, optionalPath = \"\");\n\n// Returns the history for the given Account\nawait elevenLabs.getHistory();\n\n// Returns the data for the given historyItemId\nawait elevenLabs.getHistoryItem(historyItemId);\n\n// Downloads the audio for the given historyItemId\n// Saves it to the output folder specified in the constructor and returns the relative path to the file.\n// Output file is in the following format: HISTORY_date-time.mp3\n// Optional Path is the same as in the tts method.\n// Returns an object with the following structure: { code: CODE, message: \"STATUS_MESSAGE\" }\nawait elevenLabs.getAudioFromHistoryItem(historyItemId, optionalPath = \"\");\n\n// Download an array of history items\n// Saves them to the output folder specified in the constructor and returns an array of relative paths to the files.\n// Optional Path is the same as in the tts method.\n// Output files are in the following format: HISTORY_date-time.zip\nawait elevenLabs.downloadHistoryItems(historyItemIds, optionalPath = \"\");\n\n// Returns information about the user's account\nawait elevenLabs.getUserInfo();\n\n// Returns the user's subscription information\nawait elevenLabs.getUserSubscriptionInfo();\n\nawait elevenLabs.getProjects();\n\nawait elevenLabs.getProjectById(\"ID\");\n\n// Additional parameters:\n// acxVolumeNormalization = false, author = \"\", fromDocument = \"\", fromUrl = \"\", isbnNumber = \"\", qualityPreset = \"standard\", title = \"\"\nawait elevenLabs.addProject(\"DEFAULT_MODEL_ID\", \"DEFAULT_PARAGRAPH_VOICE_ID\", \"DEFAULT_TITLE_VOICE_ID\", \"NAME\", \"PRONOUNCIATION_DICTIONARY_LOCATORS\");\n\nawait elevenLabs.deleteProject(\"PROJECT_ID\");\n\nawait elevenLabs.convertProject(\"PROJECT_ID\");\n\nawait elevenLabs.getProjectSnapshots(\"PROJECT_ID\");\n\nawait elevenLabs.streamProjectAudio(\"PROJECT_ID\", \"PROJECT_SNAPSHOT_ID\");\n\nawait elevenLabs.getChapters(\"PROJECT_ID\");\n\nawait elevenLabs.getChapterById(\"PROJECT_ID\", \"CHAPTER_ID\");\n\nawait elevenLabs.deleteChapter(\"PROJECT_ID\", \"CHAPTER_ID\");\n\nawait elevenLabs.convertChapter(\"PROJECT_ID\", \"CHAPTER_ID\");\n\nawait elevenLabs.getChapterSnapshots(\"PROJECT_ID\", \"CHAPTER_ID\");\n\nawait elevenLabs.streamChapterAudio(\"PROJECT_ID\", \"CHAPTER_ID\", \"CHAPTER_SNAPSHOT_ID\");\n```\n\n```js\n// Edit voice settings for a given voice\nawait elevenLabs.editVoiceSettings(voiceId, voiceSettings);\n```\n| Option | Type | Description | default | notes |\n| --- | --- | --- | --- | --- |\n| voiceId | string | voice id to be used | undefined | - |\n| voiceSettings | object | voice settings | {stability: 0.5, similarity_boost: 0.75} | {stability, similarity_boost, style, use_speaker_boost} |\n\u003cbr\u003e\n\n```js\n// Add a new voice with the given name, description, file paths and labels\n// Returns the voice id\nawait elevenLabs.addVoice(name, filePaths, optionalSettings);\n```\n| Option | Type | Description | default | notes | required |\n| --- | --- | --- | --- | --- | --- |\n| name | string | name of the voice | undefined | - | yes |\n| filePaths | array | array of file paths | undefined | - | yes |\n| optionalSettings | object | optional settings | {} | {description, labels} | no |\n\n```js\n// Usage example\nconst newVoiceId = await elevenLabs.addVoice(\n    \"TEST NAME\", \n    [\n        \"./output/test3.mp3\",\n    ], \n    {\n        labels: { \n            age: \"early 20s\"\n        },\n        description: \"test description\",\n    },\n);\n```\n\n```js\n// Edit the voice with a given name and voice id\n// include the optional settings you want to change\n// returns status code if it was successful\nawait elevenLabs.editVoice(name, voiceId, optionalSettings);\n```\n| Option | Type | Description | default | notes | required |\n| --- | --- | --- | --- | --- | --- |\n| name | string | name of the voice | undefined | - | yes |\n| voiceId | string | voice id to be used | undefined | - | yes |\n| optionalSettings | object | optional settings | {} | {description, file paths, labels} | no |\n\n```js\n// Usage example\nconst editedVoice = await elevenLabs.editVoice(\n    \"TEST NAME\",\n    \"YOUR_VOICE_ID\",\n    {\n        filePaths: [\n            \"./output/test3.mp3\",\n        ],\n        labels: {\n            age: \"early 20s\",\n        },\n    },\n);\n```\n\n```js\n// Deletes a voice\nawait elevenLabs.deleteVoice(voiceId);\n```\n| Option | Type | Description | default | notes |\n| --- | --- | --- | --- | --- |\n| voiceId | string | voice id to be used | undefined | - |\n\u003cbr\u003e\n\n```js\n// Deletes a sample with a given voice id and sample id\nawait elevenLabs.deleteSample(voiceId, sampleId);\n```\n| Option | Type | Description | default | notes |\n| --- | --- | --- | --- | --- |\n| voiceId | string | voice id to be used | undefined | - |\n| sampleId | string | sample id to be used | undefined | - |\n\u003cbr\u003e\n\n```js\n// Deletes a history item with a given history item id\nawait elevenLabs.deleteHistoryItem(historyItemId);\n```\n| Option | Type | Description | default | notes |\n| --- | --- | --- | --- | --- |\n| historyItemId | string | history item id to be used | undefined | - |\n\u003cbr\u003e\n\n## Need help? \nDiscord: @arellak\u003cbr\u003e\nE-Mail: [nimble0@protonmail.com](mailto:nimble0@protonmail.com)\n\n## FAQ\n### How do I get an API Key?\n1. Register an Account at [ElevenLabs](https://elevenlabs.io/).\n2. Click on the image on the top right.\n3. Click on \"Profile\"\n4. Show the API Key and copy it\n\n### How do I get a voice id?\nAfter registering an account and having a paid subscription, you can create your own custom voice on the website.\u003cbr\u003e\nIf 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.\u003cbr\u003e\nIf you want to use a custom voice, you can use the `ElevenLabs.getCustomVoiceIds()` method to get the IDs for your custom voices.\n\n### Something doesn't work. What should I do?\n1. Check if you have the latest version of the package installed.\n2. Did you follow all the steps at the beginning of this Readme?\n3. Did you enter your API Key correctly?\n4. Did you enter the correct voice ID?\n\nIf 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.\u003cbr\u003e\nIf you think it's a problem with ElevenLabs, please contact them directly since I'm not affiliated with them.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## Credits\n[ElevenLabs](https://elevenlabs.io/) for the API\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farellak%2Felevenlabs-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farellak%2Felevenlabs-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farellak%2Felevenlabs-wrapper/lists"}