{"id":18622366,"url":"https://github.com/lugia19/elevenlabslib","last_synced_at":"2025-10-07T02:33:22.760Z","repository":{"id":65957744,"uuid":"603231098","full_name":"lugia19/elevenlabslib","owner":"lugia19","description":"Full python wrapper for the elevenlabs API.","archived":false,"fork":false,"pushed_at":"2025-03-02T01:12:32.000Z","size":572,"stargazers_count":157,"open_issues_count":3,"forks_count":28,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-09T10:07:38.165Z","etag":null,"topics":["api-wrapper","elevenlabs","python","text-to-speech","tts"],"latest_commit_sha":null,"homepage":"","language":"Python","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/lugia19.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"lugia19","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-02-17T22:33:30.000Z","updated_at":"2025-04-22T03:00:41.000Z","dependencies_parsed_at":"2023-12-02T12:24:20.128Z","dependency_job_id":"e65ddabe-f4c8-4cfe-85ea-a5d167978740","html_url":"https://github.com/lugia19/elevenlabslib","commit_stats":{"total_commits":49,"total_committers":1,"mean_commits":49.0,"dds":0.0,"last_synced_commit":"5bdd45c31cc15ae388d0d64f754c48fdd056a81a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lugia19%2Felevenlabslib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lugia19%2Felevenlabslib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lugia19%2Felevenlabslib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lugia19%2Felevenlabslib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lugia19","download_url":"https://codeload.github.com/lugia19/elevenlabslib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471060,"owners_count":22076585,"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":["api-wrapper","elevenlabs","python","text-to-speech","tts"],"created_at":"2024-11-07T04:16:35.455Z","updated_at":"2025-10-07T02:33:22.657Z","avatar_url":"https://github.com/lugia19.png","language":"Python","funding_links":["https://ko-fi.com/lugia19","https://ko-fi.com/lugia19'"],"categories":[],"sub_categories":[],"readme":"# elevenlabslib\n\u003ca href='https://ko-fi.com/lugia19' target='_blank'\u003e\u003cimg height='35' style='border:0px;height:46px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n![PyPI - Downloads](https://img.shields.io/pypi/dm/elevenlabslib?color=%23009FFFFF\u0026style=for-the-badge)\n![PyPI](https://img.shields.io/pypi/v/elevenlabslib?color=%23FE6137\u0026style=for-the-badge)\n![GitHub last commit](https://img.shields.io/github/last-commit/lugia19/elevenlabslib?style=for-the-badge)\n\nPython wrapper for the full elevenlabs API.\n\n### NOTE: There's now an official wrapper, but this project will continue to be maintained.\n\nThe main reason is the different approach to playback. By doing playback purely within python instead of piping to an external process, there are a couple of important extra things that can be done, such as:\n- Playback on a specific output device\n- Running functions exactly when the playback begins and ends\n- Controlling the playback from within python\n\n\n### **Documentation now available at https://elevenlabslib.readthedocs.io/en/latest/**\n\n# Installation\n\nJust run `pip install elevenlabslib`, it's on [pypi](https://pypi.org/project/elevenlabslib/).\n\nNote: On Linux, you may need to install portaudio. On debian and derivatives, it's `sudo apt-get install libportaudio2`, and possibly also `sudo apt-get install python3-pyaudio`.\n\n**IMPORTANT**: The library requires libsndfile `v1.1.0` or newer, as that is when mp3 support was introduced. This won't be an issue on Windows, but may be relevant on other platforms. Check the [soundfile](https://github.com/bastibe/python-soundfile#installation) repo for more information.\n\n# Usage\n\nFor a far more comprehensive example, check [example.py](https://github.com/lugia19/elevenlabslib/blob/master/example.py) or [the docs](https://elevenlabslib.readthedocs.io/en/latest/).\n\nHere is a very simple usage sample. \n- Retrieves a voice based on the name\n- Plays back (using the included playback functions that use sounddevice) all its samples (and the preview) \n- Generates and plays back a new audio\n- Deletes the newly created audio from the user history\n\n```py\nfrom elevenlabslib import *\n\nuser = User(\"API_KEY\")\nvoice = user.get_voices_by_name_v2(\"Rachel\")[0]  # This is a list because multiple voices can have the same name\n\nvoice.generate_play_audio_v2(\"Test.\", playbackOptions=PlaybackOptions(runInBackground=False))\n\nfor historyItem in user.get_history_items_paginated():\n    if historyItem.text == \"Test.\":\n        # The first items are the newest, so we can stop as soon as we find one.\n        historyItem.delete()\n        break\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flugia19%2Felevenlabslib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flugia19%2Felevenlabslib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flugia19%2Felevenlabslib/lists"}